diff --git a/lending/.gitattributes b/lending/.gitattributes new file mode 100644 index 00000000..15532825 --- /dev/null +++ b/lending/.gitattributes @@ -0,0 +1,12 @@ +# +# https://help.github.com/articles/dealing-with-line-endings/ +# +# Linux start script should use lf +/gradlew text eol=lf + +# These are Windows script files and should use crlf +*.bat text eol=crlf + +# This allows generated code to be indexed correctly +*.java linguist-generated=false + diff --git a/lending/.gitignore b/lending/.gitignore new file mode 100644 index 00000000..df0a9853 --- /dev/null +++ b/lending/.gitignore @@ -0,0 +1,9 @@ +# Ignore Gradle project-specific cache directory +.gradle +# Ignore Gradle build output directory +build +bin/ +# Ignore IDE-specific configs +.project +.settings/ +.DS_Store diff --git a/lending/.speakeasy/gen.lock b/lending/.speakeasy/gen.lock new file mode 100755 index 00000000..68ce7f7d --- /dev/null +++ b/lending/.speakeasy/gen.lock @@ -0,0 +1,1526 @@ +lockVersion: 2.0.0 +id: 43205c24-df3f-4054-95be-bcfde8cc1d91 +management: + docChecksum: 1f0dd58ae834c387f85778d2df356f46 + docVersion: 3.0.0 + speakeasyVersion: internal + generationVersion: 2.250.8 + releaseVersion: 0.1.0 + configChecksum: ae5fe60f613e2f071a870d65e1e50c01 + repoURL: https://github.com/codatio/client-sdk-java.git + repoSubDirectory: lending + published: true +features: + java: + constsAndDefaults: 0.1.0 + core: 3.10.0 + deprecations: 2.81.1 + downloadStreams: 0.1.1 + examples: 2.81.3 + globalSecurity: 2.82.2 + globalServerURLs: 2.82.1 + groups: 2.81.2 + inputOutputModels: 2.83.0 + nameOverrides: 2.81.2 +generatedFiles: + - lib/src/main/java/io/codat/lending/SecuritySource.java + - lib/src/main/java/io/codat/lending/SDKConfiguration.java + - lib/src/main/java/io/codat/lending/Companies.java + - lib/src/main/java/io/codat/lending/Connections.java + - lib/src/main/java/io/codat/lending/AccountTransactions.java + - lib/src/main/java/io/codat/lending/CodatLendingDirectCosts.java + - lib/src/main/java/io/codat/lending/CodatLendingTransfers.java + - lib/src/main/java/io/codat/lending/JournalEntries.java + - lib/src/main/java/io/codat/lending/Journals.java + - lib/src/main/java/io/codat/lending/Transactions.java + - lib/src/main/java/io/codat/lending/Accounts.java + - lib/src/main/java/io/codat/lending/CodatLendingAccountingBankData.java + - lib/src/main/java/io/codat/lending/AccountBalances.java + - lib/src/main/java/io/codat/lending/CodatLendingAccounts.java + - lib/src/main/java/io/codat/lending/TransactionCategories.java + - lib/src/main/java/io/codat/lending/CodatLendingBankingTransactions.java + - lib/src/main/java/io/codat/lending/CategorizedStatement.java + - lib/src/main/java/io/codat/lending/Banking.java + - lib/src/main/java/io/codat/lending/Bills.java + - lib/src/main/java/io/codat/lending/Suppliers.java + - lib/src/main/java/io/codat/lending/BillCreditNotes.java + - lib/src/main/java/io/codat/lending/BillPayments.java + - lib/src/main/java/io/codat/lending/AccountsPayable.java + - lib/src/main/java/io/codat/lending/CodatLendingCustomers.java + - lib/src/main/java/io/codat/lending/Disputes.java + - lib/src/main/java/io/codat/lending/Locations.java + - lib/src/main/java/io/codat/lending/Orders.java + - lib/src/main/java/io/codat/lending/PaymentMethods.java + - lib/src/main/java/io/codat/lending/CodatLendingSalesPayments.java + - lib/src/main/java/io/codat/lending/ProductCategories.java + - lib/src/main/java/io/codat/lending/Products.java + - lib/src/main/java/io/codat/lending/CodatLendingTransactions.java + - lib/src/main/java/io/codat/lending/Metrics.java + - lib/src/main/java/io/codat/lending/CodatLendingReports.java + - lib/src/main/java/io/codat/lending/Sales.java + - lib/src/main/java/io/codat/lending/CompanyInfo.java + - lib/src/main/java/io/codat/lending/Customers.java + - lib/src/main/java/io/codat/lending/DirectIncomes.java + - lib/src/main/java/io/codat/lending/Invoices.java + - lib/src/main/java/io/codat/lending/CreditNotes.java + - lib/src/main/java/io/codat/lending/Payments.java + - lib/src/main/java/io/codat/lending/Reports.java + - lib/src/main/java/io/codat/lending/AccountsReceivable.java + - lib/src/main/java/io/codat/lending/FileUpload.java + - lib/src/main/java/io/codat/lending/BankAccounts.java + - lib/src/main/java/io/codat/lending/BankTransactions.java + - lib/src/main/java/io/codat/lending/CodatLendingLoanWritebackAccounts.java + - lib/src/main/java/io/codat/lending/DirectCosts.java + - lib/src/main/java/io/codat/lending/CodatLendingPayments.java + - lib/src/main/java/io/codat/lending/CodatLendingSuppliers.java + - lib/src/main/java/io/codat/lending/Transfers.java + - lib/src/main/java/io/codat/lending/CreateOperations.java + - lib/src/main/java/io/codat/lending/LoanWriteback.java + - lib/src/main/java/io/codat/lending/CodatLendingFinancialStatementsAccounts.java + - lib/src/main/java/io/codat/lending/BalanceSheet.java + - lib/src/main/java/io/codat/lending/CashFlow.java + - lib/src/main/java/io/codat/lending/ProfitAndLoss.java + - lib/src/main/java/io/codat/lending/FinancialStatements.java + - lib/src/main/java/io/codat/lending/Refresh.java + - lib/src/main/java/io/codat/lending/PullOperations.java + - lib/src/main/java/io/codat/lending/ManageData.java + - lib/src/main/java/io/codat/lending/Liabilities.java + - lib/src/main/java/io/codat/lending/DataIntegrity.java + - lib/src/main/java/io/codat/lending/ExcelReports.java + - lib/src/main/java/io/codat/lending/models/operations/CreateCompanyRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListFilesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequestBuilder.java + - lib/src/main/java/io/codat/lending/models/operations/SDKMethodInterfaces.java + - lib/src/main/java/io/codat/lending/CodatLending.java + - .gitattributes + - gradle/wrapper/gradle-wrapper.jar + - gradle/wrapper/gradle-wrapper.properties + - gradlew + - gradlew.bat + - lib/build.gradle + - lib/src/main/java/io/codat/lending/utils/FormMetadata.java + - lib/src/main/java/io/codat/lending/utils/HTTPClient.java + - lib/src/main/java/io/codat/lending/utils/HTTPRequest.java + - lib/src/main/java/io/codat/lending/utils/HeaderMetadata.java + - lib/src/main/java/io/codat/lending/utils/JSON.java + - lib/src/main/java/io/codat/lending/utils/LazySingletonValue.java + - lib/src/main/java/io/codat/lending/utils/Metadata.java + - lib/src/main/java/io/codat/lending/utils/MultipartFormMetadata.java + - lib/src/main/java/io/codat/lending/utils/OneOfDeserializer.java + - lib/src/main/java/io/codat/lending/utils/PathParamsMetadata.java + - lib/src/main/java/io/codat/lending/utils/QueryParameters.java + - lib/src/main/java/io/codat/lending/utils/QueryParamsMetadata.java + - lib/src/main/java/io/codat/lending/utils/RequestBody.java + - lib/src/main/java/io/codat/lending/utils/RequestMetadata.java + - lib/src/main/java/io/codat/lending/utils/Security.java + - lib/src/main/java/io/codat/lending/utils/SecurityMetadata.java + - lib/src/main/java/io/codat/lending/utils/SerializedBody.java + - lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPClient.java + - lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPSecurityClient.java + - lib/src/main/java/io/codat/lending/utils/SpeakeasyMetadata.java + - lib/src/main/java/io/codat/lending/utils/Types.java + - lib/src/main/java/io/codat/lending/utils/Utils.java + - lib/src/main/java/io/codat/lending/models/errors/SDKError.java + - settings.gradle + - lib/src/main/java/io/codat/lending/models/operations/CreateCompanyResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCompanyResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCompaniesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequest.java + - lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBody.java + - lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateConnectionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetConnectionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListConnectionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionUpdateConnection.java + - lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequest.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableResponse.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequest.java + - lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadFilesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListFilesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListFilesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/UploadFilesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateAccountResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreatePaymentResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateSupplierResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequest.java + - lib/src/main/java/io/codat/lending/models/operations/CreateTransferResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataStatusResponse.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequest.java + - lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetPullOperationResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/SourceType.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryResponse.java + - lib/src/main/java/io/codat/lending/models/operations/QueryParamSourceType.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryQueryParamSourceType.java + - lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsQueryParamSourceType.java + - lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequest.java + - lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesResponse.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportResponse.java + - lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequest.java + - lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusResponse.java + - lib/src/main/java/io/codat/lending/models/shared/ErrorMessage.java + - lib/src/main/java/io/codat/lending/models/shared/GroupReference.java + - lib/src/main/java/io/codat/lending/models/shared/Company.java + - lib/src/main/java/io/codat/lending/models/shared/SourceType.java + - lib/src/main/java/io/codat/lending/models/shared/Connection.java + - lib/src/main/java/io/codat/lending/models/shared/DataConnectionStatus.java + - lib/src/main/java/io/codat/lending/models/shared/DataConnectionError.java + - lib/src/main/java/io/codat/lending/models/shared/CompanyRequestBody.java + - lib/src/main/java/io/codat/lending/models/shared/Items.java + - lib/src/main/java/io/codat/lending/models/shared/Companies.java + - lib/src/main/java/io/codat/lending/models/shared/Links.java + - lib/src/main/java/io/codat/lending/models/shared/HalRef.java + - lib/src/main/java/io/codat/lending/models/shared/Connections.java + - lib/src/main/java/io/codat/lending/models/shared/Status.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/Metadata.java + - lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLine.java + - lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRefDataType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/BankAccountRef.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostDataType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostContactReference.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCost.java + - lib/src/main/java/io/codat/lending/models/shared/SupplementalData.java + - lib/src/main/java/io/codat/lending/models/shared/Allocation.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingPaymentAllocation.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentAllocationPayment.java + - lib/src/main/java/io/codat/lending/models/shared/AccountRef.java + - lib/src/main/java/io/codat/lending/models/shared/DirectCostLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/TrackingCategoryRef.java + - lib/src/main/java/io/codat/lending/models/shared/Tracking.java + - lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRefDataType.java + - lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/RecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/TaxRateRef.java + - lib/src/main/java/io/codat/lending/models/shared/PropertieItemRef.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAttachment.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCosts.java + - lib/src/main/java/io/codat/lending/models/shared/Attachments.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingTransfer.java + - lib/src/main/java/io/codat/lending/models/shared/TransferAccount.java + - lib/src/main/java/io/codat/lending/models/shared/ContactRefDataType.java + - lib/src/main/java/io/codat/lending/models/shared/ContactRef.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingTransfers.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntry.java + - lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRefDataType.java + - lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/JournalRef.java + - lib/src/main/java/io/codat/lending/models/shared/JournalLineTracking.java + - lib/src/main/java/io/codat/lending/models/shared/JournalLine.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntries.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingJournal.java + - lib/src/main/java/io/codat/lending/models/shared/JournalStatus.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingJournals.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/BankTransactionType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccount.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccountType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccounts.java + - lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalances.java + - lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalance.java + - lib/src/main/java/io/codat/lending/models/shared/AccountBalanceAmounts.java + - lib/src/main/java/io/codat/lending/models/shared/BankingAccount.java + - lib/src/main/java/io/codat/lending/models/shared/AccountInstitution.java + - lib/src/main/java/io/codat/lending/models/shared/AccountIdentifiers.java + - lib/src/main/java/io/codat/lending/models/shared/AccountIdentifierType.java + - lib/src/main/java/io/codat/lending/models/shared/BankingAccounts.java + - lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategory.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryStatus.java + - lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategories.java + - lib/src/main/java/io/codat/lending/models/shared/BankingTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryRef.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionCode.java + - lib/src/main/java/io/codat/lending/models/shared/BankingTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowItem.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionCategory.java + - lib/src/main/java/io/codat/lending/models/shared/SourceRef.java + - lib/src/main/java/io/codat/lending/models/shared/ReportInfo.java + - lib/src/main/java/io/codat/lending/models/shared/DataSource.java + - lib/src/main/java/io/codat/lending/models/shared/Accounts.java + - lib/src/main/java/io/codat/lending/models/shared/PurchaseOrderReference.java + - lib/src/main/java/io/codat/lending/models/shared/WithholdingTax.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBill.java + - lib/src/main/java/io/codat/lending/models/shared/SupplierRef.java + - lib/src/main/java/io/codat/lending/models/shared/BillStatus.java + - lib/src/main/java/io/codat/lending/models/shared/BillLineItemDataType.java + - lib/src/main/java/io/codat/lending/models/shared/RecordLineReference.java + - lib/src/main/java/io/codat/lending/models/shared/BillLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/AccountsPayableTracking.java + - lib/src/main/java/io/codat/lending/models/shared/ProjectRef.java + - lib/src/main/java/io/codat/lending/models/shared/BilledToType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCustomerRef.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBills.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingSupplier.java + - lib/src/main/java/io/codat/lending/models/shared/SupplierStatus.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAddress.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAddressType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingSuppliers.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNote.java + - lib/src/main/java/io/codat/lending/models/shared/WithholdingTaxItems.java + - lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteStatus.java + - lib/src/main/java/io/codat/lending/models/shared/ItemReference.java + - lib/src/main/java/io/codat/lending/models/shared/TaxRateReference.java + - lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNotes.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayment.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentMethodRef.java + - lib/src/main/java/io/codat/lending/models/shared/BillPaymentLine.java + - lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLink.java + - lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLinkType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayments.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceCustomer.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceAddress.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceAddressType.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceCustomers.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceDispute.java + - lib/src/main/java/io/codat/lending/models/shared/DisputeStatus.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionSourceRef.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionSourceType.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceDisputes.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceLocation.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceLocations.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceOrder.java + - lib/src/main/java/io/codat/lending/models/shared/ServiceCharge.java + - lib/src/main/java/io/codat/lending/models/shared/ServiceChargeType.java + - lib/src/main/java/io/codat/lending/models/shared/TaxComponentAllocation.java + - lib/src/main/java/io/codat/lending/models/shared/TaxComponentRef.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentRef.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentType.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentStatus.java + - lib/src/main/java/io/codat/lending/models/shared/OrderLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/ProductVariantRef.java + - lib/src/main/java/io/codat/lending/models/shared/ProductRef.java + - lib/src/main/java/io/codat/lending/models/shared/OrderDiscountAllocation.java + - lib/src/main/java/io/codat/lending/models/shared/LocationRef.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceCustomerRef.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceOrders.java + - lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethodStatus.java + - lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethod.java + - lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethods.java + - lib/src/main/java/io/codat/lending/models/shared/CommercePayment.java + - lib/src/main/java/io/codat/lending/models/shared/CommercePayments.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategory.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceRecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategories.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceProduct.java + - lib/src/main/java/io/codat/lending/models/shared/ProductVariant.java + - lib/src/main/java/io/codat/lending/models/shared/ProductVariantStatus.java + - lib/src/main/java/io/codat/lending/models/shared/ProductPrice.java + - lib/src/main/java/io/codat/lending/models/shared/ProductInventory.java + - lib/src/main/java/io/codat/lending/models/shared/ProductInventoryLocation.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceProducts.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/TransactionType.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReport.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReportComponent.java + - lib/src/main/java/io/codat/lending/models/shared/ReportComponentMeasure.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReportMeasure.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReportError.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimensionItems.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimension.java + - lib/src/main/java/io/codat/lending/models/shared/PeriodUnit.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCompanyInfo.java + - lib/src/main/java/io/codat/lending/models/shared/Type.java + - lib/src/main/java/io/codat/lending/models/shared/WebLink.java + - lib/src/main/java/io/codat/lending/models/shared/PhoneNumber.java + - lib/src/main/java/io/codat/lending/models/shared/PhoneNumberType.java + - lib/src/main/java/io/codat/lending/models/shared/CommerceCompanyInfo.java + - lib/src/main/java/io/codat/lending/models/shared/AccountBalance.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCustomer.java + - lib/src/main/java/io/codat/lending/models/shared/CustomerStatus.java + - lib/src/main/java/io/codat/lending/models/shared/Contact.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCustomers.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncome.java + - lib/src/main/java/io/codat/lending/models/shared/DirectIncomeLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncomes.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingInvoiceDataType.java + - lib/src/main/java/io/codat/lending/models/shared/SalesOrderReference.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingInvoice.java + - lib/src/main/java/io/codat/lending/models/shared/InvoiceStatus.java + - lib/src/main/java/io/codat/lending/models/shared/InvoiceLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/RecordReference.java + - lib/src/main/java/io/codat/lending/models/shared/AccountsReceivableTracking.java + - lib/src/main/java/io/codat/lending/models/shared/BilledToType1.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingInvoices.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoicesReport.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoiceReportItem.java + - lib/src/main/java/io/codat/lending/models/shared/Payment.java + - lib/src/main/java/io/codat/lending/models/shared/BankingTransactionRef.java + - lib/src/main/java/io/codat/lending/models/shared/LendingCustomerRef.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNote.java + - lib/src/main/java/io/codat/lending/models/shared/CreditNoteStatus.java + - lib/src/main/java/io/codat/lending/models/shared/CreditNoteLineItem.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNotes.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingPayment.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentLine.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentLineLink.java + - lib/src/main/java/io/codat/lending/models/shared/PaymentLinkType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingPayments.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAgedCreditorReport.java + - lib/src/main/java/io/codat/lending/models/shared/AgedCreditor.java + - lib/src/main/java/io/codat/lending/models/shared/AgedCurrencyOutstanding.java + - lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmount.java + - lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmountDetail.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAgedDebtorReport.java + - lib/src/main/java/io/codat/lending/models/shared/AgedDebtor.java + - lib/src/main/java/io/codat/lending/models/shared/File.java + - lib/src/main/java/io/codat/lending/models/shared/FileUpload.java + - lib/src/main/java/io/codat/lending/models/shared/CodatFile.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponse.java + - lib/src/main/java/io/codat/lending/models/shared/Validation.java + - lib/src/main/java/io/codat/lending/models/shared/ValidationItem.java + - lib/src/main/java/io/codat/lending/models/shared/PushOperationStatus.java + - lib/src/main/java/io/codat/lending/models/shared/DataType.java + - lib/src/main/java/io/codat/lending/models/shared/PushOperationChange.java + - lib/src/main/java/io/codat/lending/models/shared/PushChangeType.java + - lib/src/main/java/io/codat/lending/models/shared/PushOperationRef.java + - lib/src/main/java/io/codat/lending/models/shared/PushOption.java + - lib/src/main/java/io/codat/lending/models/shared/PushValidationInfo.java + - lib/src/main/java/io/codat/lending/models/shared/PushFieldValidation.java + - lib/src/main/java/io/codat/lending/models/shared/PushOptionType.java + - lib/src/main/java/io/codat/lending/models/shared/PushOptionProperty.java + - lib/src/main/java/io/codat/lending/models/shared/PushOptionChoice.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactionsResponse.java + - lib/src/main/java/io/codat/lending/models/shared/CreateBankAccountTransaction.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseAccountingAccount.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponse.java + - lib/src/main/java/io/codat/lending/models/shared/AccountType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountStatus.java + - lib/src/main/java/io/codat/lending/models/shared/ValidDataTypeLinks.java + - lib/src/main/java/io/codat/lending/models/shared/AccountPrototype.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseDataType.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseContactReference.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponse.java + - lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototypeDataType.java + - lib/src/main/java/io/codat/lending/models/shared/ContactReference.java + - lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototype.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponseAccountingPayment.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponse.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponseAccountingSupplier.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponse.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponseAccountingTransfer.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponse.java + - lib/src/main/java/io/codat/lending/models/shared/PushOperation.java + - lib/src/main/java/io/codat/lending/models/shared/PushOperations.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAccountValidDataTypeLinks.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAccount.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingAccounts.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingBalanceSheet.java + - lib/src/main/java/io/codat/lending/models/shared/BalanceSheet.java + - lib/src/main/java/io/codat/lending/models/shared/ReportLineInput.java + - lib/src/main/java/io/codat/lending/models/shared/ReportLine.java + - lib/src/main/java/io/codat/lending/models/shared/ReportItem.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedFinancialReport.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedReportAccountCategory.java + - lib/src/main/java/io/codat/lending/models/shared/AccountCategoryLevel.java + - lib/src/main/java/io/codat/lending/models/shared/EnhancedReportInfo.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingCashFlowStatement.java + - lib/src/main/java/io/codat/lending/models/shared/CashFlowStatement.java + - lib/src/main/java/io/codat/lending/models/shared/ReportInput.java + - lib/src/main/java/io/codat/lending/models/shared/ReportBasis.java + - lib/src/main/java/io/codat/lending/models/shared/AccountingProfitAndLossReport.java + - lib/src/main/java/io/codat/lending/models/shared/ProfitAndLossReport.java + - lib/src/main/java/io/codat/lending/models/shared/DataTypes.java + - lib/src/main/java/io/codat/lending/models/shared/DataStatus.java + - lib/src/main/java/io/codat/lending/models/shared/PullOperationStatus.java + - lib/src/main/java/io/codat/lending/models/shared/PullOperation.java + - lib/src/main/java/io/codat/lending/models/shared/SchemaDataType.java + - lib/src/main/java/io/codat/lending/models/shared/PullOperations.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummary.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportItem.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRef.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRefType.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummaryIntegrationType.java + - lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportInfo.java + - lib/src/main/java/io/codat/lending/models/shared/LoanTransactions.java + - lib/src/main/java/io/codat/lending/models/shared/LoanTransactionType.java + - lib/src/main/java/io/codat/lending/models/shared/ReportItems.java + - lib/src/main/java/io/codat/lending/models/shared/LoanRef.java + - lib/src/main/java/io/codat/lending/models/shared/ItemRef.java + - lib/src/main/java/io/codat/lending/models/shared/LoanTransactionsReportInfo.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetails.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetail.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityMatch.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDataType.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatuses.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatus.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatusInfo.java + - lib/src/main/java/io/codat/lending/models/shared/IntegrityStatus.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDates.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityConnectionId.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityAmounts.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummaries.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummary.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByCount.java + - lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByAmount.java + - lib/src/main/java/io/codat/lending/models/shared/ExcelReportTypes.java + - lib/src/main/java/io/codat/lending/models/shared/ExcelStatus.java + - lib/src/main/java/io/codat/lending/models/shared/Security.java + - lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhook.java + - lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhookData.java + - lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhook.java + - lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhookData.java + - lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhook.java + - lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhookData.java + - lib/src/main/java/io/codat/lending/models/webhooks/AccountCategoriesUpdatedResponse.java + - lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitReachedResponse.java + - lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitResetResponse.java + - docs/models/operations/CreateCompanyResponse.md + - docs/models/operations/DeleteCompanyRequest.md + - docs/models/operations/DeleteCompanyResponse.md + - docs/models/operations/GetCompanyRequest.md + - docs/models/operations/GetCompanyResponse.md + - docs/models/operations/ListCompaniesRequest.md + - docs/models/operations/ListCompaniesResponse.md + - docs/models/operations/UpdateCompanyRequest.md + - docs/models/operations/UpdateCompanyResponse.md + - docs/models/operations/CreateConnectionRequestBody.md + - docs/models/operations/CreateConnectionRequest.md + - docs/models/operations/CreateConnectionResponse.md + - docs/models/operations/DeleteConnectionRequest.md + - docs/models/operations/DeleteConnectionResponse.md + - docs/models/operations/GetConnectionRequest.md + - docs/models/operations/GetConnectionResponse.md + - docs/models/operations/ListConnectionsRequest.md + - docs/models/operations/ListConnectionsResponse.md + - docs/models/operations/UnlinkConnectionUpdateConnection.md + - docs/models/operations/UnlinkConnectionRequest.md + - docs/models/operations/UnlinkConnectionResponse.md + - docs/models/operations/GetAccountingAccountTransactionRequest.md + - docs/models/operations/GetAccountingAccountTransactionResponse.md + - docs/models/operations/ListAccountingAccountTransactionsRequest.md + - docs/models/operations/ListAccountingAccountTransactionsResponse.md + - docs/models/operations/DownloadAccountingDirectCostAttachmentRequest.md + - docs/models/operations/DownloadAccountingDirectCostAttachmentResponse.md + - docs/models/operations/GetAccountingDirectCostRequest.md + - docs/models/operations/GetAccountingDirectCostResponse.md + - docs/models/operations/GetAccountingDirectCostAttachmentRequest.md + - docs/models/operations/GetAccountingDirectCostAttachmentResponse.md + - docs/models/operations/ListAccountingDirectCostsRequest.md + - docs/models/operations/ListAccountingDirectCostsResponse.md + - docs/models/operations/ListAccountingDirectCostAttachmentsRequest.md + - docs/models/operations/ListAccountingDirectCostAttachmentsResponse.md + - docs/models/operations/GetAccountingTransferRequest.md + - docs/models/operations/GetAccountingTransferResponse.md + - docs/models/operations/ListAccountingTransfersRequest.md + - docs/models/operations/ListAccountingTransfersResponse.md + - docs/models/operations/GetAccountingJournalEntryRequest.md + - docs/models/operations/GetAccountingJournalEntryResponse.md + - docs/models/operations/ListAccountingJournalEntriesRequest.md + - docs/models/operations/ListAccountingJournalEntriesResponse.md + - docs/models/operations/GetAccountingJournalRequest.md + - docs/models/operations/GetAccountingJournalResponse.md + - docs/models/operations/ListAccountingJournalsRequest.md + - docs/models/operations/ListAccountingJournalsResponse.md + - docs/models/operations/ListAccountingBankAccountTransactionsRequest.md + - docs/models/operations/ListAccountingBankAccountTransactionsResponse.md + - docs/models/operations/GetAccountingBankAccountRequest.md + - docs/models/operations/GetAccountingBankAccountResponse.md + - docs/models/operations/ListAccountingBankAccountsRequest.md + - docs/models/operations/ListAccountingBankAccountsResponse.md + - docs/models/operations/ListBankingAccountBalancesRequest.md + - docs/models/operations/ListBankingAccountBalancesResponse.md + - docs/models/operations/GetBankingAccountRequest.md + - docs/models/operations/GetBankingAccountResponse.md + - docs/models/operations/ListBankingAccountsRequest.md + - docs/models/operations/ListBankingAccountsResponse.md + - docs/models/operations/GetBankingTransactionCategoryRequest.md + - docs/models/operations/GetBankingTransactionCategoryResponse.md + - docs/models/operations/ListBankingTransactionCategoriesRequest.md + - docs/models/operations/ListBankingTransactionCategoriesResponse.md + - docs/models/operations/GetBankingTransactionRequest.md + - docs/models/operations/GetBankingTransactionResponse.md + - docs/models/operations/ListBankingTransactionsRequest.md + - docs/models/operations/ListBankingTransactionsResponse.md + - docs/models/operations/GetCategorizedBankStatementRequest.md + - docs/models/operations/GetCategorizedBankStatementResponse.md + - docs/models/operations/DownloadAccountingBillAttachmentRequest.md + - docs/models/operations/DownloadAccountingBillAttachmentResponse.md + - docs/models/operations/GetAccountingBillRequest.md + - docs/models/operations/GetAccountingBillResponse.md + - docs/models/operations/GetAccountingBillAttachmentRequest.md + - docs/models/operations/GetAccountingBillAttachmentResponse.md + - docs/models/operations/ListAccountingBillsRequest.md + - docs/models/operations/ListAccountingBillsResponse.md + - docs/models/operations/ListAccountingBillAttachmentsRequest.md + - docs/models/operations/ListAccountingBillAttachmentsResponse.md + - docs/models/operations/DownloadAccountingSupplierAttachmentRequest.md + - docs/models/operations/DownloadAccountingSupplierAttachmentResponse.md + - docs/models/operations/GetAccountingSupplierRequest.md + - docs/models/operations/GetAccountingSupplierResponse.md + - docs/models/operations/GetAccountingSupplierAttachmentRequest.md + - docs/models/operations/GetAccountingSupplierAttachmentResponse.md + - docs/models/operations/ListAccountingSuppliersRequest.md + - docs/models/operations/ListAccountingSuppliersResponse.md + - docs/models/operations/ListAccountingSupplierAttachmentsRequest.md + - docs/models/operations/ListAccountingSupplierAttachmentsResponse.md + - docs/models/operations/GetAccountingBillCreditNoteRequest.md + - docs/models/operations/GetAccountingBillCreditNoteResponse.md + - docs/models/operations/ListAccountingBillCreditNotesRequest.md + - docs/models/operations/ListAccountingBillCreditNotesResponse.md + - docs/models/operations/GetAccountingBillPaymentRequest.md + - docs/models/operations/GetAccountingBillPaymentResponse.md + - docs/models/operations/ListAccountingBillPaymentsRequest.md + - docs/models/operations/ListAccountingBillPaymentsResponse.md + - docs/models/operations/GetCommerceCustomerRequest.md + - docs/models/operations/GetCommerceCustomerResponse.md + - docs/models/operations/ListCommerceCustomersRequest.md + - docs/models/operations/ListCommerceCustomersResponse.md + - docs/models/operations/GetCommerceDisputeRequest.md + - docs/models/operations/GetCommerceDisputeResponse.md + - docs/models/operations/ListCommerceDisputesRequest.md + - docs/models/operations/ListCommerceDisputesResponse.md + - docs/models/operations/GetCommerceLocationRequest.md + - docs/models/operations/GetCommerceLocationResponse.md + - docs/models/operations/ListCommerceLocationsRequest.md + - docs/models/operations/ListCommerceLocationsResponse.md + - docs/models/operations/GetCommerceOrderRequest.md + - docs/models/operations/GetCommerceOrderResponse.md + - docs/models/operations/ListCommerceOrdersRequest.md + - docs/models/operations/ListCommerceOrdersResponse.md + - docs/models/operations/GetCommercePaymentMethodRequest.md + - docs/models/operations/GetCommercePaymentMethodResponse.md + - docs/models/operations/ListCommercePaymentMethodsRequest.md + - docs/models/operations/ListCommercePaymentMethodsResponse.md + - docs/models/operations/GetCommercePaymentRequest.md + - docs/models/operations/GetCommercePaymentResponse.md + - docs/models/operations/ListCommercePaymentsRequest.md + - docs/models/operations/ListCommercePaymentsResponse.md + - docs/models/operations/GetCommerceProductCategoryRequest.md + - docs/models/operations/GetCommerceProductCategoryResponse.md + - docs/models/operations/ListCommerceProductCategoriesRequest.md + - docs/models/operations/ListCommerceProductCategoriesResponse.md + - docs/models/operations/GetCommerceProductRequest.md + - docs/models/operations/GetCommerceProductResponse.md + - docs/models/operations/ListCommerceProductsRequest.md + - docs/models/operations/ListCommerceProductsResponse.md + - docs/models/operations/GetCommerceTransactionRequest.md + - docs/models/operations/GetCommerceTransactionResponse.md + - docs/models/operations/ListCommerceTransactionsRequest.md + - docs/models/operations/ListCommerceTransactionsResponse.md + - docs/models/operations/GetCommerceCustomerRetentionMetricsRequest.md + - docs/models/operations/GetCommerceCustomerRetentionMetricsResponse.md + - docs/models/operations/GetCommerceLifetimeValueMetricsRequest.md + - docs/models/operations/GetCommerceLifetimeValueMetricsResponse.md + - docs/models/operations/GetCommerceRevenueMetricsRequest.md + - docs/models/operations/GetCommerceRevenueMetricsResponse.md + - docs/models/operations/GetCommerceOrdersReportRequest.md + - docs/models/operations/GetCommerceOrdersReportResponse.md + - docs/models/operations/GetCommerceRefundsReportRequest.md + - docs/models/operations/GetCommerceRefundsReportResponse.md + - docs/models/operations/GetAccountingProfileRequest.md + - docs/models/operations/GetAccountingProfileResponse.md + - docs/models/operations/GetCommerceProfileRequest.md + - docs/models/operations/GetCommerceProfileResponse.md + - docs/models/operations/DownloadAccountingCustomerAttachmentRequest.md + - docs/models/operations/DownloadAccountingCustomerAttachmentResponse.md + - docs/models/operations/GetAccountingCustomerRequest.md + - docs/models/operations/GetAccountingCustomerResponse.md + - docs/models/operations/GetAccountingCustomerAttachmentRequest.md + - docs/models/operations/GetAccountingCustomerAttachmentResponse.md + - docs/models/operations/ListAccountingCustomersRequest.md + - docs/models/operations/ListAccountingCustomersResponse.md + - docs/models/operations/ListAccountingCustomerAttachmentsRequest.md + - docs/models/operations/ListAccountingCustomerAttachmentsResponse.md + - docs/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.md + - docs/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.md + - docs/models/operations/GetAccountingDirectIncomeRequest.md + - docs/models/operations/GetAccountingDirectIncomeResponse.md + - docs/models/operations/GetAccountingDirectIncomeAttachmentRequest.md + - docs/models/operations/GetAccountingDirectIncomeAttachmentResponse.md + - docs/models/operations/ListAccountingDirectIncomesRequest.md + - docs/models/operations/ListAccountingDirectIncomesResponse.md + - docs/models/operations/ListAccountingDirectIncomeAttachmentsRequest.md + - docs/models/operations/ListAccountingDirectIncomeAttachmentsResponse.md + - docs/models/operations/DownloadAccountingInvoiceAttachmentRequest.md + - docs/models/operations/DownloadAccountingInvoiceAttachmentResponse.md + - docs/models/operations/DownloadAccountingInvoicePdfRequest.md + - docs/models/operations/DownloadAccountingInvoicePdfResponse.md + - docs/models/operations/GetAccountingInvoiceRequest.md + - docs/models/operations/GetAccountingInvoiceResponse.md + - docs/models/operations/GetAccountingInvoiceAttachmentRequest.md + - docs/models/operations/GetAccountingInvoiceAttachmentResponse.md + - docs/models/operations/ListAccountingInvoicesRequest.md + - docs/models/operations/ListAccountingInvoicesResponse.md + - docs/models/operations/ListAccountingInvoiceAttachmentsRequest.md + - docs/models/operations/ListAccountingInvoiceAttachmentsResponse.md + - docs/models/operations/ListReconciledInvoicesRequest.md + - docs/models/operations/ListReconciledInvoicesResponse.md + - docs/models/operations/GetAccountingCreditNoteRequest.md + - docs/models/operations/GetAccountingCreditNoteResponse.md + - docs/models/operations/ListAccountingCreditNotesRequest.md + - docs/models/operations/ListAccountingCreditNotesResponse.md + - docs/models/operations/GetAccountingPaymentRequest.md + - docs/models/operations/GetAccountingPaymentResponse.md + - docs/models/operations/ListAccountingPaymentsRequest.md + - docs/models/operations/ListAccountingPaymentsResponse.md + - docs/models/operations/GetAccountingAgedCreditorsReportRequest.md + - docs/models/operations/GetAccountingAgedCreditorsReportResponse.md + - docs/models/operations/GetAccountingAgedDebtorsReportRequest.md + - docs/models/operations/GetAccountingAgedDebtorsReportResponse.md + - docs/models/operations/IsAgedCreditorsReportAvailableRequest.md + - docs/models/operations/IsAgedCreditorsReportAvailableResponse.md + - docs/models/operations/IsAgedDebtorsReportAvailableRequest.md + - docs/models/operations/IsAgedDebtorsReportAvailableResponse.md + - docs/models/operations/DownloadFilesRequest.md + - docs/models/operations/DownloadFilesResponse.md + - docs/models/operations/ListFilesRequest.md + - docs/models/operations/ListFilesResponse.md + - docs/models/operations/UploadFilesRequest.md + - docs/models/operations/UploadFilesResponse.md + - docs/models/operations/CreateBankAccountRequest.md + - docs/models/operations/CreateBankAccountResponse.md + - docs/models/operations/GetCreateUpdateBankAccountsModelRequest.md + - docs/models/operations/GetCreateUpdateBankAccountsModelResponse.md + - docs/models/operations/CreateBankTransactionsRequest.md + - docs/models/operations/CreateBankTransactionsResponse.md + - docs/models/operations/GetCreateBankTransactionsModelRequest.md + - docs/models/operations/GetCreateBankTransactionsModelResponse.md + - docs/models/operations/CreateAccountRequest.md + - docs/models/operations/CreateAccountResponse.md + - docs/models/operations/GetCreateChartOfAccountsModelRequest.md + - docs/models/operations/GetCreateChartOfAccountsModelResponse.md + - docs/models/operations/CreateDirectCostRequest.md + - docs/models/operations/CreateDirectCostResponse.md + - docs/models/operations/GetCreateDirectCostsModelRequest.md + - docs/models/operations/GetCreateDirectCostsModelResponse.md + - docs/models/operations/CreatePaymentRequest.md + - docs/models/operations/CreatePaymentResponse.md + - docs/models/operations/GetCreatePaymentModelRequest.md + - docs/models/operations/GetCreatePaymentModelResponse.md + - docs/models/operations/CreateSupplierRequest.md + - docs/models/operations/CreateSupplierResponse.md + - docs/models/operations/GetCreateUpdateSuppliersModelRequest.md + - docs/models/operations/GetCreateUpdateSuppliersModelResponse.md + - docs/models/operations/CreateTransferRequest.md + - docs/models/operations/CreateTransferResponse.md + - docs/models/operations/GetCreateTransfersModelRequest.md + - docs/models/operations/GetCreateTransfersModelResponse.md + - docs/models/operations/GetCreateOperationRequest.md + - docs/models/operations/GetCreateOperationResponse.md + - docs/models/operations/ListCreateOperationsRequest.md + - docs/models/operations/ListCreateOperationsResponse.md + - docs/models/operations/GetAccountingAccountRequest.md + - docs/models/operations/GetAccountingAccountResponse.md + - docs/models/operations/ListAccountingAccountsRequest.md + - docs/models/operations/ListAccountingAccountsResponse.md + - docs/models/operations/GetAccountingBalanceSheetRequest.md + - docs/models/operations/GetAccountingBalanceSheetResponse.md + - docs/models/operations/GetCategorizedBalanceSheetStatementRequest.md + - docs/models/operations/GetCategorizedBalanceSheetStatementResponse.md + - docs/models/operations/GetAccountingCashFlowStatementRequest.md + - docs/models/operations/GetAccountingCashFlowStatementResponse.md + - docs/models/operations/GetAccountingProfitAndLossRequest.md + - docs/models/operations/GetAccountingProfitAndLossResponse.md + - docs/models/operations/GetCategorizedProfitAndLossStatementRequest.md + - docs/models/operations/GetCategorizedProfitAndLossStatementResponse.md + - docs/models/operations/GetDataStatusRequest.md + - docs/models/operations/GetDataStatusResponse.md + - docs/models/operations/RefreshAllDataTypesRequest.md + - docs/models/operations/RefreshAllDataTypesResponse.md + - docs/models/operations/RefreshDataTypeRequest.md + - docs/models/operations/RefreshDataTypeResponse.md + - docs/models/operations/GetPullOperationRequest.md + - docs/models/operations/GetPullOperationResponse.md + - docs/models/operations/ListPullOperationsRequest.md + - docs/models/operations/ListPullOperationsResponse.md + - docs/models/operations/SourceType.md + - docs/models/operations/GenerateLoanSummaryRequest.md + - docs/models/operations/GenerateLoanSummaryResponse.md + - docs/models/operations/QueryParamSourceType.md + - docs/models/operations/GenerateLoanTransactionsRequest.md + - docs/models/operations/GenerateLoanTransactionsResponse.md + - docs/models/operations/GetLoanSummaryQueryParamSourceType.md + - docs/models/operations/GetLoanSummaryRequest.md + - docs/models/operations/GetLoanSummaryResponse.md + - docs/models/operations/ListLoanTransactionsQueryParamSourceType.md + - docs/models/operations/ListLoanTransactionsRequest.md + - docs/models/operations/ListLoanTransactionsResponse.md + - docs/models/operations/ListDataIntegrityDetailsRequest.md + - docs/models/operations/ListDataIntegrityDetailsResponse.md + - docs/models/operations/GetDataIntegrityStatusRequest.md + - docs/models/operations/GetDataIntegrityStatusResponse.md + - docs/models/operations/GetDataIntegritySummariesRequest.md + - docs/models/operations/GetDataIntegritySummariesResponse.md + - docs/models/operations/DownloadExcelReportRequest.md + - docs/models/operations/DownloadExcelReportResponse.md + - docs/models/operations/GenerateExcelReportRequest.md + - docs/models/operations/GenerateExcelReportResponse.md + - docs/models/operations/GetExcelReportGenerationStatusRequest.md + - docs/models/operations/GetExcelReportGenerationStatusResponse.md + - docs/models/shared/ErrorMessage.md + - docs/models/shared/GroupReference.md + - docs/models/shared/Company.md + - docs/models/shared/SourceType.md + - docs/models/shared/Connection.md + - docs/models/shared/DataConnectionStatus.md + - docs/models/shared/DataConnectionError.md + - docs/models/shared/CompanyRequestBody.md + - docs/models/shared/Items.md + - docs/models/shared/Companies.md + - docs/models/shared/Links.md + - docs/models/shared/HalRef.md + - docs/models/shared/Connections.md + - docs/models/shared/Status.md + - docs/models/shared/AccountingAccountTransaction.md + - docs/models/shared/Metadata.md + - docs/models/shared/AccountTransactionLine.md + - docs/models/shared/AccountTransactionLineRecordRefDataType.md + - docs/models/shared/AccountTransactionLineRecordRef.md + - docs/models/shared/BankAccountRef.md + - docs/models/shared/AccountingAccountTransactions.md + - docs/models/shared/AccountingDirectCostDataType.md + - docs/models/shared/AccountingDirectCostContactReference.md + - docs/models/shared/AccountingDirectCost.md + - docs/models/shared/SupplementalData.md + - docs/models/shared/Allocation.md + - docs/models/shared/AccountingPaymentAllocation.md + - docs/models/shared/PaymentAllocationPayment.md + - docs/models/shared/AccountRef.md + - docs/models/shared/DirectCostLineItem.md + - docs/models/shared/TrackingCategoryRef.md + - docs/models/shared/Tracking.md + - docs/models/shared/TrackingRecordRefDataType.md + - docs/models/shared/TrackingRecordRef.md + - docs/models/shared/RecordRef.md + - docs/models/shared/TaxRateRef.md + - docs/models/shared/PropertieItemRef.md + - docs/models/shared/AccountingAttachment.md + - docs/models/shared/AccountingDirectCosts.md + - docs/models/shared/Attachments.md + - docs/models/shared/AccountingTransfer.md + - docs/models/shared/TransferAccount.md + - docs/models/shared/ContactRefDataType.md + - docs/models/shared/ContactRef.md + - docs/models/shared/AccountingTransfers.md + - docs/models/shared/AccountingJournalEntry.md + - docs/models/shared/JournalEntryRecordRefDataType.md + - docs/models/shared/JournalEntryRecordRef.md + - docs/models/shared/JournalRef.md + - docs/models/shared/JournalLineTracking.md + - docs/models/shared/JournalLine.md + - docs/models/shared/AccountingJournalEntries.md + - docs/models/shared/AccountingJournal.md + - docs/models/shared/JournalStatus.md + - docs/models/shared/AccountingJournals.md + - docs/models/shared/AccountingBankTransactions.md + - docs/models/shared/AccountingBankTransaction.md + - docs/models/shared/BankTransactionType.md + - docs/models/shared/AccountingBankAccount.md + - docs/models/shared/AccountingBankAccountType.md + - docs/models/shared/AccountingBankAccounts.md + - docs/models/shared/BankingAccountBalances.md + - docs/models/shared/BankingAccountBalance.md + - docs/models/shared/AccountBalanceAmounts.md + - docs/models/shared/BankingAccount.md + - docs/models/shared/AccountInstitution.md + - docs/models/shared/AccountIdentifiers.md + - docs/models/shared/AccountIdentifierType.md + - docs/models/shared/BankingAccounts.md + - docs/models/shared/BankingTransactionCategory.md + - docs/models/shared/TransactionCategoryStatus.md + - docs/models/shared/BankingTransactionCategories.md + - docs/models/shared/BankingTransaction.md + - docs/models/shared/TransactionCategoryRef.md + - docs/models/shared/TransactionCode.md + - docs/models/shared/BankingTransactions.md + - docs/models/shared/EnhancedCashFlowTransactions.md + - docs/models/shared/EnhancedCashFlowItem.md + - docs/models/shared/EnhancedCashFlowTransaction.md + - docs/models/shared/TransactionCategory.md + - docs/models/shared/SourceRef.md + - docs/models/shared/ReportInfo.md + - docs/models/shared/DataSource.md + - docs/models/shared/Accounts.md + - docs/models/shared/PurchaseOrderReference.md + - docs/models/shared/WithholdingTax.md + - docs/models/shared/AccountingBill.md + - docs/models/shared/SupplierRef.md + - docs/models/shared/BillStatus.md + - docs/models/shared/BillLineItemDataType.md + - docs/models/shared/RecordLineReference.md + - docs/models/shared/BillLineItem.md + - docs/models/shared/AccountsPayableTracking.md + - docs/models/shared/ProjectRef.md + - docs/models/shared/BilledToType.md + - docs/models/shared/AccountingCustomerRef.md + - docs/models/shared/AccountingBills.md + - docs/models/shared/AccountingSupplier.md + - docs/models/shared/SupplierStatus.md + - docs/models/shared/AccountingAddress.md + - docs/models/shared/AccountingAddressType.md + - docs/models/shared/AccountingSuppliers.md + - docs/models/shared/AccountingBillCreditNote.md + - docs/models/shared/WithholdingTaxItems.md + - docs/models/shared/BillCreditNoteStatus.md + - docs/models/shared/ItemReference.md + - docs/models/shared/TaxRateReference.md + - docs/models/shared/BillCreditNoteLineItem.md + - docs/models/shared/AccountingBillCreditNotes.md + - docs/models/shared/AccountingBillPayment.md + - docs/models/shared/PaymentMethodRef.md + - docs/models/shared/BillPaymentLine.md + - docs/models/shared/BillPaymentLineLink.md + - docs/models/shared/BillPaymentLineLinkType.md + - docs/models/shared/AccountingBillPayments.md + - docs/models/shared/CommerceCustomer.md + - docs/models/shared/CommerceAddress.md + - docs/models/shared/CommerceAddressType.md + - docs/models/shared/CommerceCustomers.md + - docs/models/shared/CommerceDispute.md + - docs/models/shared/DisputeStatus.md + - docs/models/shared/TransactionSourceRef.md + - docs/models/shared/TransactionSourceType.md + - docs/models/shared/CommerceDisputes.md + - docs/models/shared/CommerceLocation.md + - docs/models/shared/CommerceLocations.md + - docs/models/shared/CommerceOrder.md + - docs/models/shared/ServiceCharge.md + - docs/models/shared/ServiceChargeType.md + - docs/models/shared/TaxComponentAllocation.md + - docs/models/shared/TaxComponentRef.md + - docs/models/shared/PaymentRef.md + - docs/models/shared/PaymentType.md + - docs/models/shared/PaymentStatus.md + - docs/models/shared/OrderLineItem.md + - docs/models/shared/ProductVariantRef.md + - docs/models/shared/ProductRef.md + - docs/models/shared/OrderDiscountAllocation.md + - docs/models/shared/LocationRef.md + - docs/models/shared/CommerceCustomerRef.md + - docs/models/shared/CommerceOrders.md + - docs/models/shared/CommercePaymentMethodStatus.md + - docs/models/shared/CommercePaymentMethod.md + - docs/models/shared/CommercePaymentMethods.md + - docs/models/shared/CommercePayment.md + - docs/models/shared/CommercePayments.md + - docs/models/shared/CommerceProductCategory.md + - docs/models/shared/CommerceRecordRef.md + - docs/models/shared/CommerceProductCategories.md + - docs/models/shared/CommerceProduct.md + - docs/models/shared/ProductVariant.md + - docs/models/shared/ProductVariantStatus.md + - docs/models/shared/ProductPrice.md + - docs/models/shared/ProductInventory.md + - docs/models/shared/ProductInventoryLocation.md + - docs/models/shared/CommerceProducts.md + - docs/models/shared/CommerceTransaction.md + - docs/models/shared/TransactionType.md + - docs/models/shared/CommerceTransactions.md + - docs/models/shared/CommerceReport.md + - docs/models/shared/CommerceReportComponent.md + - docs/models/shared/ReportComponentMeasure.md + - docs/models/shared/CommerceReportMeasure.md + - docs/models/shared/CommerceReportError.md + - docs/models/shared/CommerceReportDimensionItems.md + - docs/models/shared/CommerceReportDimension.md + - docs/models/shared/PeriodUnit.md + - docs/models/shared/AccountingCompanyInfo.md + - docs/models/shared/Type.md + - docs/models/shared/WebLink.md + - docs/models/shared/PhoneNumber.md + - docs/models/shared/PhoneNumberType.md + - docs/models/shared/CommerceCompanyInfo.md + - docs/models/shared/AccountBalance.md + - docs/models/shared/AccountingCustomer.md + - docs/models/shared/CustomerStatus.md + - docs/models/shared/Contact.md + - docs/models/shared/AccountingCustomers.md + - docs/models/shared/AccountingDirectIncome.md + - docs/models/shared/DirectIncomeLineItem.md + - docs/models/shared/AccountingDirectIncomes.md + - docs/models/shared/AccountingInvoiceDataType.md + - docs/models/shared/SalesOrderReference.md + - docs/models/shared/AccountingInvoice.md + - docs/models/shared/InvoiceStatus.md + - docs/models/shared/InvoiceLineItem.md + - docs/models/shared/RecordReference.md + - docs/models/shared/AccountsReceivableTracking.md + - docs/models/shared/BilledToType1.md + - docs/models/shared/AccountingInvoices.md + - docs/models/shared/EnhancedInvoicesReport.md + - docs/models/shared/EnhancedInvoiceReportItem.md + - docs/models/shared/Payment.md + - docs/models/shared/BankingTransactionRef.md + - docs/models/shared/LendingCustomerRef.md + - docs/models/shared/AccountingCreditNote.md + - docs/models/shared/CreditNoteStatus.md + - docs/models/shared/CreditNoteLineItem.md + - docs/models/shared/AccountingCreditNotes.md + - docs/models/shared/AccountingPayment.md + - docs/models/shared/PaymentLine.md + - docs/models/shared/PaymentLineLink.md + - docs/models/shared/PaymentLinkType.md + - docs/models/shared/AccountingPayments.md + - docs/models/shared/AccountingAgedCreditorReport.md + - docs/models/shared/AgedCreditor.md + - docs/models/shared/AgedCurrencyOutstanding.md + - docs/models/shared/AgedOutstandingAmount.md + - docs/models/shared/AgedOutstandingAmountDetail.md + - docs/models/shared/AccountingAgedDebtorReport.md + - docs/models/shared/AgedDebtor.md + - docs/models/shared/File.md + - docs/models/shared/FileUpload.md + - docs/models/shared/CodatFile.md + - docs/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.md + - docs/models/shared/AccountingCreateBankAccountResponse.md + - docs/models/shared/Validation.md + - docs/models/shared/ValidationItem.md + - docs/models/shared/PushOperationStatus.md + - docs/models/shared/DataType.md + - docs/models/shared/PushOperationChange.md + - docs/models/shared/PushChangeType.md + - docs/models/shared/PushOperationRef.md + - docs/models/shared/PushOption.md + - docs/models/shared/PushValidationInfo.md + - docs/models/shared/PushFieldValidation.md + - docs/models/shared/PushOptionType.md + - docs/models/shared/PushOptionProperty.md + - docs/models/shared/PushOptionChoice.md + - docs/models/shared/AccountingCreateBankAccountTransactions.md + - docs/models/shared/AccountingCreateBankTransactionsResponse.md + - docs/models/shared/CreateBankAccountTransaction.md + - docs/models/shared/AccountingCreateBankTransactions.md + - docs/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.md + - docs/models/shared/AccountingCreateAccountResponseAccountingAccount.md + - docs/models/shared/AccountingCreateAccountResponse.md + - docs/models/shared/AccountType.md + - docs/models/shared/AccountStatus.md + - docs/models/shared/ValidDataTypeLinks.md + - docs/models/shared/AccountPrototype.md + - docs/models/shared/AccountingCreateDirectCostResponseDataType.md + - docs/models/shared/AccountingCreateDirectCostResponseContactReference.md + - docs/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.md + - docs/models/shared/AccountingCreateDirectCostResponse.md + - docs/models/shared/DirectCostPrototypeDataType.md + - docs/models/shared/ContactReference.md + - docs/models/shared/DirectCostPrototype.md + - docs/models/shared/AccountingCreatePaymentResponseAccountingPayment.md + - docs/models/shared/AccountingCreatePaymentResponse.md + - docs/models/shared/AccountingCreateSupplierResponseAccountingSupplier.md + - docs/models/shared/AccountingCreateSupplierResponse.md + - docs/models/shared/AccountingCreateTransferResponseAccountingTransfer.md + - docs/models/shared/AccountingCreateTransferResponse.md + - docs/models/shared/PushOperation.md + - docs/models/shared/PushOperations.md + - docs/models/shared/AccountingAccountValidDataTypeLinks.md + - docs/models/shared/AccountingAccount.md + - docs/models/shared/AccountingAccounts.md + - docs/models/shared/AccountingBalanceSheet.md + - docs/models/shared/BalanceSheet.md + - docs/models/shared/ReportLineInput.md + - docs/models/shared/ReportLine.md + - docs/models/shared/ReportItem.md + - docs/models/shared/EnhancedFinancialReport.md + - docs/models/shared/EnhancedReportAccountCategory.md + - docs/models/shared/AccountCategoryLevel.md + - docs/models/shared/EnhancedReportInfo.md + - docs/models/shared/AccountingCashFlowStatement.md + - docs/models/shared/CashFlowStatement.md + - docs/models/shared/ReportInput.md + - docs/models/shared/ReportBasis.md + - docs/models/shared/AccountingProfitAndLossReport.md + - docs/models/shared/ProfitAndLossReport.md + - docs/models/shared/DataTypes.md + - docs/models/shared/DataStatus.md + - docs/models/shared/PullOperationStatus.md + - docs/models/shared/PullOperation.md + - docs/models/shared/SchemaDataType.md + - docs/models/shared/PullOperations.md + - docs/models/shared/LoanSummary.md + - docs/models/shared/LoanSummaryReportItem.md + - docs/models/shared/LoanSummaryRecordRef.md + - docs/models/shared/LoanSummaryRecordRefType.md + - docs/models/shared/LoanSummaryIntegrationType.md + - docs/models/shared/LoanSummaryReportInfo.md + - docs/models/shared/LoanTransactions.md + - docs/models/shared/LoanTransactionType.md + - docs/models/shared/ReportItems.md + - docs/models/shared/LoanRef.md + - docs/models/shared/ItemRef.md + - docs/models/shared/LoanTransactionsReportInfo.md + - docs/models/shared/DataIntegrityDetails.md + - docs/models/shared/DataIntegrityDetail.md + - docs/models/shared/DataIntegrityMatch.md + - docs/models/shared/DataIntegrityDataType.md + - docs/models/shared/DataIntegrityStatuses.md + - docs/models/shared/DataIntegrityStatus.md + - docs/models/shared/DataIntegrityStatusInfo.md + - docs/models/shared/IntegrityStatus.md + - docs/models/shared/DataIntegrityDates.md + - docs/models/shared/DataIntegrityConnectionId.md + - docs/models/shared/DataIntegrityAmounts.md + - docs/models/shared/DataIntegritySummaries.md + - docs/models/shared/DataIntegritySummary.md + - docs/models/shared/DataIntegrityByCount.md + - docs/models/shared/DataIntegrityByAmount.md + - docs/models/shared/ExcelReportTypes.md + - docs/models/shared/ExcelStatus.md + - docs/models/shared/Security.md + - docs/models/shared/AccountCategoriesUpdatedWebhook.md + - docs/models/shared/AccountCategoriesUpdatedWebhookData.md + - docs/models/shared/ClientRateLimitReachedWebhook.md + - docs/models/shared/ClientRateLimitReachedWebhookData.md + - docs/models/shared/ClientRateLimitResetWebhook.md + - docs/models/shared/ClientRateLimitResetWebhookData.md + - docs/models/webhooks/AccountCategoriesUpdatedResponse.md + - docs/models/webhooks/ClientRateLimitReachedResponse.md + - docs/models/webhooks/ClientRateLimitResetResponse.md + - docs/sdks/codatlending/README.md + - docs/sdks/companies/README.md + - docs/sdks/connections/README.md + - docs/sdks/transactions/README.md + - docs/sdks/accounttransactions/README.md + - docs/sdks/codatlendingdirectcosts/README.md + - docs/sdks/codatlendingtransfers/README.md + - docs/sdks/journalentries/README.md + - docs/sdks/journals/README.md + - docs/sdks/codatlendingaccountingbankdata/README.md + - docs/sdks/accounts/README.md + - docs/sdks/banking/README.md + - docs/sdks/accountbalances/README.md + - docs/sdks/codatlendingaccounts/README.md + - docs/sdks/transactioncategories/README.md + - docs/sdks/codatlendingbankingtransactions/README.md + - docs/sdks/categorizedstatement/README.md + - docs/sdks/accountspayable/README.md + - docs/sdks/bills/README.md + - docs/sdks/suppliers/README.md + - docs/sdks/billcreditnotes/README.md + - docs/sdks/billpayments/README.md + - docs/sdks/sales/README.md + - docs/sdks/codatlendingcustomers/README.md + - docs/sdks/disputes/README.md + - docs/sdks/locations/README.md + - docs/sdks/orders/README.md + - docs/sdks/paymentmethods/README.md + - docs/sdks/codatlendingsalespayments/README.md + - docs/sdks/productcategories/README.md + - docs/sdks/products/README.md + - docs/sdks/codatlendingtransactions/README.md + - docs/sdks/metrics/README.md + - docs/sdks/codatlendingreports/README.md + - docs/sdks/companyinfo/README.md + - docs/sdks/accountsreceivable/README.md + - docs/sdks/customers/README.md + - docs/sdks/directincomes/README.md + - docs/sdks/invoices/README.md + - docs/sdks/creditnotes/README.md + - docs/sdks/payments/README.md + - docs/sdks/reports/README.md + - docs/sdks/fileupload/README.md + - docs/sdks/loanwriteback/README.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/banktransactions/README.md + - docs/sdks/codatlendingloanwritebackaccounts/README.md + - docs/sdks/directcosts/README.md + - docs/sdks/codatlendingpayments/README.md + - docs/sdks/codatlendingsuppliers/README.md + - docs/sdks/transfers/README.md + - docs/sdks/createoperations/README.md + - docs/sdks/financialstatements/README.md + - docs/sdks/codatlendingfinancialstatementsaccounts/README.md + - docs/sdks/balancesheet/README.md + - docs/sdks/cashflow/README.md + - docs/sdks/profitandloss/README.md + - docs/sdks/managedata/README.md + - docs/sdks/refresh/README.md + - docs/sdks/pulloperations/README.md + - docs/sdks/liabilities/README.md + - docs/sdks/dataintegrity/README.md + - docs/sdks/excelreports/README.md + - USAGE.md diff --git a/lending/README.md b/lending/README.md index c9d7c115..381e3c9b 100644 --- a/lending/README.md +++ b/lending/README.md @@ -4,18 +4,636 @@ Lending helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from the operating systems they are already using. You can use that data for automating decisioning and surfacing new insights on the customer, all via one API. - -replace me - + +## SDK Installation + +### Gradle + +```groovy +implementation 'io.codat.lending:openapi:0.1.0' +``` + ## Example Usage - -replace me - + +## SDK Example Usage + +### Example + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + + + +## Available Resources and Operations + +### [companies()](docs/sdks/companies/README.md) + +* [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 +* [list](docs/sdks/companies/README.md#list) - List companies +* [update](docs/sdks/companies/README.md#update) - Update company + +### [connections()](docs/sdks/connections/README.md) + +* [create](docs/sdks/connections/README.md#create) - Create connection +* [delete](docs/sdks/connections/README.md#delete) - Delete connection +* [get](docs/sdks/connections/README.md#get) - Get connection +* [list](docs/sdks/connections/README.md#list) - List connections +* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection + + +### [transactions().accountTransactions()](docs/sdks/accounttransactions/README.md) + +* [get](docs/sdks/accounttransactions/README.md#get) - Get account transaction +* [list](docs/sdks/accounttransactions/README.md#list) - List account transactions + +### [transactions().directCosts()](docs/sdks/codatlendingdirectcosts/README.md) + +* [downloadAttachment](docs/sdks/codatlendingdirectcosts/README.md#downloadattachment) - Download direct cost attachment +* [get](docs/sdks/codatlendingdirectcosts/README.md#get) - Get direct cost +* [getAttachment](docs/sdks/codatlendingdirectcosts/README.md#getattachment) - Get direct cost attachment +* [list](docs/sdks/codatlendingdirectcosts/README.md#list) - List direct costs +* [listAttachments](docs/sdks/codatlendingdirectcosts/README.md#listattachments) - List direct cost attachments + +### [transactions().transfers()](docs/sdks/codatlendingtransfers/README.md) + +* [get](docs/sdks/codatlendingtransfers/README.md#get) - Get transfer +* [list](docs/sdks/codatlendingtransfers/README.md#list) - List transfers + +### [transactions().journalEntries()](docs/sdks/journalentries/README.md) + +* [get](docs/sdks/journalentries/README.md#get) - Get journal entry +* [list](docs/sdks/journalentries/README.md#list) - List journal entries + +### [transactions().journals()](docs/sdks/journals/README.md) + +* [get](docs/sdks/journals/README.md#get) - Get journal +* [list](docs/sdks/journals/README.md#list) - List journals + +### [accountingBankData()](docs/sdks/codatlendingaccountingbankdata/README.md) + +* [listTransactions](docs/sdks/codatlendingaccountingbankdata/README.md#listtransactions) - List bank account transactions + +### [accountingBankData().accounts()](docs/sdks/accounts/README.md) + +* [get](docs/sdks/accounts/README.md#get) - Get bank account +* [list](docs/sdks/accounts/README.md#list) - List bank accounts + + +### [banking().accountBalances()](docs/sdks/accountbalances/README.md) + +* [list](docs/sdks/accountbalances/README.md#list) - List account balances + +### [banking().accounts()](docs/sdks/codatlendingaccounts/README.md) + +* [get](docs/sdks/codatlendingaccounts/README.md#get) - Get account +* [list](docs/sdks/codatlendingaccounts/README.md#list) - List accounts + +### [banking().transactionCategories()](docs/sdks/transactioncategories/README.md) + +* [get](docs/sdks/transactioncategories/README.md#get) - Get transaction category +* [list](docs/sdks/transactioncategories/README.md#list) - List transaction categories + +### [banking().transactions()](docs/sdks/codatlendingbankingtransactions/README.md) + +* [get](docs/sdks/codatlendingbankingtransactions/README.md#get) - Get bank transaction +* [list](docs/sdks/codatlendingbankingtransactions/README.md#list) - List transactions + +### [banking().categorizedStatement()](docs/sdks/categorizedstatement/README.md) + +* [get](docs/sdks/categorizedstatement/README.md#get) - Get categorized bank statement + + +### [accountsPayable().bills()](docs/sdks/bills/README.md) + +* [downloadAttachment](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment +* [get](docs/sdks/bills/README.md#get) - Get bill +* [getAttachment](docs/sdks/bills/README.md#getattachment) - Get bill attachment +* [list](docs/sdks/bills/README.md#list) - List bills +* [listAttachments](docs/sdks/bills/README.md#listattachments) - List bill attachments + +### [accountsPayable().suppliers()](docs/sdks/suppliers/README.md) + +* [downloadAttachment](docs/sdks/suppliers/README.md#downloadattachment) - Download supplier attachment +* [get](docs/sdks/suppliers/README.md#get) - Get supplier +* [getAttachment](docs/sdks/suppliers/README.md#getattachment) - Get supplier attachment +* [list](docs/sdks/suppliers/README.md#list) - List suppliers +* [listAttachments](docs/sdks/suppliers/README.md#listattachments) - List supplier attachments + +### [accountsPayable().billCreditNotes()](docs/sdks/billcreditnotes/README.md) + +* [get](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note +* [list](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes + +### [accountsPayable().billPayments()](docs/sdks/billpayments/README.md) + +* [get](docs/sdks/billpayments/README.md#get) - Get bill payment +* [list](docs/sdks/billpayments/README.md#list) - List bill payments + + +### [sales().customers()](docs/sdks/codatlendingcustomers/README.md) + +* [get](docs/sdks/codatlendingcustomers/README.md#get) - Get customer +* [list](docs/sdks/codatlendingcustomers/README.md#list) - List customers + +### [sales().disputes()](docs/sdks/disputes/README.md) + +* [get](docs/sdks/disputes/README.md#get) - Get dispute +* [list](docs/sdks/disputes/README.md#list) - List disputes + +### [sales().locations()](docs/sdks/locations/README.md) + +* [get](docs/sdks/locations/README.md#get) - Get location +* [list](docs/sdks/locations/README.md#list) - List locations + +### [sales().orders()](docs/sdks/orders/README.md) + +* [get](docs/sdks/orders/README.md#get) - Get order +* [list](docs/sdks/orders/README.md#list) - List orders + +### [sales().paymentMethods()](docs/sdks/paymentmethods/README.md) + +* [get](docs/sdks/paymentmethods/README.md#get) - Get payment method +* [list](docs/sdks/paymentmethods/README.md#list) - List payment methods + +### [sales().payments()](docs/sdks/codatlendingsalespayments/README.md) + +* [get](docs/sdks/codatlendingsalespayments/README.md#get) - Get payment +* [list](docs/sdks/codatlendingsalespayments/README.md#list) - List payments + +### [sales().productCategories()](docs/sdks/productcategories/README.md) + +* [get](docs/sdks/productcategories/README.md#get) - Get product category +* [list](docs/sdks/productcategories/README.md#list) - List product categories + +### [sales().products()](docs/sdks/products/README.md) + +* [get](docs/sdks/products/README.md#get) - Get product +* [list](docs/sdks/products/README.md#list) - List products + +### [sales().transactions()](docs/sdks/codatlendingtransactions/README.md) + +* [get](docs/sdks/codatlendingtransactions/README.md#get) - Get transaction +* [list](docs/sdks/codatlendingtransactions/README.md#list) - List transactions + +### [sales().metrics()](docs/sdks/metrics/README.md) + +* [getCustomerRetention](docs/sdks/metrics/README.md#getcustomerretention) - Get customer retention metrics +* [getLifetimeValue](docs/sdks/metrics/README.md#getlifetimevalue) - Get lifetime value metrics +* [getRevenue](docs/sdks/metrics/README.md#getrevenue) - Get commerce revenue metrics + +### [sales().reports()](docs/sdks/codatlendingreports/README.md) + +* [getOrders](docs/sdks/codatlendingreports/README.md#getorders) - Get orders report +* [getRefunds](docs/sdks/codatlendingreports/README.md#getrefunds) - Get refunds report + +### [companyInfo()](docs/sdks/companyinfo/README.md) + +* [getAccountingProfile](docs/sdks/companyinfo/README.md#getaccountingprofile) - Get company accounting profile +* [getCommerceProfile](docs/sdks/companyinfo/README.md#getcommerceprofile) - Get company commerce profile + + +### [accountsReceivable().customers()](docs/sdks/customers/README.md) + +* [downloadAttachment](docs/sdks/customers/README.md#downloadattachment) - Download customer attachment +* [get](docs/sdks/customers/README.md#get) - Get customer +* [getAttachment](docs/sdks/customers/README.md#getattachment) - Get customer attachment +* [list](docs/sdks/customers/README.md#list) - List customers +* [listAttachments](docs/sdks/customers/README.md#listattachments) - List customer attachments + +### [accountsReceivable().directIncomes()](docs/sdks/directincomes/README.md) + +* [downloadAttachment](docs/sdks/directincomes/README.md#downloadattachment) - Download direct income attachment +* [get](docs/sdks/directincomes/README.md#get) - Get direct income +* [getAttachment](docs/sdks/directincomes/README.md#getattachment) - Get direct income attachment +* [list](docs/sdks/directincomes/README.md#list) - List direct incomes +* [listAttachments](docs/sdks/directincomes/README.md#listattachments) - List direct income attachments + +### [accountsReceivable().invoices()](docs/sdks/invoices/README.md) + +* [downloadAttachment](docs/sdks/invoices/README.md#downloadattachment) - Download invoice attachment +* [downloadPdf](docs/sdks/invoices/README.md#downloadpdf) - Get invoice as PDF +* [get](docs/sdks/invoices/README.md#get) - Get invoice +* [getAttachment](docs/sdks/invoices/README.md#getattachment) - Get invoice attachment +* [list](docs/sdks/invoices/README.md#list) - List invoices +* [listAttachments](docs/sdks/invoices/README.md#listattachments) - List invoice attachments +* [listReconciled](docs/sdks/invoices/README.md#listreconciled) - List reconciled invoices + +### [accountsReceivable().creditNotes()](docs/sdks/creditnotes/README.md) + +* [get](docs/sdks/creditnotes/README.md#get) - Get credit note +* [list](docs/sdks/creditnotes/README.md#list) - List credit notes + +### [accountsReceivable().payments()](docs/sdks/payments/README.md) + +* [get](docs/sdks/payments/README.md#get) - Get payment +* [list](docs/sdks/payments/README.md#list) - List payments + +### [accountsReceivable().reports()](docs/sdks/reports/README.md) + +* [getAgedCreditors](docs/sdks/reports/README.md#getagedcreditors) - Aged creditors report +* [getAgedDebtors](docs/sdks/reports/README.md#getageddebtors) - Aged debtors report +* [isAgedCreditorsAvailable](docs/sdks/reports/README.md#isagedcreditorsavailable) - Aged creditors report available +* [isAgedDebtorsAvailable](docs/sdks/reports/README.md#isageddebtorsavailable) - Aged debtors report available + +### [fileUpload()](docs/sdks/fileupload/README.md) + +* [download](docs/sdks/fileupload/README.md#download) - Download all files for a company +* [listUploaded](docs/sdks/fileupload/README.md#listuploaded) - List all files uploaded by a company +* [upload](docs/sdks/fileupload/README.md#upload) - Upload files for a company + + +### [loanWriteback().bankAccounts()](docs/sdks/bankaccounts/README.md) + +* [create](docs/sdks/bankaccounts/README.md#create) - Create bank account +* [getCreateUpdateModel](docs/sdks/bankaccounts/README.md#getcreateupdatemodel) - Get create/update bank account model + +### [loanWriteback().bankTransactions()](docs/sdks/banktransactions/README.md) + +* [create](docs/sdks/banktransactions/README.md#create) - Create bank account transactions +* [getCreateModel](docs/sdks/banktransactions/README.md#getcreatemodel) - Get create bank account transactions model + +### [loanWriteback().accounts()](docs/sdks/codatlendingloanwritebackaccounts/README.md) + +* [create](docs/sdks/codatlendingloanwritebackaccounts/README.md#create) - Create account +* [getCreateModel](docs/sdks/codatlendingloanwritebackaccounts/README.md#getcreatemodel) - Get create account model + +### [loanWriteback().directCosts()](docs/sdks/directcosts/README.md) + +* [create](docs/sdks/directcosts/README.md#create) - Create direct cost +* [getCreateModel](docs/sdks/directcosts/README.md#getcreatemodel) - Get create direct cost model + +### [loanWriteback().payments()](docs/sdks/codatlendingpayments/README.md) + +* [create](docs/sdks/codatlendingpayments/README.md#create) - Create payment +* [getCreateModel](docs/sdks/codatlendingpayments/README.md#getcreatemodel) - Get create payment model + +### [loanWriteback().suppliers()](docs/sdks/codatlendingsuppliers/README.md) + +* [create](docs/sdks/codatlendingsuppliers/README.md#create) - Create supplier +* [getCreateUpdateModel](docs/sdks/codatlendingsuppliers/README.md#getcreateupdatemodel) - Get create/update supplier model + +### [loanWriteback().transfers()](docs/sdks/transfers/README.md) + +* [create](docs/sdks/transfers/README.md#create) - Create transfer +* [getCreateModel](docs/sdks/transfers/README.md#getcreatemodel) - Get create transfer model + +### [loanWriteback().createOperations()](docs/sdks/createoperations/README.md) + +* [get](docs/sdks/createoperations/README.md#get) - Get create operation +* [list](docs/sdks/createoperations/README.md#list) - List create operations + + +### [financialStatements().accounts()](docs/sdks/codatlendingfinancialstatementsaccounts/README.md) + +* [get](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#get) - Get account +* [list](docs/sdks/codatlendingfinancialstatementsaccounts/README.md#list) - List accounts + +### [financialStatements().balanceSheet()](docs/sdks/balancesheet/README.md) + +* [get](docs/sdks/balancesheet/README.md#get) - Get balance sheet +* [getCategorizedAccounts](docs/sdks/balancesheet/README.md#getcategorizedaccounts) - Get categorized balance sheet statement + +### [financialStatements().cashFlow()](docs/sdks/cashflow/README.md) + +* [get](docs/sdks/cashflow/README.md#get) - Get cash flow statement + +### [financialStatements().profitAndLoss()](docs/sdks/profitandloss/README.md) + +* [get](docs/sdks/profitandloss/README.md#get) - Get profit and loss +* [getCategorizedAccounts](docs/sdks/profitandloss/README.md#getcategorizedaccounts) - Get categorized profit and loss statement + +### [manageData()](docs/sdks/managedata/README.md) + +* [getStatus](docs/sdks/managedata/README.md#getstatus) - Get data status + +### [manageData().refresh()](docs/sdks/refresh/README.md) + +* [allDataTypes](docs/sdks/refresh/README.md#alldatatypes) - Refresh all data +* [dataType](docs/sdks/refresh/README.md#datatype) - Refresh data type + +### [manageData().pullOperations()](docs/sdks/pulloperations/README.md) + +* [get](docs/sdks/pulloperations/README.md#get) - Get pull operation +* [list](docs/sdks/pulloperations/README.md#list) - List pull operations + +### [liabilities()](docs/sdks/liabilities/README.md) + +* [generateLoanSummary](docs/sdks/liabilities/README.md#generateloansummary) - Generate loan summaries report +* [generateLoanTransactions](docs/sdks/liabilities/README.md#generateloantransactions) - Generate loan transactions report +* [getLoanSummary](docs/sdks/liabilities/README.md#getloansummary) - Get loan summaries +* [listLoanTransactions](docs/sdks/liabilities/README.md#listloantransactions) - List loan transactions + +### [dataIntegrity()](docs/sdks/dataintegrity/README.md) + +* [details](docs/sdks/dataintegrity/README.md#details) - List data integrity details +* [status](docs/sdks/dataintegrity/README.md#status) - Get data integrity status +* [summaries](docs/sdks/dataintegrity/README.md#summaries) - Get data integrity summaries + +### [excelReports()](docs/sdks/excelreports/README.md) + +* [download](docs/sdks/excelreports/README.md#download) - Download Excel report +* [generate](docs/sdks/excelreports/README.md#generate) - Generate Excel report +* [getStatus](docs/sdks/excelreports/README.md#getstatus) - Get Excel report status + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Exception type. + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +### Example + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + + + +## 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.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .serverIndex(0) + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + + +### 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: +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .serverURL("https://api.codat.io") + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------ | ------------ | ------------ | +| `authHeader` | apiKey | API key | + +You can set the security parameters through the `security` builder method when initializing the SDK client instance. For example: +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + + + + - -replace me - ### Support diff --git a/lending/RELEASES.md b/lending/RELEASES.md new file mode 100644 index 00000000..02556359 --- /dev/null +++ b/lending/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2024-02-06 14:03:57 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Lending.yaml +- Speakeasy CLI 1.167.4 (2.250.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.1.0] lending +### Releases +- [Maven Central v0.1.0] https://central.sonatype.com/artifact/io.codat/lending/0.1.0 - lending \ No newline at end of file diff --git a/lending/USAGE.md b/lending/USAGE.md new file mode 100644 index 00000000..a02a4bbc --- /dev/null +++ b/lending/USAGE.md @@ -0,0 +1,51 @@ + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + \ No newline at end of file diff --git a/lending/docs/models/operations/CreateAccountRequest.md b/lending/docs/models/operations/CreateAccountRequest.md new file mode 100644 index 00000000..fdc33099 --- /dev/null +++ b/lending/docs/models/operations/CreateAccountRequest.md @@ -0,0 +1,12 @@ +# CreateAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `accountPrototype` | [Optional](../../models/shared/AccountPrototype.md) | :heavy_minus_sign: | N/A | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateAccountResponse.md b/lending/docs/models/operations/CreateAccountResponse.md new file mode 100644 index 00000000..cfe92c65 --- /dev/null +++ b/lending/docs/models/operations/CreateAccountResponse.md @@ -0,0 +1,12 @@ +# CreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateAccountResponse` | [Optional](../../models/shared/AccountingCreateAccountResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateBankAccountRequest.md b/lending/docs/models/operations/CreateBankAccountRequest.md new file mode 100644 index 00000000..e64ca518 --- /dev/null +++ b/lending/docs/models/operations/CreateBankAccountRequest.md @@ -0,0 +1,12 @@ +# CreateBankAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `accountingBankAccount` | [JsonNullable](../../models/shared/AccountingBankAccount.md) | :heavy_minus_sign: | N/A | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateBankAccountResponse.md b/lending/docs/models/operations/CreateBankAccountResponse.md new file mode 100644 index 00000000..0402e006 --- /dev/null +++ b/lending/docs/models/operations/CreateBankAccountResponse.md @@ -0,0 +1,12 @@ +# CreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateBankAccountResponse` | [Optional](../../models/shared/AccountingCreateBankAccountResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateBankTransactionsRequest.md b/lending/docs/models/operations/CreateBankTransactionsRequest.md new file mode 100644 index 00000000..d49401db --- /dev/null +++ b/lending/docs/models/operations/CreateBankTransactionsRequest.md @@ -0,0 +1,13 @@ +# CreateBankTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateBankTransactions` | [Optional](../../models/shared/AccountingCreateBankTransactions.md) | :heavy_minus_sign: | N/A | | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateBankTransactionsResponse.md b/lending/docs/models/operations/CreateBankTransactionsResponse.md new file mode 100644 index 00000000..32cfa760 --- /dev/null +++ b/lending/docs/models/operations/CreateBankTransactionsResponse.md @@ -0,0 +1,12 @@ +# CreateBankTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateBankTransactionsResponse` | [Optional](../../models/shared/AccountingCreateBankTransactionsResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateCompanyResponse.md b/lending/docs/models/operations/CreateCompanyResponse.md new file mode 100644 index 00000000..e334a321 --- /dev/null +++ b/lending/docs/models/operations/CreateCompanyResponse.md @@ -0,0 +1,12 @@ +# CreateCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `company` | [Optional](../../models/shared/Company.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateConnectionRequest.md b/lending/docs/models/operations/CreateConnectionRequest.md new file mode 100644 index 00000000..20fd6af7 --- /dev/null +++ b/lending/docs/models/operations/CreateConnectionRequest.md @@ -0,0 +1,9 @@ +# CreateConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `requestBody` | [Optional](../../models/operations/CreateConnectionRequestBody.md) | :heavy_minus_sign: | N/A | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateConnectionRequestBody.md b/lending/docs/models/operations/CreateConnectionRequestBody.md new file mode 100644 index 00000000..3c6aaec8 --- /dev/null +++ b/lending/docs/models/operations/CreateConnectionRequestBody.md @@ -0,0 +1,8 @@ +# CreateConnectionRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `platformKey` | *Optional* | :heavy_minus_sign: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateConnectionResponse.md b/lending/docs/models/operations/CreateConnectionResponse.md new file mode 100644 index 00000000..50336c8d --- /dev/null +++ b/lending/docs/models/operations/CreateConnectionResponse.md @@ -0,0 +1,12 @@ +# CreateConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `connection` | [Optional](../../models/shared/Connection.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/CreateDirectCostRequest.md b/lending/docs/models/operations/CreateDirectCostRequest.md new file mode 100644 index 00000000..50fd8770 --- /dev/null +++ b/lending/docs/models/operations/CreateDirectCostRequest.md @@ -0,0 +1,12 @@ +# CreateDirectCostRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `directCostPrototype` | [Optional](../../models/shared/DirectCostPrototype.md) | :heavy_minus_sign: | N/A | | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateDirectCostResponse.md b/lending/docs/models/operations/CreateDirectCostResponse.md new file mode 100644 index 00000000..d8aee68a --- /dev/null +++ b/lending/docs/models/operations/CreateDirectCostResponse.md @@ -0,0 +1,12 @@ +# CreateDirectCostResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateDirectCostResponse` | [Optional](../../models/shared/AccountingCreateDirectCostResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreatePaymentRequest.md b/lending/docs/models/operations/CreatePaymentRequest.md new file mode 100644 index 00000000..19ae1dd2 --- /dev/null +++ b/lending/docs/models/operations/CreatePaymentRequest.md @@ -0,0 +1,12 @@ +# CreatePaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `accountingPayment` | [JsonNullable](../../models/shared/AccountingPayment.md) | :heavy_minus_sign: | N/A | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreatePaymentResponse.md b/lending/docs/models/operations/CreatePaymentResponse.md new file mode 100644 index 00000000..c0315f8a --- /dev/null +++ b/lending/docs/models/operations/CreatePaymentResponse.md @@ -0,0 +1,12 @@ +# CreatePaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreatePaymentResponse` | [Optional](../../models/shared/AccountingCreatePaymentResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateSupplierRequest.md b/lending/docs/models/operations/CreateSupplierRequest.md new file mode 100644 index 00000000..b976cee2 --- /dev/null +++ b/lending/docs/models/operations/CreateSupplierRequest.md @@ -0,0 +1,12 @@ +# CreateSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `accountingSupplier` | [JsonNullable](../../models/shared/AccountingSupplier.md) | :heavy_minus_sign: | N/A | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateSupplierResponse.md b/lending/docs/models/operations/CreateSupplierResponse.md new file mode 100644 index 00000000..45da323c --- /dev/null +++ b/lending/docs/models/operations/CreateSupplierResponse.md @@ -0,0 +1,12 @@ +# CreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateSupplierResponse` | [Optional](../../models/shared/AccountingCreateSupplierResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/CreateTransferRequest.md b/lending/docs/models/operations/CreateTransferRequest.md new file mode 100644 index 00000000..070a3a7f --- /dev/null +++ b/lending/docs/models/operations/CreateTransferRequest.md @@ -0,0 +1,12 @@ +# CreateTransferRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `accountingTransfer` | [JsonNullable](../../models/shared/AccountingTransfer.md) | :heavy_minus_sign: | N/A | | +| `allowSyncOnPushComplete` | *Optional* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `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 | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/CreateTransferResponse.md b/lending/docs/models/operations/CreateTransferResponse.md new file mode 100644 index 00000000..2dd8938a --- /dev/null +++ b/lending/docs/models/operations/CreateTransferResponse.md @@ -0,0 +1,12 @@ +# CreateTransferResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreateTransferResponse` | [Optional](../../models/shared/AccountingCreateTransferResponse.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/DeleteCompanyRequest.md b/lending/docs/models/operations/DeleteCompanyRequest.md new file mode 100644 index 00000000..4ff1337c --- /dev/null +++ b/lending/docs/models/operations/DeleteCompanyRequest.md @@ -0,0 +1,8 @@ +# DeleteCompanyRequest + + +## 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/lending/docs/models/operations/DeleteCompanyResponse.md b/lending/docs/models/operations/DeleteCompanyResponse.md new file mode 100644 index 00000000..8b6e30f9 --- /dev/null +++ b/lending/docs/models/operations/DeleteCompanyResponse.md @@ -0,0 +1,11 @@ +# DeleteCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DeleteConnectionRequest.md b/lending/docs/models/operations/DeleteConnectionRequest.md new file mode 100644 index 00000000..5b8e4252 --- /dev/null +++ b/lending/docs/models/operations/DeleteConnectionRequest.md @@ -0,0 +1,9 @@ +# DeleteConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/DeleteConnectionResponse.md b/lending/docs/models/operations/DeleteConnectionResponse.md new file mode 100644 index 00000000..c3fdf98e --- /dev/null +++ b/lending/docs/models/operations/DeleteConnectionResponse.md @@ -0,0 +1,11 @@ +# DeleteConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingBillAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingBillAttachmentRequest.md new file mode 100644 index 00000000..b65f1861 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingBillAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `billId` | *String* | :heavy_check_mark: | Unique identifier for a bill. | | +| `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/lending/docs/models/operations/DownloadAccountingBillAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingBillAttachmentResponse.md new file mode 100644 index 00000000..f23a3753 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingBillAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingBillAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingCustomerAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingCustomerAttachmentRequest.md new file mode 100644 index 00000000..34f05c30 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingCustomerAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingCustomerAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `customerId` | *String* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingCustomerAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingCustomerAttachmentResponse.md new file mode 100644 index 00000000..78dde8df --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingCustomerAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingCustomerAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentRequest.md new file mode 100644 index 00000000..0b715630 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingDirectCostAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `directCostId` | *String* | :heavy_check_mark: | Unique identifier for a direct cost. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentResponse.md new file mode 100644 index 00000000..7dc4290b --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingDirectCostAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingDirectCostAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.md new file mode 100644 index 00000000..2d9404fe --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingDirectIncomeAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `directIncomeId` | *String* | :heavy_check_mark: | Unique identifier for a direct income. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.md new file mode 100644 index 00000000..3a94c2b0 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingDirectIncomeAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentRequest.md new file mode 100644 index 00000000..e8035def --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingInvoiceAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `invoiceId` | *String* | :heavy_check_mark: | Unique identifier for an invoice. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentResponse.md new file mode 100644 index 00000000..3eab1a7b --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingInvoiceAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingInvoiceAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingInvoicePdfRequest.md b/lending/docs/models/operations/DownloadAccountingInvoicePdfRequest.md new file mode 100644 index 00000000..56298210 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingInvoicePdfRequest.md @@ -0,0 +1,9 @@ +# DownloadAccountingInvoicePdfRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `invoiceId` | *String* | :heavy_check_mark: | Unique identifier for an invoice. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingInvoicePdfResponse.md b/lending/docs/models/operations/DownloadAccountingInvoicePdfResponse.md new file mode 100644 index 00000000..cb617868 --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingInvoicePdfResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingInvoicePdfResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadAccountingSupplierAttachmentRequest.md b/lending/docs/models/operations/DownloadAccountingSupplierAttachmentRequest.md new file mode 100644 index 00000000..84ca076c --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingSupplierAttachmentRequest.md @@ -0,0 +1,11 @@ +# DownloadAccountingSupplierAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `supplierId` | *String* | :heavy_check_mark: | Unique identifier for a supplier. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadAccountingSupplierAttachmentResponse.md b/lending/docs/models/operations/DownloadAccountingSupplierAttachmentResponse.md new file mode 100644 index 00000000..022ef8ca --- /dev/null +++ b/lending/docs/models/operations/DownloadAccountingSupplierAttachmentResponse.md @@ -0,0 +1,12 @@ +# DownloadAccountingSupplierAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/DownloadExcelReportRequest.md b/lending/docs/models/operations/DownloadExcelReportRequest.md new file mode 100644 index 00000000..886bc93f --- /dev/null +++ b/lending/docs/models/operations/DownloadExcelReportRequest.md @@ -0,0 +1,9 @@ +# DownloadExcelReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `reportType` | [io.codat.lending.models.shared.ExcelReportTypes](../../models/shared/ExcelReportTypes.md) | :heavy_check_mark: | The type of report you want to generate and download. | | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadExcelReportResponse.md b/lending/docs/models/operations/DownloadExcelReportResponse.md new file mode 100644 index 00000000..7a5b3ea1 --- /dev/null +++ b/lending/docs/models/operations/DownloadExcelReportResponse.md @@ -0,0 +1,12 @@ +# DownloadExcelReportResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `body` | *Optional* | :heavy_minus_sign: | N/A | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/DownloadFilesRequest.md b/lending/docs/models/operations/DownloadFilesRequest.md new file mode 100644 index 00000000..ce52440e --- /dev/null +++ b/lending/docs/models/operations/DownloadFilesRequest.md @@ -0,0 +1,9 @@ +# DownloadFilesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `date` | *Optional* | :heavy_minus_sign: | Only download files uploaded on this date. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/operations/DownloadFilesResponse.md b/lending/docs/models/operations/DownloadFilesResponse.md new file mode 100644 index 00000000..d844c23a --- /dev/null +++ b/lending/docs/models/operations/DownloadFilesResponse.md @@ -0,0 +1,12 @@ +# DownloadFilesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `data` | *Optional* | :heavy_minus_sign: | Success | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GenerateExcelReportRequest.md b/lending/docs/models/operations/GenerateExcelReportRequest.md new file mode 100644 index 00000000..795f80b9 --- /dev/null +++ b/lending/docs/models/operations/GenerateExcelReportRequest.md @@ -0,0 +1,9 @@ +# GenerateExcelReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `reportType` | [io.codat.lending.models.shared.ExcelReportTypes](../../models/shared/ExcelReportTypes.md) | :heavy_check_mark: | The type of report you want to generate and download. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GenerateExcelReportResponse.md b/lending/docs/models/operations/GenerateExcelReportResponse.md new file mode 100644 index 00000000..c8e60ded --- /dev/null +++ b/lending/docs/models/operations/GenerateExcelReportResponse.md @@ -0,0 +1,12 @@ +# GenerateExcelReportResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `excelStatus` | [Optional](../../models/shared/ExcelStatus.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GenerateLoanSummaryRequest.md b/lending/docs/models/operations/GenerateLoanSummaryRequest.md new file mode 100644 index 00000000..a5059062 --- /dev/null +++ b/lending/docs/models/operations/GenerateLoanSummaryRequest.md @@ -0,0 +1,9 @@ +# GenerateLoanSummaryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `sourceType` | [io.codat.lending.models.operations.SourceType](../../models/operations/SourceType.md) | :heavy_check_mark: | Data source type. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GenerateLoanSummaryResponse.md b/lending/docs/models/operations/GenerateLoanSummaryResponse.md new file mode 100644 index 00000000..90c2209a --- /dev/null +++ b/lending/docs/models/operations/GenerateLoanSummaryResponse.md @@ -0,0 +1,11 @@ +# GenerateLoanSummaryResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GenerateLoanTransactionsRequest.md b/lending/docs/models/operations/GenerateLoanTransactionsRequest.md new file mode 100644 index 00000000..a8f03349 --- /dev/null +++ b/lending/docs/models/operations/GenerateLoanTransactionsRequest.md @@ -0,0 +1,9 @@ +# GenerateLoanTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `sourceType` | [io.codat.lending.models.operations.QueryParamSourceType](../../models/operations/QueryParamSourceType.md) | :heavy_check_mark: | Data source type. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GenerateLoanTransactionsResponse.md b/lending/docs/models/operations/GenerateLoanTransactionsResponse.md new file mode 100644 index 00000000..3442fb4d --- /dev/null +++ b/lending/docs/models/operations/GenerateLoanTransactionsResponse.md @@ -0,0 +1,11 @@ +# GenerateLoanTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetAccountingAccountRequest.md b/lending/docs/models/operations/GetAccountingAccountRequest.md new file mode 100644 index 00000000..7a5c58ed --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAccountRequest.md @@ -0,0 +1,9 @@ +# GetAccountingAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingAccountResponse.md b/lending/docs/models/operations/GetAccountingAccountResponse.md new file mode 100644 index 00000000..61fc5b09 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAccountResponse.md @@ -0,0 +1,12 @@ +# GetAccountingAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAccount` | [JsonNullable](../../models/shared/AccountingAccount.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingAccountTransactionRequest.md b/lending/docs/models/operations/GetAccountingAccountTransactionRequest.md new file mode 100644 index 00000000..4d6bfdd1 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAccountTransactionRequest.md @@ -0,0 +1,10 @@ +# GetAccountingAccountTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `accountTransactionId` | *String* | :heavy_check_mark: | Unique identifier for an account transaction. | | +| `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/lending/docs/models/operations/GetAccountingAccountTransactionResponse.md b/lending/docs/models/operations/GetAccountingAccountTransactionResponse.md new file mode 100644 index 00000000..7a77b91a --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAccountTransactionResponse.md @@ -0,0 +1,12 @@ +# GetAccountingAccountTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `accountingAccountTransaction` | [JsonNullable](../../models/shared/AccountingAccountTransaction.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingAgedCreditorsReportRequest.md b/lending/docs/models/operations/GetAccountingAgedCreditorsReportRequest.md new file mode 100644 index 00000000..7b79f035 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAgedCreditorsReportRequest.md @@ -0,0 +1,11 @@ +# GetAccountingAgedCreditorsReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `numberOfPeriods` | *Optional* | :heavy_minus_sign: | Number of periods to include in the report. | 12 | +| `periodLengthDays` | *Optional* | :heavy_minus_sign: | The length of period in days. | 30 | +| `reportDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | Date the report is generated up to. | 2022-12-31 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingAgedCreditorsReportResponse.md b/lending/docs/models/operations/GetAccountingAgedCreditorsReportResponse.md new file mode 100644 index 00000000..122f3b59 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAgedCreditorsReportResponse.md @@ -0,0 +1,12 @@ +# GetAccountingAgedCreditorsReportResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingAgedCreditorReport` | [Optional](../../models/shared/AccountingAgedCreditorReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingAgedDebtorsReportRequest.md b/lending/docs/models/operations/GetAccountingAgedDebtorsReportRequest.md new file mode 100644 index 00000000..9e3a86fb --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAgedDebtorsReportRequest.md @@ -0,0 +1,11 @@ +# GetAccountingAgedDebtorsReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `numberOfPeriods` | *Optional* | :heavy_minus_sign: | Number of periods to include in the report. | 12 | +| `periodLengthDays` | *Optional* | :heavy_minus_sign: | The length of period in days. | 30 | +| `reportDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | Date the report is generated up to. | 2022-12-31 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingAgedDebtorsReportResponse.md b/lending/docs/models/operations/GetAccountingAgedDebtorsReportResponse.md new file mode 100644 index 00000000..271028e3 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingAgedDebtorsReportResponse.md @@ -0,0 +1,12 @@ +# GetAccountingAgedDebtorsReportResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `accountingAgedDebtorReport` | [Optional](../../models/shared/AccountingAgedDebtorReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBalanceSheetRequest.md b/lending/docs/models/operations/GetAccountingBalanceSheetRequest.md new file mode 100644 index 00000000..b1c1aa76 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBalanceSheetRequest.md @@ -0,0 +1,11 @@ +# GetAccountingBalanceSheetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `periodLength` | *int* | :heavy_check_mark: | Number of months defining the period of interest. | 4 | +| `periodsToCompare` | *int* | :heavy_check_mark: | Number of periods with `periodLength` to compare. | 20 | +| `startMonth` | *Optional* | :heavy_minus_sign: | The month the report starts from. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingBalanceSheetResponse.md b/lending/docs/models/operations/GetAccountingBalanceSheetResponse.md new file mode 100644 index 00000000..47e80699 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBalanceSheetResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBalanceSheetResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBalanceSheet` | [Optional](../../models/shared/AccountingBalanceSheet.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBankAccountRequest.md b/lending/docs/models/operations/GetAccountingBankAccountRequest.md new file mode 100644 index 00000000..caf99021 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBankAccountRequest.md @@ -0,0 +1,10 @@ +# GetAccountingBankAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | | +| `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/lending/docs/models/operations/GetAccountingBankAccountResponse.md b/lending/docs/models/operations/GetAccountingBankAccountResponse.md new file mode 100644 index 00000000..b8ac59ed --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBankAccountResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBankAccount` | [JsonNullable](../../models/shared/AccountingBankAccount.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBillAttachmentRequest.md b/lending/docs/models/operations/GetAccountingBillAttachmentRequest.md new file mode 100644 index 00000000..f43c578f --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillAttachmentRequest.md @@ -0,0 +1,11 @@ +# GetAccountingBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `billId` | *String* | :heavy_check_mark: | Unique identifier for a bill. | | +| `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/lending/docs/models/operations/GetAccountingBillAttachmentResponse.md b/lending/docs/models/operations/GetAccountingBillAttachmentResponse.md new file mode 100644 index 00000000..7c14cd43 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBillAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBillCreditNoteRequest.md b/lending/docs/models/operations/GetAccountingBillCreditNoteRequest.md new file mode 100644 index 00000000..aa81b79c --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillCreditNoteRequest.md @@ -0,0 +1,9 @@ +# GetAccountingBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `billCreditNoteId` | *String* | :heavy_check_mark: | Unique identifier for a bill credit note. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingBillCreditNoteResponse.md b/lending/docs/models/operations/GetAccountingBillCreditNoteResponse.md new file mode 100644 index 00000000..b38b9e02 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillCreditNoteResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `accountingBillCreditNote` | [JsonNullable](../../models/shared/AccountingBillCreditNote.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBillPaymentRequest.md b/lending/docs/models/operations/GetAccountingBillPaymentRequest.md new file mode 100644 index 00000000..c27de412 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillPaymentRequest.md @@ -0,0 +1,9 @@ +# GetAccountingBillPaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `billPaymentId` | *String* | :heavy_check_mark: | Unique identifier for a bill payment. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingBillPaymentResponse.md b/lending/docs/models/operations/GetAccountingBillPaymentResponse.md new file mode 100644 index 00000000..0af3858d --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillPaymentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBillPaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBillPayment` | [JsonNullable](../../models/shared/AccountingBillPayment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingBillRequest.md b/lending/docs/models/operations/GetAccountingBillRequest.md new file mode 100644 index 00000000..a51c3a03 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillRequest.md @@ -0,0 +1,9 @@ +# GetAccountingBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `billId` | *String* | :heavy_check_mark: | Unique identifier for a bill. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingBillResponse.md b/lending/docs/models/operations/GetAccountingBillResponse.md new file mode 100644 index 00000000..c6b266bb --- /dev/null +++ b/lending/docs/models/operations/GetAccountingBillResponse.md @@ -0,0 +1,12 @@ +# GetAccountingBillResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBill` | [JsonNullable](../../models/shared/AccountingBill.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingCashFlowStatementRequest.md b/lending/docs/models/operations/GetAccountingCashFlowStatementRequest.md new file mode 100644 index 00000000..9c84d250 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCashFlowStatementRequest.md @@ -0,0 +1,11 @@ +# GetAccountingCashFlowStatementRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `periodLength` | *int* | :heavy_check_mark: | Number of months defining the period of interest. | 4 | +| `periodsToCompare` | *int* | :heavy_check_mark: | Number of periods with `periodLength` to compare. | 20 | +| `startMonth` | *Optional* | :heavy_minus_sign: | The month the report starts from. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingCashFlowStatementResponse.md b/lending/docs/models/operations/GetAccountingCashFlowStatementResponse.md new file mode 100644 index 00000000..0522c5e3 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCashFlowStatementResponse.md @@ -0,0 +1,12 @@ +# GetAccountingCashFlowStatementResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `accountingCashFlowStatement` | [Optional](../../models/shared/AccountingCashFlowStatement.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingCreditNoteRequest.md b/lending/docs/models/operations/GetAccountingCreditNoteRequest.md new file mode 100644 index 00000000..628dc02d --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCreditNoteRequest.md @@ -0,0 +1,9 @@ +# GetAccountingCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `creditNoteId` | *String* | :heavy_check_mark: | Unique identifier for a credit note. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingCreditNoteResponse.md b/lending/docs/models/operations/GetAccountingCreditNoteResponse.md new file mode 100644 index 00000000..aadecb8d --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCreditNoteResponse.md @@ -0,0 +1,12 @@ +# GetAccountingCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreditNote` | [JsonNullable](../../models/shared/AccountingCreditNote.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingCustomerAttachmentRequest.md b/lending/docs/models/operations/GetAccountingCustomerAttachmentRequest.md new file mode 100644 index 00000000..db14896a --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCustomerAttachmentRequest.md @@ -0,0 +1,11 @@ +# GetAccountingCustomerAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `customerId` | *String* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingCustomerAttachmentResponse.md b/lending/docs/models/operations/GetAccountingCustomerAttachmentResponse.md new file mode 100644 index 00000000..e4341b89 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCustomerAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingCustomerAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingCustomerRequest.md b/lending/docs/models/operations/GetAccountingCustomerRequest.md new file mode 100644 index 00000000..ce000069 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCustomerRequest.md @@ -0,0 +1,9 @@ +# GetAccountingCustomerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `customerId` | *String* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingCustomerResponse.md b/lending/docs/models/operations/GetAccountingCustomerResponse.md new file mode 100644 index 00000000..b087da64 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingCustomerResponse.md @@ -0,0 +1,12 @@ +# GetAccountingCustomerResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingCustomer` | [JsonNullable](../../models/shared/AccountingCustomer.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingDirectCostAttachmentRequest.md b/lending/docs/models/operations/GetAccountingDirectCostAttachmentRequest.md new file mode 100644 index 00000000..7993cd01 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectCostAttachmentRequest.md @@ -0,0 +1,11 @@ +# GetAccountingDirectCostAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `directCostId` | *String* | :heavy_check_mark: | Unique identifier for a direct cost. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingDirectCostAttachmentResponse.md b/lending/docs/models/operations/GetAccountingDirectCostAttachmentResponse.md new file mode 100644 index 00000000..fb81388e --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectCostAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingDirectCostAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingDirectCostRequest.md b/lending/docs/models/operations/GetAccountingDirectCostRequest.md new file mode 100644 index 00000000..730b3e03 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectCostRequest.md @@ -0,0 +1,10 @@ +# GetAccountingDirectCostRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `directCostId` | *String* | :heavy_check_mark: | Unique identifier for a direct cost. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingDirectCostResponse.md b/lending/docs/models/operations/GetAccountingDirectCostResponse.md new file mode 100644 index 00000000..4f9d5310 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectCostResponse.md @@ -0,0 +1,12 @@ +# GetAccountingDirectCostResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingDirectCost` | [JsonNullable](../../models/shared/AccountingDirectCost.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentRequest.md b/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentRequest.md new file mode 100644 index 00000000..a4a083ff --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentRequest.md @@ -0,0 +1,12 @@ +# GetAccountingDirectIncomeAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `directIncomeId` | *String* | :heavy_check_mark: | Unique identifier for a direct income. | | +| `timeoutInMinutes` | *Optional* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentResponse.md b/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentResponse.md new file mode 100644 index 00000000..bd4ecd43 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectIncomeAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingDirectIncomeAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingDirectIncomeRequest.md b/lending/docs/models/operations/GetAccountingDirectIncomeRequest.md new file mode 100644 index 00000000..48f7ec10 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectIncomeRequest.md @@ -0,0 +1,10 @@ +# GetAccountingDirectIncomeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `directIncomeId` | *String* | :heavy_check_mark: | Unique identifier for a direct income. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingDirectIncomeResponse.md b/lending/docs/models/operations/GetAccountingDirectIncomeResponse.md new file mode 100644 index 00000000..f3c6f903 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingDirectIncomeResponse.md @@ -0,0 +1,12 @@ +# GetAccountingDirectIncomeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `accountingDirectIncome` | [JsonNullable](../../models/shared/AccountingDirectIncome.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingInvoiceAttachmentRequest.md b/lending/docs/models/operations/GetAccountingInvoiceAttachmentRequest.md new file mode 100644 index 00000000..647c3d06 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingInvoiceAttachmentRequest.md @@ -0,0 +1,11 @@ +# GetAccountingInvoiceAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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 | +| `invoiceId` | *String* | :heavy_check_mark: | Unique identifier for an invoice. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingInvoiceAttachmentResponse.md b/lending/docs/models/operations/GetAccountingInvoiceAttachmentResponse.md new file mode 100644 index 00000000..032fe346 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingInvoiceAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingInvoiceAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingInvoiceRequest.md b/lending/docs/models/operations/GetAccountingInvoiceRequest.md new file mode 100644 index 00000000..79a86d61 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingInvoiceRequest.md @@ -0,0 +1,9 @@ +# GetAccountingInvoiceRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `invoiceId` | *String* | :heavy_check_mark: | Unique identifier for an invoice. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingInvoiceResponse.md b/lending/docs/models/operations/GetAccountingInvoiceResponse.md new file mode 100644 index 00000000..58b97aec --- /dev/null +++ b/lending/docs/models/operations/GetAccountingInvoiceResponse.md @@ -0,0 +1,12 @@ +# GetAccountingInvoiceResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingInvoice` | [JsonNullable](../../models/shared/AccountingInvoice.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingJournalEntryRequest.md b/lending/docs/models/operations/GetAccountingJournalEntryRequest.md new file mode 100644 index 00000000..1df332f1 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingJournalEntryRequest.md @@ -0,0 +1,9 @@ +# GetAccountingJournalEntryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `journalEntryId` | *String* | :heavy_check_mark: | Unique identifier for a journal entry. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingJournalEntryResponse.md b/lending/docs/models/operations/GetAccountingJournalEntryResponse.md new file mode 100644 index 00000000..781e4fe4 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingJournalEntryResponse.md @@ -0,0 +1,12 @@ +# GetAccountingJournalEntryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `accountingJournalEntry` | [JsonNullable](../../models/shared/AccountingJournalEntry.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingJournalRequest.md b/lending/docs/models/operations/GetAccountingJournalRequest.md new file mode 100644 index 00000000..3977db33 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingJournalRequest.md @@ -0,0 +1,9 @@ +# GetAccountingJournalRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `journalId` | *String* | :heavy_check_mark: | Unique identifier for a journal. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingJournalResponse.md b/lending/docs/models/operations/GetAccountingJournalResponse.md new file mode 100644 index 00000000..3fc2f76e --- /dev/null +++ b/lending/docs/models/operations/GetAccountingJournalResponse.md @@ -0,0 +1,12 @@ +# GetAccountingJournalResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingJournal` | [JsonNullable](../../models/shared/AccountingJournal.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingPaymentRequest.md b/lending/docs/models/operations/GetAccountingPaymentRequest.md new file mode 100644 index 00000000..697adfbf --- /dev/null +++ b/lending/docs/models/operations/GetAccountingPaymentRequest.md @@ -0,0 +1,9 @@ +# GetAccountingPaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `paymentId` | *String* | :heavy_check_mark: | Unique identifier for a payment. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingPaymentResponse.md b/lending/docs/models/operations/GetAccountingPaymentResponse.md new file mode 100644 index 00000000..1a11174b --- /dev/null +++ b/lending/docs/models/operations/GetAccountingPaymentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingPaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingPayment` | [JsonNullable](../../models/shared/AccountingPayment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingProfileRequest.md b/lending/docs/models/operations/GetAccountingProfileRequest.md new file mode 100644 index 00000000..94f6e130 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingProfileRequest.md @@ -0,0 +1,8 @@ +# GetAccountingProfileRequest + + +## 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/lending/docs/models/operations/GetAccountingProfileResponse.md b/lending/docs/models/operations/GetAccountingProfileResponse.md new file mode 100644 index 00000000..d196bafd --- /dev/null +++ b/lending/docs/models/operations/GetAccountingProfileResponse.md @@ -0,0 +1,12 @@ +# GetAccountingProfileResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingCompanyInfo` | [Optional](../../models/shared/AccountingCompanyInfo.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingProfitAndLossRequest.md b/lending/docs/models/operations/GetAccountingProfitAndLossRequest.md new file mode 100644 index 00000000..606f539b --- /dev/null +++ b/lending/docs/models/operations/GetAccountingProfitAndLossRequest.md @@ -0,0 +1,11 @@ +# GetAccountingProfitAndLossRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `periodLength` | *int* | :heavy_check_mark: | Number of months defining the period of interest. | 4 | +| `periodsToCompare` | *int* | :heavy_check_mark: | Number of periods with `periodLength` to compare. | 20 | +| `startMonth` | *Optional* | :heavy_minus_sign: | The month the report starts from. | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingProfitAndLossResponse.md b/lending/docs/models/operations/GetAccountingProfitAndLossResponse.md new file mode 100644 index 00000000..721eef66 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingProfitAndLossResponse.md @@ -0,0 +1,12 @@ +# GetAccountingProfitAndLossResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingProfitAndLossReport` | [Optional](../../models/shared/AccountingProfitAndLossReport.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingSupplierAttachmentRequest.md b/lending/docs/models/operations/GetAccountingSupplierAttachmentRequest.md new file mode 100644 index 00000000..8f366e7b --- /dev/null +++ b/lending/docs/models/operations/GetAccountingSupplierAttachmentRequest.md @@ -0,0 +1,11 @@ +# GetAccountingSupplierAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachmentId` | *String* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `supplierId` | *String* | :heavy_check_mark: | Unique identifier for a supplier. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingSupplierAttachmentResponse.md b/lending/docs/models/operations/GetAccountingSupplierAttachmentResponse.md new file mode 100644 index 00000000..9db50fcd --- /dev/null +++ b/lending/docs/models/operations/GetAccountingSupplierAttachmentResponse.md @@ -0,0 +1,12 @@ +# GetAccountingSupplierAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAttachment` | [JsonNullable](../../models/shared/AccountingAttachment.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingSupplierRequest.md b/lending/docs/models/operations/GetAccountingSupplierRequest.md new file mode 100644 index 00000000..067fe77d --- /dev/null +++ b/lending/docs/models/operations/GetAccountingSupplierRequest.md @@ -0,0 +1,9 @@ +# GetAccountingSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `supplierId` | *String* | :heavy_check_mark: | Unique identifier for a supplier. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingSupplierResponse.md b/lending/docs/models/operations/GetAccountingSupplierResponse.md new file mode 100644 index 00000000..74585c07 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingSupplierResponse.md @@ -0,0 +1,12 @@ +# GetAccountingSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingSupplier` | [JsonNullable](../../models/shared/AccountingSupplier.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetAccountingTransferRequest.md b/lending/docs/models/operations/GetAccountingTransferRequest.md new file mode 100644 index 00000000..a9120288 --- /dev/null +++ b/lending/docs/models/operations/GetAccountingTransferRequest.md @@ -0,0 +1,10 @@ +# GetAccountingTransferRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `transferId` | *String* | :heavy_check_mark: | Unique identifier for a transfer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetAccountingTransferResponse.md b/lending/docs/models/operations/GetAccountingTransferResponse.md new file mode 100644 index 00000000..3c66c11e --- /dev/null +++ b/lending/docs/models/operations/GetAccountingTransferResponse.md @@ -0,0 +1,12 @@ +# GetAccountingTransferResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingTransfer` | [JsonNullable](../../models/shared/AccountingTransfer.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetBankingAccountRequest.md b/lending/docs/models/operations/GetBankingAccountRequest.md new file mode 100644 index 00000000..0b53f2b2 --- /dev/null +++ b/lending/docs/models/operations/GetBankingAccountRequest.md @@ -0,0 +1,10 @@ +# GetBankingAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | | +| `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/lending/docs/models/operations/GetBankingAccountResponse.md b/lending/docs/models/operations/GetBankingAccountResponse.md new file mode 100644 index 00000000..466d780e --- /dev/null +++ b/lending/docs/models/operations/GetBankingAccountResponse.md @@ -0,0 +1,12 @@ +# GetBankingAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `bankingAccount` | [JsonNullable](../../models/shared/BankingAccount.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetBankingTransactionCategoryRequest.md b/lending/docs/models/operations/GetBankingTransactionCategoryRequest.md new file mode 100644 index 00000000..4069109e --- /dev/null +++ b/lending/docs/models/operations/GetBankingTransactionCategoryRequest.md @@ -0,0 +1,10 @@ +# GetBankingTransactionCategoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `transactionCategoryId` | *String* | :heavy_check_mark: | The unique identifier for a banking transaction category | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetBankingTransactionCategoryResponse.md b/lending/docs/models/operations/GetBankingTransactionCategoryResponse.md new file mode 100644 index 00000000..9836a7e7 --- /dev/null +++ b/lending/docs/models/operations/GetBankingTransactionCategoryResponse.md @@ -0,0 +1,12 @@ +# GetBankingTransactionCategoryResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `bankingTransactionCategory` | [JsonNullable](../../models/shared/BankingTransactionCategory.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetBankingTransactionRequest.md b/lending/docs/models/operations/GetBankingTransactionRequest.md new file mode 100644 index 00000000..f15f994d --- /dev/null +++ b/lending/docs/models/operations/GetBankingTransactionRequest.md @@ -0,0 +1,10 @@ +# GetBankingTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `transactionId` | *String* | :heavy_check_mark: | The unique identifier for a transaction | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetBankingTransactionResponse.md b/lending/docs/models/operations/GetBankingTransactionResponse.md new file mode 100644 index 00000000..138c675f --- /dev/null +++ b/lending/docs/models/operations/GetBankingTransactionResponse.md @@ -0,0 +1,12 @@ +# GetBankingTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `bankingTransaction` | [JsonNullable](../../models/shared/BankingTransaction.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCategorizedBalanceSheetStatementRequest.md b/lending/docs/models/operations/GetCategorizedBalanceSheetStatementRequest.md new file mode 100644 index 00000000..9441df84 --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedBalanceSheetStatementRequest.md @@ -0,0 +1,10 @@ +# GetCategorizedBalanceSheetStatementRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `numberOfPeriods` | *Optional* | :heavy_minus_sign: | The number of periods to return. If not provided, 12 periods will be used as the default value. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCategorizedBalanceSheetStatementResponse.md b/lending/docs/models/operations/GetCategorizedBalanceSheetStatementResponse.md new file mode 100644 index 00000000..4b00d336 --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedBalanceSheetStatementResponse.md @@ -0,0 +1,12 @@ +# GetCategorizedBalanceSheetStatementResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `enhancedFinancialReport` | [Optional](../../models/shared/EnhancedFinancialReport.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCategorizedBankStatementRequest.md b/lending/docs/models/operations/GetCategorizedBankStatementRequest.md new file mode 100644 index 00000000..97c89105 --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedBankStatementRequest.md @@ -0,0 +1,11 @@ +# GetCategorizedBankStatementRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCategorizedBankStatementResponse.md b/lending/docs/models/operations/GetCategorizedBankStatementResponse.md new file mode 100644 index 00000000..4076f029 --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedBankStatementResponse.md @@ -0,0 +1,12 @@ +# GetCategorizedBankStatementResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `enhancedCashFlowTransactions` | [Optional](../../models/shared/EnhancedCashFlowTransactions.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/GetCategorizedProfitAndLossStatementRequest.md b/lending/docs/models/operations/GetCategorizedProfitAndLossStatementRequest.md new file mode 100644 index 00000000..735dbd40 --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedProfitAndLossStatementRequest.md @@ -0,0 +1,10 @@ +# GetCategorizedProfitAndLossStatementRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `numberOfPeriods` | *Optional* | :heavy_minus_sign: | The number of periods to return. If not provided, 12 periods will be used as the default value. | | +| `reportDate` | *Optional* | :heavy_minus_sign: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCategorizedProfitAndLossStatementResponse.md b/lending/docs/models/operations/GetCategorizedProfitAndLossStatementResponse.md new file mode 100644 index 00000000..c80b9b6f --- /dev/null +++ b/lending/docs/models/operations/GetCategorizedProfitAndLossStatementResponse.md @@ -0,0 +1,12 @@ +# GetCategorizedProfitAndLossStatementResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `enhancedFinancialReport` | [Optional](../../models/shared/EnhancedFinancialReport.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommerceCustomerRequest.md b/lending/docs/models/operations/GetCommerceCustomerRequest.md new file mode 100644 index 00000000..a56da0f8 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceCustomerRequest.md @@ -0,0 +1,10 @@ +# GetCommerceCustomerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `customerId` | *String* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceCustomerResponse.md b/lending/docs/models/operations/GetCommerceCustomerResponse.md new file mode 100644 index 00000000..4d673848 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceCustomerResponse.md @@ -0,0 +1,12 @@ +# GetCommerceCustomerResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceCustomer` | [JsonNullable](../../models/shared/CommerceCustomer.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsRequest.md b/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsRequest.md new file mode 100644 index 00000000..de17b68a --- /dev/null +++ b/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsRequest.md @@ -0,0 +1,14 @@ +# GetCommerceCustomerRetentionMetricsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `includeDisplayNames` | *Optional* | :heavy_minus_sign: | Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. | | +| `numberOfPeriods` | *long* | :heavy_check_mark: | The number of periods to return. There will be no pagination as a query parameter. | | +| `periodLength` | *long* | :heavy_check_mark: | The number of months per period. E.g. 2 = 2 months per period. | | +| `periodUnit` | [io.codat.lending.models.shared.PeriodUnit](../../models/shared/PeriodUnit.md) | :heavy_check_mark: | The period unit of time returned. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsResponse.md b/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsResponse.md new file mode 100644 index 00000000..b4c6eb95 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceCustomerRetentionMetricsResponse.md @@ -0,0 +1,12 @@ +# GetCommerceCustomerRetentionMetricsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceReport` | [Optional](../../models/shared/CommerceReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommerceDisputeRequest.md b/lending/docs/models/operations/GetCommerceDisputeRequest.md new file mode 100644 index 00000000..338a3ccc --- /dev/null +++ b/lending/docs/models/operations/GetCommerceDisputeRequest.md @@ -0,0 +1,10 @@ +# GetCommerceDisputeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `disputeId` | *String* | :heavy_check_mark: | Unique identifier for a dispute. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceDisputeResponse.md b/lending/docs/models/operations/GetCommerceDisputeResponse.md new file mode 100644 index 00000000..2410861d --- /dev/null +++ b/lending/docs/models/operations/GetCommerceDisputeResponse.md @@ -0,0 +1,12 @@ +# GetCommerceDisputeResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceDispute` | [JsonNullable](../../models/shared/CommerceDispute.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceLifetimeValueMetricsRequest.md b/lending/docs/models/operations/GetCommerceLifetimeValueMetricsRequest.md new file mode 100644 index 00000000..b06ae712 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceLifetimeValueMetricsRequest.md @@ -0,0 +1,14 @@ +# GetCommerceLifetimeValueMetricsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `includeDisplayNames` | *Optional* | :heavy_minus_sign: | Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. | | +| `numberOfPeriods` | *long* | :heavy_check_mark: | The number of periods to return. There will be no pagination as a query parameter. | | +| `periodLength` | *long* | :heavy_check_mark: | The number of months per period. E.g. 2 = 2 months per period. | | +| `periodUnit` | [io.codat.lending.models.shared.PeriodUnit](../../models/shared/PeriodUnit.md) | :heavy_check_mark: | The period unit of time returned. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceLifetimeValueMetricsResponse.md b/lending/docs/models/operations/GetCommerceLifetimeValueMetricsResponse.md new file mode 100644 index 00000000..93e58501 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceLifetimeValueMetricsResponse.md @@ -0,0 +1,12 @@ +# GetCommerceLifetimeValueMetricsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceReport` | [Optional](../../models/shared/CommerceReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommerceLocationRequest.md b/lending/docs/models/operations/GetCommerceLocationRequest.md new file mode 100644 index 00000000..226d7be2 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceLocationRequest.md @@ -0,0 +1,10 @@ +# GetCommerceLocationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `locationId` | *String* | :heavy_check_mark: | Unique identifier for a location. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceLocationResponse.md b/lending/docs/models/operations/GetCommerceLocationResponse.md new file mode 100644 index 00000000..3e2764a5 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceLocationResponse.md @@ -0,0 +1,12 @@ +# GetCommerceLocationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceLocation` | [JsonNullable](../../models/shared/CommerceLocation.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceOrderRequest.md b/lending/docs/models/operations/GetCommerceOrderRequest.md new file mode 100644 index 00000000..542ab788 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceOrderRequest.md @@ -0,0 +1,10 @@ +# GetCommerceOrderRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderId` | *String* | :heavy_check_mark: | Unique identifier for an order. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceOrderResponse.md b/lending/docs/models/operations/GetCommerceOrderResponse.md new file mode 100644 index 00000000..32847988 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceOrderResponse.md @@ -0,0 +1,12 @@ +# GetCommerceOrderResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceOrder` | [JsonNullable](../../models/shared/CommerceOrder.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceOrdersReportRequest.md b/lending/docs/models/operations/GetCommerceOrdersReportRequest.md new file mode 100644 index 00000000..3345d012 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceOrdersReportRequest.md @@ -0,0 +1,14 @@ +# GetCommerceOrdersReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `includeDisplayNames` | *Optional* | :heavy_minus_sign: | Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. | | +| `numberOfPeriods` | *long* | :heavy_check_mark: | The number of periods to return. There will be no pagination as a query parameter. | | +| `periodLength` | *long* | :heavy_check_mark: | The number of months per period. E.g. 2 = 2 months per period. | | +| `periodUnit` | [io.codat.lending.models.shared.PeriodUnit](../../models/shared/PeriodUnit.md) | :heavy_check_mark: | The period unit of time returned. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceOrdersReportResponse.md b/lending/docs/models/operations/GetCommerceOrdersReportResponse.md new file mode 100644 index 00000000..30df3977 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceOrdersReportResponse.md @@ -0,0 +1,12 @@ +# GetCommerceOrdersReportResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceReport` | [Optional](../../models/shared/CommerceReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommercePaymentMethodRequest.md b/lending/docs/models/operations/GetCommercePaymentMethodRequest.md new file mode 100644 index 00000000..283d9636 --- /dev/null +++ b/lending/docs/models/operations/GetCommercePaymentMethodRequest.md @@ -0,0 +1,10 @@ +# GetCommercePaymentMethodRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `paymentMethodId` | *String* | :heavy_check_mark: | Unique identifier for a payment method. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommercePaymentMethodResponse.md b/lending/docs/models/operations/GetCommercePaymentMethodResponse.md new file mode 100644 index 00000000..501df800 --- /dev/null +++ b/lending/docs/models/operations/GetCommercePaymentMethodResponse.md @@ -0,0 +1,12 @@ +# GetCommercePaymentMethodResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commercePaymentMethod` | [JsonNullable](../../models/shared/CommercePaymentMethod.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommercePaymentRequest.md b/lending/docs/models/operations/GetCommercePaymentRequest.md new file mode 100644 index 00000000..0dea32ff --- /dev/null +++ b/lending/docs/models/operations/GetCommercePaymentRequest.md @@ -0,0 +1,10 @@ +# GetCommercePaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `paymentId` | *String* | :heavy_check_mark: | Unique identifier for a payment. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommercePaymentResponse.md b/lending/docs/models/operations/GetCommercePaymentResponse.md new file mode 100644 index 00000000..f219979f --- /dev/null +++ b/lending/docs/models/operations/GetCommercePaymentResponse.md @@ -0,0 +1,12 @@ +# GetCommercePaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commercePayment` | [JsonNullable](../../models/shared/CommercePayment.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceProductCategoryRequest.md b/lending/docs/models/operations/GetCommerceProductCategoryRequest.md new file mode 100644 index 00000000..c172c01b --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProductCategoryRequest.md @@ -0,0 +1,10 @@ +# GetCommerceProductCategoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `productId` | *String* | :heavy_check_mark: | Unique identifier for a product. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceProductCategoryResponse.md b/lending/docs/models/operations/GetCommerceProductCategoryResponse.md new file mode 100644 index 00000000..c1fb31a1 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProductCategoryResponse.md @@ -0,0 +1,12 @@ +# GetCommerceProductCategoryResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `commerceProductCategory` | [JsonNullable](../../models/shared/CommerceProductCategory.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceProductRequest.md b/lending/docs/models/operations/GetCommerceProductRequest.md new file mode 100644 index 00000000..0ab4efc8 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProductRequest.md @@ -0,0 +1,10 @@ +# GetCommerceProductRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `productId` | *String* | :heavy_check_mark: | Unique identifier for a product. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceProductResponse.md b/lending/docs/models/operations/GetCommerceProductResponse.md new file mode 100644 index 00000000..6b6f78fe --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProductResponse.md @@ -0,0 +1,12 @@ +# GetCommerceProductResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceProduct` | [Optional](../../models/shared/CommerceProduct.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceProfileRequest.md b/lending/docs/models/operations/GetCommerceProfileRequest.md new file mode 100644 index 00000000..b6c9cfd9 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProfileRequest.md @@ -0,0 +1,9 @@ +# GetCommerceProfileRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceProfileResponse.md b/lending/docs/models/operations/GetCommerceProfileResponse.md new file mode 100644 index 00000000..9fbcee67 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceProfileResponse.md @@ -0,0 +1,12 @@ +# GetCommerceProfileResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceCompanyInfo` | [JsonNullable](../../models/shared/CommerceCompanyInfo.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCommerceRefundsReportRequest.md b/lending/docs/models/operations/GetCommerceRefundsReportRequest.md new file mode 100644 index 00000000..68bf98b2 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceRefundsReportRequest.md @@ -0,0 +1,14 @@ +# GetCommerceRefundsReportRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `includeDisplayNames` | *Optional* | :heavy_minus_sign: | Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. | | +| `numberOfPeriods` | *long* | :heavy_check_mark: | The number of periods to return. There will be no pagination as a query parameter. | | +| `periodLength` | *long* | :heavy_check_mark: | The number of months per period. E.g. 2 = 2 months per period. | | +| `periodUnit` | [io.codat.lending.models.shared.PeriodUnit](../../models/shared/PeriodUnit.md) | :heavy_check_mark: | The period unit of time returned. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceRefundsReportResponse.md b/lending/docs/models/operations/GetCommerceRefundsReportResponse.md new file mode 100644 index 00000000..1e408294 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceRefundsReportResponse.md @@ -0,0 +1,12 @@ +# GetCommerceRefundsReportResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceReport` | [Optional](../../models/shared/CommerceReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommerceRevenueMetricsRequest.md b/lending/docs/models/operations/GetCommerceRevenueMetricsRequest.md new file mode 100644 index 00000000..9d31e554 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceRevenueMetricsRequest.md @@ -0,0 +1,14 @@ +# GetCommerceRevenueMetricsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `includeDisplayNames` | *Optional* | :heavy_minus_sign: | Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. | | +| `numberOfPeriods` | *long* | :heavy_check_mark: | The number of periods to return. There will be no pagination as a query parameter. | | +| `periodLength` | *long* | :heavy_check_mark: | The number of months per period. E.g. 2 = 2 months per period. | | +| `periodUnit` | [io.codat.lending.models.shared.PeriodUnit](../../models/shared/PeriodUnit.md) | :heavy_check_mark: | The period unit of time returned. | | +| `reportDate` | *String* | :heavy_check_mark: | The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. | 29-09-2020 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceRevenueMetricsResponse.md b/lending/docs/models/operations/GetCommerceRevenueMetricsResponse.md new file mode 100644 index 00000000..eca04d40 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceRevenueMetricsResponse.md @@ -0,0 +1,12 @@ +# GetCommerceRevenueMetricsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceReport` | [Optional](../../models/shared/CommerceReport.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/operations/GetCommerceTransactionRequest.md b/lending/docs/models/operations/GetCommerceTransactionRequest.md new file mode 100644 index 00000000..29203e3f --- /dev/null +++ b/lending/docs/models/operations/GetCommerceTransactionRequest.md @@ -0,0 +1,10 @@ +# GetCommerceTransactionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `transactionId` | *String* | :heavy_check_mark: | Unique identifier for a transaction. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCommerceTransactionResponse.md b/lending/docs/models/operations/GetCommerceTransactionResponse.md new file mode 100644 index 00000000..9e492348 --- /dev/null +++ b/lending/docs/models/operations/GetCommerceTransactionResponse.md @@ -0,0 +1,12 @@ +# GetCommerceTransactionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceTransaction` | [JsonNullable](../../models/shared/CommerceTransaction.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCompanyRequest.md b/lending/docs/models/operations/GetCompanyRequest.md new file mode 100644 index 00000000..8b48e5af --- /dev/null +++ b/lending/docs/models/operations/GetCompanyRequest.md @@ -0,0 +1,8 @@ +# GetCompanyRequest + + +## 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/lending/docs/models/operations/GetCompanyResponse.md b/lending/docs/models/operations/GetCompanyResponse.md new file mode 100644 index 00000000..7da7c49a --- /dev/null +++ b/lending/docs/models/operations/GetCompanyResponse.md @@ -0,0 +1,12 @@ +# GetCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `company` | [Optional](../../models/shared/Company.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetConnectionRequest.md b/lending/docs/models/operations/GetConnectionRequest.md new file mode 100644 index 00000000..043507b4 --- /dev/null +++ b/lending/docs/models/operations/GetConnectionRequest.md @@ -0,0 +1,9 @@ +# GetConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetConnectionResponse.md b/lending/docs/models/operations/GetConnectionResponse.md new file mode 100644 index 00000000..0fe09069 --- /dev/null +++ b/lending/docs/models/operations/GetConnectionResponse.md @@ -0,0 +1,12 @@ +# GetConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `connection` | [Optional](../../models/shared/Connection.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetCreateBankTransactionsModelRequest.md b/lending/docs/models/operations/GetCreateBankTransactionsModelRequest.md new file mode 100644 index 00000000..67070e4c --- /dev/null +++ b/lending/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. | | +| `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/lending/docs/models/operations/GetCreateBankTransactionsModelResponse.md b/lending/docs/models/operations/GetCreateBankTransactionsModelResponse.md new file mode 100644 index 00000000..c8032b9d --- /dev/null +++ b/lending/docs/models/operations/GetCreateBankTransactionsModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateBankTransactionsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/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/lending/docs/models/operations/GetCreateChartOfAccountsModelRequest.md b/lending/docs/models/operations/GetCreateChartOfAccountsModelRequest.md new file mode 100644 index 00000000..8b9f7b4f --- /dev/null +++ b/lending/docs/models/operations/GetCreateChartOfAccountsModelRequest.md @@ -0,0 +1,9 @@ +# GetCreateChartOfAccountsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateChartOfAccountsModelResponse.md b/lending/docs/models/operations/GetCreateChartOfAccountsModelResponse.md new file mode 100644 index 00000000..dd659b4f --- /dev/null +++ b/lending/docs/models/operations/GetCreateChartOfAccountsModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateChartOfAccountsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreateDirectCostsModelRequest.md b/lending/docs/models/operations/GetCreateDirectCostsModelRequest.md new file mode 100644 index 00000000..aafb1a64 --- /dev/null +++ b/lending/docs/models/operations/GetCreateDirectCostsModelRequest.md @@ -0,0 +1,9 @@ +# GetCreateDirectCostsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateDirectCostsModelResponse.md b/lending/docs/models/operations/GetCreateDirectCostsModelResponse.md new file mode 100644 index 00000000..252d1fb4 --- /dev/null +++ b/lending/docs/models/operations/GetCreateDirectCostsModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateDirectCostsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreateOperationRequest.md b/lending/docs/models/operations/GetCreateOperationRequest.md new file mode 100644 index 00000000..15f5c584 --- /dev/null +++ b/lending/docs/models/operations/GetCreateOperationRequest.md @@ -0,0 +1,9 @@ +# GetCreateOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `pushOperationKey` | *String* | :heavy_check_mark: | Unique identifier for the push operation. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateOperationResponse.md b/lending/docs/models/operations/GetCreateOperationResponse.md new file mode 100644 index 00000000..7df7b387 --- /dev/null +++ b/lending/docs/models/operations/GetCreateOperationResponse.md @@ -0,0 +1,12 @@ +# GetCreateOperationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOperation` | [Optional](../../models/shared/PushOperation.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreatePaymentModelRequest.md b/lending/docs/models/operations/GetCreatePaymentModelRequest.md new file mode 100644 index 00000000..39d0b2b3 --- /dev/null +++ b/lending/docs/models/operations/GetCreatePaymentModelRequest.md @@ -0,0 +1,9 @@ +# GetCreatePaymentModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreatePaymentModelResponse.md b/lending/docs/models/operations/GetCreatePaymentModelResponse.md new file mode 100644 index 00000000..ba32c3b7 --- /dev/null +++ b/lending/docs/models/operations/GetCreatePaymentModelResponse.md @@ -0,0 +1,12 @@ +# GetCreatePaymentModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreateTransfersModelRequest.md b/lending/docs/models/operations/GetCreateTransfersModelRequest.md new file mode 100644 index 00000000..7992ed62 --- /dev/null +++ b/lending/docs/models/operations/GetCreateTransfersModelRequest.md @@ -0,0 +1,9 @@ +# GetCreateTransfersModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateTransfersModelResponse.md b/lending/docs/models/operations/GetCreateTransfersModelResponse.md new file mode 100644 index 00000000..5d392dae --- /dev/null +++ b/lending/docs/models/operations/GetCreateTransfersModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateTransfersModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreateUpdateBankAccountsModelRequest.md b/lending/docs/models/operations/GetCreateUpdateBankAccountsModelRequest.md new file mode 100644 index 00000000..db24024d --- /dev/null +++ b/lending/docs/models/operations/GetCreateUpdateBankAccountsModelRequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateBankAccountsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateUpdateBankAccountsModelResponse.md b/lending/docs/models/operations/GetCreateUpdateBankAccountsModelResponse.md new file mode 100644 index 00000000..546717ce --- /dev/null +++ b/lending/docs/models/operations/GetCreateUpdateBankAccountsModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateBankAccountsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetCreateUpdateSuppliersModelRequest.md b/lending/docs/models/operations/GetCreateUpdateSuppliersModelRequest.md new file mode 100644 index 00000000..6ebfc2c5 --- /dev/null +++ b/lending/docs/models/operations/GetCreateUpdateSuppliersModelRequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateSuppliersModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/GetCreateUpdateSuppliersModelResponse.md b/lending/docs/models/operations/GetCreateUpdateSuppliersModelResponse.md new file mode 100644 index 00000000..146b2df4 --- /dev/null +++ b/lending/docs/models/operations/GetCreateUpdateSuppliersModelResponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateSuppliersModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pushOption` | [Optional](../../models/shared/PushOption.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetDataIntegrityStatusRequest.md b/lending/docs/models/operations/GetDataIntegrityStatusRequest.md new file mode 100644 index 00000000..a00603ab --- /dev/null +++ b/lending/docs/models/operations/GetDataIntegrityStatusRequest.md @@ -0,0 +1,9 @@ +# GetDataIntegrityStatusRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataType` | [io.codat.lending.models.shared.DataIntegrityDataType](../../models/shared/DataIntegrityDataType.md) | :heavy_check_mark: | A key for a Codat data type. | banking-accounts | \ No newline at end of file diff --git a/lending/docs/models/operations/GetDataIntegrityStatusResponse.md b/lending/docs/models/operations/GetDataIntegrityStatusResponse.md new file mode 100644 index 00000000..09f5a9de --- /dev/null +++ b/lending/docs/models/operations/GetDataIntegrityStatusResponse.md @@ -0,0 +1,12 @@ +# GetDataIntegrityStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `dataIntegrityStatuses` | [Optional](../../models/shared/DataIntegrityStatuses.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetDataIntegritySummariesRequest.md b/lending/docs/models/operations/GetDataIntegritySummariesRequest.md new file mode 100644 index 00000000..0542c62b --- /dev/null +++ b/lending/docs/models/operations/GetDataIntegritySummariesRequest.md @@ -0,0 +1,10 @@ +# GetDataIntegritySummariesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataType` | [io.codat.lending.models.shared.DataIntegrityDataType](../../models/shared/DataIntegrityDataType.md) | :heavy_check_mark: | A key for a Codat data type. | banking-accounts | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetDataIntegritySummariesResponse.md b/lending/docs/models/operations/GetDataIntegritySummariesResponse.md new file mode 100644 index 00000000..ee9ba7e4 --- /dev/null +++ b/lending/docs/models/operations/GetDataIntegritySummariesResponse.md @@ -0,0 +1,12 @@ +# GetDataIntegritySummariesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `dataIntegritySummaries` | [Optional](../../models/shared/DataIntegritySummaries.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/GetDataStatusRequest.md b/lending/docs/models/operations/GetDataStatusRequest.md new file mode 100644 index 00000000..572f1623 --- /dev/null +++ b/lending/docs/models/operations/GetDataStatusRequest.md @@ -0,0 +1,8 @@ +# GetDataStatusRequest + + +## 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/lending/docs/models/operations/GetDataStatusResponse.md b/lending/docs/models/operations/GetDataStatusResponse.md new file mode 100644 index 00000000..c09c7a50 --- /dev/null +++ b/lending/docs/models/operations/GetDataStatusResponse.md @@ -0,0 +1,12 @@ +# GetDataStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `dataStatuses` | Map | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/GetExcelReportGenerationStatusRequest.md b/lending/docs/models/operations/GetExcelReportGenerationStatusRequest.md new file mode 100644 index 00000000..4771ba98 --- /dev/null +++ b/lending/docs/models/operations/GetExcelReportGenerationStatusRequest.md @@ -0,0 +1,9 @@ +# GetExcelReportGenerationStatusRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `reportType` | [io.codat.lending.models.shared.ExcelReportTypes](../../models/shared/ExcelReportTypes.md) | :heavy_check_mark: | The type of report you want to generate and download. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetExcelReportGenerationStatusResponse.md b/lending/docs/models/operations/GetExcelReportGenerationStatusResponse.md new file mode 100644 index 00000000..64c6d347 --- /dev/null +++ b/lending/docs/models/operations/GetExcelReportGenerationStatusResponse.md @@ -0,0 +1,12 @@ +# GetExcelReportGenerationStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `excelStatus` | [Optional](../../models/shared/ExcelStatus.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetLoanSummaryQueryParamSourceType.md b/lending/docs/models/operations/GetLoanSummaryQueryParamSourceType.md new file mode 100644 index 00000000..812ff102 --- /dev/null +++ b/lending/docs/models/operations/GetLoanSummaryQueryParamSourceType.md @@ -0,0 +1,12 @@ +# GetLoanSummaryQueryParamSourceType + +Data source type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `BANKING` | banking | +| `COMMERCE` | commerce | +| `ACCOUNTING` | accounting | \ No newline at end of file diff --git a/lending/docs/models/operations/GetLoanSummaryRequest.md b/lending/docs/models/operations/GetLoanSummaryRequest.md new file mode 100644 index 00000000..bf0eeaef --- /dev/null +++ b/lending/docs/models/operations/GetLoanSummaryRequest.md @@ -0,0 +1,9 @@ +# GetLoanSummaryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `sourceType` | [io.codat.lending.models.operations.GetLoanSummaryQueryParamSourceType](../../models/operations/GetLoanSummaryQueryParamSourceType.md) | :heavy_check_mark: | Data source type. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetLoanSummaryResponse.md b/lending/docs/models/operations/GetLoanSummaryResponse.md new file mode 100644 index 00000000..170dc5fe --- /dev/null +++ b/lending/docs/models/operations/GetLoanSummaryResponse.md @@ -0,0 +1,12 @@ +# GetLoanSummaryResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `loanSummary` | [Optional](../../models/shared/LoanSummary.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/GetPullOperationRequest.md b/lending/docs/models/operations/GetPullOperationRequest.md new file mode 100644 index 00000000..0fa4f298 --- /dev/null +++ b/lending/docs/models/operations/GetPullOperationRequest.md @@ -0,0 +1,9 @@ +# GetPullOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `datasetId` | *String* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/lending/docs/models/operations/GetPullOperationResponse.md b/lending/docs/models/operations/GetPullOperationResponse.md new file mode 100644 index 00000000..fd2799b5 --- /dev/null +++ b/lending/docs/models/operations/GetPullOperationResponse.md @@ -0,0 +1,12 @@ +# GetPullOperationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pullOperation` | [Optional](../../models/shared/PullOperation.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/IsAgedCreditorsReportAvailableRequest.md b/lending/docs/models/operations/IsAgedCreditorsReportAvailableRequest.md new file mode 100644 index 00000000..7ec52f6d --- /dev/null +++ b/lending/docs/models/operations/IsAgedCreditorsReportAvailableRequest.md @@ -0,0 +1,8 @@ +# IsAgedCreditorsReportAvailableRequest + + +## 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/lending/docs/models/operations/IsAgedCreditorsReportAvailableResponse.md b/lending/docs/models/operations/IsAgedCreditorsReportAvailableResponse.md new file mode 100644 index 00000000..13de9bb7 --- /dev/null +++ b/lending/docs/models/operations/IsAgedCreditorsReportAvailableResponse.md @@ -0,0 +1,12 @@ +# IsAgedCreditorsReportAvailableResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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 | +| `boolean_` | *Optional* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/lending/docs/models/operations/IsAgedDebtorsReportAvailableRequest.md b/lending/docs/models/operations/IsAgedDebtorsReportAvailableRequest.md new file mode 100644 index 00000000..d5079733 --- /dev/null +++ b/lending/docs/models/operations/IsAgedDebtorsReportAvailableRequest.md @@ -0,0 +1,8 @@ +# IsAgedDebtorsReportAvailableRequest + + +## 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/lending/docs/models/operations/IsAgedDebtorsReportAvailableResponse.md b/lending/docs/models/operations/IsAgedDebtorsReportAvailableResponse.md new file mode 100644 index 00000000..21d4cc81 --- /dev/null +++ b/lending/docs/models/operations/IsAgedDebtorsReportAvailableResponse.md @@ -0,0 +1,12 @@ +# IsAgedDebtorsReportAvailableResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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 | +| `boolean_` | *Optional* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingAccountTransactionsRequest.md b/lending/docs/models/operations/ListAccountingAccountTransactionsRequest.md new file mode 100644 index 00000000..62da136d --- /dev/null +++ b/lending/docs/models/operations/ListAccountingAccountTransactionsRequest.md @@ -0,0 +1,13 @@ +# ListAccountingAccountTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingAccountTransactionsResponse.md b/lending/docs/models/operations/ListAccountingAccountTransactionsResponse.md new file mode 100644 index 00000000..c3c5bb1b --- /dev/null +++ b/lending/docs/models/operations/ListAccountingAccountTransactionsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingAccountTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingAccountTransactions` | [Optional](../../models/shared/AccountingAccountTransactions.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingAccountsRequest.md b/lending/docs/models/operations/ListAccountingAccountsRequest.md new file mode 100644 index 00000000..47222ce0 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingAccountsRequest.md @@ -0,0 +1,12 @@ +# ListAccountingAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingAccountsResponse.md b/lending/docs/models/operations/ListAccountingAccountsResponse.md new file mode 100644 index 00000000..86c3b430 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingAccountsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingAccounts` | [Optional](../../models/shared/AccountingAccounts.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingBankAccountTransactionsRequest.md b/lending/docs/models/operations/ListAccountingBankAccountTransactionsRequest.md new file mode 100644 index 00000000..3022c055 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBankAccountTransactionsRequest.md @@ -0,0 +1,14 @@ +# ListAccountingBankAccountTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `accountId` | *String* | :heavy_check_mark: | Unique identifier for an account. | | +| `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 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingBankAccountTransactionsResponse.md b/lending/docs/models/operations/ListAccountingBankAccountTransactionsResponse.md new file mode 100644 index 00000000..2af17e03 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBankAccountTransactionsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBankAccountTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `accountingBankTransactions` | [Optional](../../models/shared/AccountingBankTransactions.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingBankAccountsRequest.md b/lending/docs/models/operations/ListAccountingBankAccountsRequest.md new file mode 100644 index 00000000..14b6d3fb --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBankAccountsRequest.md @@ -0,0 +1,13 @@ +# ListAccountingBankAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingBankAccountsResponse.md b/lending/docs/models/operations/ListAccountingBankAccountsResponse.md new file mode 100644 index 00000000..c87cdf60 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBankAccountsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBankAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBankAccounts` | [Optional](../../models/shared/AccountingBankAccounts.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingBillAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingBillAttachmentsRequest.md new file mode 100644 index 00000000..7097ec7f --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingBillAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `billId` | *String* | :heavy_check_mark: | Unique identifier for a bill. | | +| `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/lending/docs/models/operations/ListAccountingBillAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingBillAttachmentsResponse.md new file mode 100644 index 00000000..03d66840 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBillAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingBillCreditNotesRequest.md b/lending/docs/models/operations/ListAccountingBillCreditNotesRequest.md new file mode 100644 index 00000000..8a47fc83 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillCreditNotesRequest.md @@ -0,0 +1,12 @@ +# ListAccountingBillCreditNotesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingBillCreditNotesResponse.md b/lending/docs/models/operations/ListAccountingBillCreditNotesResponse.md new file mode 100644 index 00000000..176c3518 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillCreditNotesResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBillCreditNotesResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `accountingBillCreditNotes` | [Optional](../../models/shared/AccountingBillCreditNotes.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingBillPaymentsRequest.md b/lending/docs/models/operations/ListAccountingBillPaymentsRequest.md new file mode 100644 index 00000000..8dbf850d --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillPaymentsRequest.md @@ -0,0 +1,12 @@ +# ListAccountingBillPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingBillPaymentsResponse.md b/lending/docs/models/operations/ListAccountingBillPaymentsResponse.md new file mode 100644 index 00000000..3a5259e5 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillPaymentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBillPaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBillPayments` | [Optional](../../models/shared/AccountingBillPayments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingBillsRequest.md b/lending/docs/models/operations/ListAccountingBillsRequest.md new file mode 100644 index 00000000..feb2300e --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillsRequest.md @@ -0,0 +1,12 @@ +# ListAccountingBillsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingBillsResponse.md b/lending/docs/models/operations/ListAccountingBillsResponse.md new file mode 100644 index 00000000..7524553e --- /dev/null +++ b/lending/docs/models/operations/ListAccountingBillsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingBillsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingBills` | [Optional](../../models/shared/AccountingBills.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingCreditNotesRequest.md b/lending/docs/models/operations/ListAccountingCreditNotesRequest.md new file mode 100644 index 00000000..a8bcdcf2 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCreditNotesRequest.md @@ -0,0 +1,12 @@ +# ListAccountingCreditNotesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingCreditNotesResponse.md b/lending/docs/models/operations/ListAccountingCreditNotesResponse.md new file mode 100644 index 00000000..9d33b32a --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCreditNotesResponse.md @@ -0,0 +1,12 @@ +# ListAccountingCreditNotesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingCreditNotes` | [Optional](../../models/shared/AccountingCreditNotes.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingCustomerAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingCustomerAttachmentsRequest.md new file mode 100644 index 00000000..b15fec7c --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCustomerAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingCustomerAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `customerId` | *String* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingCustomerAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingCustomerAttachmentsResponse.md new file mode 100644 index 00000000..69ad83a3 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCustomerAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingCustomerAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingCustomersRequest.md b/lending/docs/models/operations/ListAccountingCustomersRequest.md new file mode 100644 index 00000000..0624fe91 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCustomersRequest.md @@ -0,0 +1,12 @@ +# ListAccountingCustomersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingCustomersResponse.md b/lending/docs/models/operations/ListAccountingCustomersResponse.md new file mode 100644 index 00000000..bbb4b4f2 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingCustomersResponse.md @@ -0,0 +1,12 @@ +# ListAccountingCustomersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingCustomers` | [Optional](../../models/shared/AccountingCustomers.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingDirectCostAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingDirectCostAttachmentsRequest.md new file mode 100644 index 00000000..f298d2c5 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectCostAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingDirectCostAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `directCostId` | *String* | :heavy_check_mark: | Unique identifier for a direct cost. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingDirectCostAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingDirectCostAttachmentsResponse.md new file mode 100644 index 00000000..f2ada4ef --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectCostAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingDirectCostAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingDirectCostsRequest.md b/lending/docs/models/operations/ListAccountingDirectCostsRequest.md new file mode 100644 index 00000000..81bade67 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectCostsRequest.md @@ -0,0 +1,13 @@ +# ListAccountingDirectCostsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingDirectCostsResponse.md b/lending/docs/models/operations/ListAccountingDirectCostsResponse.md new file mode 100644 index 00000000..035ab540 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectCostsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingDirectCostsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingDirectCosts` | [Optional](../../models/shared/AccountingDirectCosts.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsRequest.md new file mode 100644 index 00000000..b50b3e40 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingDirectIncomeAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `directIncomeId` | *String* | :heavy_check_mark: | Unique identifier for a direct income. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsResponse.md new file mode 100644 index 00000000..16e5d674 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectIncomeAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingDirectIncomeAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingDirectIncomesRequest.md b/lending/docs/models/operations/ListAccountingDirectIncomesRequest.md new file mode 100644 index 00000000..c351ecb9 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectIncomesRequest.md @@ -0,0 +1,13 @@ +# ListAccountingDirectIncomesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingDirectIncomesResponse.md b/lending/docs/models/operations/ListAccountingDirectIncomesResponse.md new file mode 100644 index 00000000..0de76ff0 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingDirectIncomesResponse.md @@ -0,0 +1,12 @@ +# ListAccountingDirectIncomesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingDirectIncomes` | [Optional](../../models/shared/AccountingDirectIncomes.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingInvoiceAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingInvoiceAttachmentsRequest.md new file mode 100644 index 00000000..6622a88c --- /dev/null +++ b/lending/docs/models/operations/ListAccountingInvoiceAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingInvoiceAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `invoiceId` | *String* | :heavy_check_mark: | Unique identifier for an invoice. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingInvoiceAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingInvoiceAttachmentsResponse.md new file mode 100644 index 00000000..b1326375 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingInvoiceAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingInvoiceAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingInvoicesRequest.md b/lending/docs/models/operations/ListAccountingInvoicesRequest.md new file mode 100644 index 00000000..afad1fed --- /dev/null +++ b/lending/docs/models/operations/ListAccountingInvoicesRequest.md @@ -0,0 +1,12 @@ +# ListAccountingInvoicesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingInvoicesResponse.md b/lending/docs/models/operations/ListAccountingInvoicesResponse.md new file mode 100644 index 00000000..73f0ad01 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingInvoicesResponse.md @@ -0,0 +1,12 @@ +# ListAccountingInvoicesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingInvoices` | [Optional](../../models/shared/AccountingInvoices.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingJournalEntriesRequest.md b/lending/docs/models/operations/ListAccountingJournalEntriesRequest.md new file mode 100644 index 00000000..92f31c7f --- /dev/null +++ b/lending/docs/models/operations/ListAccountingJournalEntriesRequest.md @@ -0,0 +1,12 @@ +# ListAccountingJournalEntriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingJournalEntriesResponse.md b/lending/docs/models/operations/ListAccountingJournalEntriesResponse.md new file mode 100644 index 00000000..4d66e32d --- /dev/null +++ b/lending/docs/models/operations/ListAccountingJournalEntriesResponse.md @@ -0,0 +1,12 @@ +# ListAccountingJournalEntriesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `accountingJournalEntries` | [Optional](../../models/shared/AccountingJournalEntries.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingJournalsRequest.md b/lending/docs/models/operations/ListAccountingJournalsRequest.md new file mode 100644 index 00000000..3ceb455d --- /dev/null +++ b/lending/docs/models/operations/ListAccountingJournalsRequest.md @@ -0,0 +1,12 @@ +# ListAccountingJournalsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingJournalsResponse.md b/lending/docs/models/operations/ListAccountingJournalsResponse.md new file mode 100644 index 00000000..023174ac --- /dev/null +++ b/lending/docs/models/operations/ListAccountingJournalsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingJournalsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingJournals` | [Optional](../../models/shared/AccountingJournals.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingPaymentsRequest.md b/lending/docs/models/operations/ListAccountingPaymentsRequest.md new file mode 100644 index 00000000..3de8fd88 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingPaymentsRequest.md @@ -0,0 +1,12 @@ +# ListAccountingPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingPaymentsResponse.md b/lending/docs/models/operations/ListAccountingPaymentsResponse.md new file mode 100644 index 00000000..54c84c98 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingPaymentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingPaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingPayments` | [Optional](../../models/shared/AccountingPayments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingSupplierAttachmentsRequest.md b/lending/docs/models/operations/ListAccountingSupplierAttachmentsRequest.md new file mode 100644 index 00000000..52844ab6 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingSupplierAttachmentsRequest.md @@ -0,0 +1,10 @@ +# ListAccountingSupplierAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `supplierId` | *String* | :heavy_check_mark: | Unique identifier for a supplier. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingSupplierAttachmentsResponse.md b/lending/docs/models/operations/ListAccountingSupplierAttachmentsResponse.md new file mode 100644 index 00000000..175e9a39 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingSupplierAttachmentsResponse.md @@ -0,0 +1,12 @@ +# ListAccountingSupplierAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `attachments` | [Optional](../../models/shared/Attachments.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListAccountingSuppliersRequest.md b/lending/docs/models/operations/ListAccountingSuppliersRequest.md new file mode 100644 index 00000000..6cc7487a --- /dev/null +++ b/lending/docs/models/operations/ListAccountingSuppliersRequest.md @@ -0,0 +1,12 @@ +# ListAccountingSuppliersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingSuppliersResponse.md b/lending/docs/models/operations/ListAccountingSuppliersResponse.md new file mode 100644 index 00000000..64b948e6 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingSuppliersResponse.md @@ -0,0 +1,12 @@ +# ListAccountingSuppliersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingSuppliers` | [Optional](../../models/shared/AccountingSuppliers.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListAccountingTransfersRequest.md b/lending/docs/models/operations/ListAccountingTransfersRequest.md new file mode 100644 index 00000000..e3284870 --- /dev/null +++ b/lending/docs/models/operations/ListAccountingTransfersRequest.md @@ -0,0 +1,13 @@ +# ListAccountingTransfersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListAccountingTransfersResponse.md b/lending/docs/models/operations/ListAccountingTransfersResponse.md new file mode 100644 index 00000000..ee6265cf --- /dev/null +++ b/lending/docs/models/operations/ListAccountingTransfersResponse.md @@ -0,0 +1,12 @@ +# ListAccountingTransfersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `accountingTransfers` | [Optional](../../models/shared/AccountingTransfers.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListBankingAccountBalancesRequest.md b/lending/docs/models/operations/ListBankingAccountBalancesRequest.md new file mode 100644 index 00000000..c99e825a --- /dev/null +++ b/lending/docs/models/operations/ListBankingAccountBalancesRequest.md @@ -0,0 +1,13 @@ +# ListBankingAccountBalancesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListBankingAccountBalancesResponse.md b/lending/docs/models/operations/ListBankingAccountBalancesResponse.md new file mode 100644 index 00000000..00584e25 --- /dev/null +++ b/lending/docs/models/operations/ListBankingAccountBalancesResponse.md @@ -0,0 +1,12 @@ +# ListBankingAccountBalancesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `bankingAccountBalances` | [Optional](../../models/shared/BankingAccountBalances.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListBankingAccountsRequest.md b/lending/docs/models/operations/ListBankingAccountsRequest.md new file mode 100644 index 00000000..cb9da3ab --- /dev/null +++ b/lending/docs/models/operations/ListBankingAccountsRequest.md @@ -0,0 +1,13 @@ +# ListBankingAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListBankingAccountsResponse.md b/lending/docs/models/operations/ListBankingAccountsResponse.md new file mode 100644 index 00000000..5f2a043f --- /dev/null +++ b/lending/docs/models/operations/ListBankingAccountsResponse.md @@ -0,0 +1,12 @@ +# ListBankingAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `bankingAccounts` | [Optional](../../models/shared/BankingAccounts.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListBankingTransactionCategoriesRequest.md b/lending/docs/models/operations/ListBankingTransactionCategoriesRequest.md new file mode 100644 index 00000000..a6912166 --- /dev/null +++ b/lending/docs/models/operations/ListBankingTransactionCategoriesRequest.md @@ -0,0 +1,13 @@ +# ListBankingTransactionCategoriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListBankingTransactionCategoriesResponse.md b/lending/docs/models/operations/ListBankingTransactionCategoriesResponse.md new file mode 100644 index 00000000..1b9db3f9 --- /dev/null +++ b/lending/docs/models/operations/ListBankingTransactionCategoriesResponse.md @@ -0,0 +1,12 @@ +# ListBankingTransactionCategoriesResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `bankingTransactionCategories` | [Optional](../../models/shared/BankingTransactionCategories.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListBankingTransactionsRequest.md b/lending/docs/models/operations/ListBankingTransactionsRequest.md new file mode 100644 index 00000000..35c1daab --- /dev/null +++ b/lending/docs/models/operations/ListBankingTransactionsRequest.md @@ -0,0 +1,13 @@ +# ListBankingTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListBankingTransactionsResponse.md b/lending/docs/models/operations/ListBankingTransactionsResponse.md new file mode 100644 index 00000000..d5f54dfd --- /dev/null +++ b/lending/docs/models/operations/ListBankingTransactionsResponse.md @@ -0,0 +1,12 @@ +# ListBankingTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `bankingTransactions` | [Optional](../../models/shared/BankingTransactions.md) | :heavy_minus_sign: | Success | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceCustomersRequest.md b/lending/docs/models/operations/ListCommerceCustomersRequest.md new file mode 100644 index 00000000..89749a15 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceCustomersRequest.md @@ -0,0 +1,13 @@ +# ListCommerceCustomersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceCustomersResponse.md b/lending/docs/models/operations/ListCommerceCustomersResponse.md new file mode 100644 index 00000000..d25395bc --- /dev/null +++ b/lending/docs/models/operations/ListCommerceCustomersResponse.md @@ -0,0 +1,12 @@ +# ListCommerceCustomersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceCustomers` | [Optional](../../models/shared/CommerceCustomers.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceDisputesRequest.md b/lending/docs/models/operations/ListCommerceDisputesRequest.md new file mode 100644 index 00000000..0319e8ec --- /dev/null +++ b/lending/docs/models/operations/ListCommerceDisputesRequest.md @@ -0,0 +1,13 @@ +# ListCommerceDisputesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceDisputesResponse.md b/lending/docs/models/operations/ListCommerceDisputesResponse.md new file mode 100644 index 00000000..ee61d103 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceDisputesResponse.md @@ -0,0 +1,12 @@ +# ListCommerceDisputesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceDisputes` | [Optional](../../models/shared/CommerceDisputes.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceLocationsRequest.md b/lending/docs/models/operations/ListCommerceLocationsRequest.md new file mode 100644 index 00000000..bc5bcb1c --- /dev/null +++ b/lending/docs/models/operations/ListCommerceLocationsRequest.md @@ -0,0 +1,9 @@ +# ListCommerceLocationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceLocationsResponse.md b/lending/docs/models/operations/ListCommerceLocationsResponse.md new file mode 100644 index 00000000..1d75545d --- /dev/null +++ b/lending/docs/models/operations/ListCommerceLocationsResponse.md @@ -0,0 +1,12 @@ +# ListCommerceLocationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceLocations` | [Optional](../../models/shared/CommerceLocations.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/ListCommerceOrdersRequest.md b/lending/docs/models/operations/ListCommerceOrdersRequest.md new file mode 100644 index 00000000..0fc4213b --- /dev/null +++ b/lending/docs/models/operations/ListCommerceOrdersRequest.md @@ -0,0 +1,13 @@ +# ListCommerceOrdersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceOrdersResponse.md b/lending/docs/models/operations/ListCommerceOrdersResponse.md new file mode 100644 index 00000000..7de4f12f --- /dev/null +++ b/lending/docs/models/operations/ListCommerceOrdersResponse.md @@ -0,0 +1,12 @@ +# ListCommerceOrdersResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceOrders` | [Optional](../../models/shared/CommerceOrders.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommercePaymentMethodsRequest.md b/lending/docs/models/operations/ListCommercePaymentMethodsRequest.md new file mode 100644 index 00000000..76e987ae --- /dev/null +++ b/lending/docs/models/operations/ListCommercePaymentMethodsRequest.md @@ -0,0 +1,13 @@ +# ListCommercePaymentMethodsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommercePaymentMethodsResponse.md b/lending/docs/models/operations/ListCommercePaymentMethodsResponse.md new file mode 100644 index 00000000..9c7abfbc --- /dev/null +++ b/lending/docs/models/operations/ListCommercePaymentMethodsResponse.md @@ -0,0 +1,12 @@ +# ListCommercePaymentMethodsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commercePaymentMethods` | [Optional](../../models/shared/CommercePaymentMethods.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommercePaymentsRequest.md b/lending/docs/models/operations/ListCommercePaymentsRequest.md new file mode 100644 index 00000000..32ca1837 --- /dev/null +++ b/lending/docs/models/operations/ListCommercePaymentsRequest.md @@ -0,0 +1,13 @@ +# ListCommercePaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommercePaymentsResponse.md b/lending/docs/models/operations/ListCommercePaymentsResponse.md new file mode 100644 index 00000000..272e7465 --- /dev/null +++ b/lending/docs/models/operations/ListCommercePaymentsResponse.md @@ -0,0 +1,12 @@ +# ListCommercePaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commercePayments` | [Optional](../../models/shared/CommercePayments.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceProductCategoriesRequest.md b/lending/docs/models/operations/ListCommerceProductCategoriesRequest.md new file mode 100644 index 00000000..f183ed51 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceProductCategoriesRequest.md @@ -0,0 +1,13 @@ +# ListCommerceProductCategoriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceProductCategoriesResponse.md b/lending/docs/models/operations/ListCommerceProductCategoriesResponse.md new file mode 100644 index 00000000..a9696811 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceProductCategoriesResponse.md @@ -0,0 +1,12 @@ +# ListCommerceProductCategoriesResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `commerceProductCategories` | [Optional](../../models/shared/CommerceProductCategories.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceProductsRequest.md b/lending/docs/models/operations/ListCommerceProductsRequest.md new file mode 100644 index 00000000..6e061aa1 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceProductsRequest.md @@ -0,0 +1,13 @@ +# ListCommerceProductsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceProductsResponse.md b/lending/docs/models/operations/ListCommerceProductsResponse.md new file mode 100644 index 00000000..d2a00cab --- /dev/null +++ b/lending/docs/models/operations/ListCommerceProductsResponse.md @@ -0,0 +1,12 @@ +# ListCommerceProductsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceProducts` | [Optional](../../models/shared/CommerceProducts.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCommerceTransactionsRequest.md b/lending/docs/models/operations/ListCommerceTransactionsRequest.md new file mode 100644 index 00000000..522fc043 --- /dev/null +++ b/lending/docs/models/operations/ListCommerceTransactionsRequest.md @@ -0,0 +1,13 @@ +# ListCommerceTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCommerceTransactionsResponse.md b/lending/docs/models/operations/ListCommerceTransactionsResponse.md new file mode 100644 index 00000000..f8eb11df --- /dev/null +++ b/lending/docs/models/operations/ListCommerceTransactionsResponse.md @@ -0,0 +1,12 @@ +# ListCommerceTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `commerceTransactions` | [Optional](../../models/shared/CommerceTransactions.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCompaniesRequest.md b/lending/docs/models/operations/ListCompaniesRequest.md new file mode 100644 index 00000000..99f132f8 --- /dev/null +++ b/lending/docs/models/operations/ListCompaniesRequest.md @@ -0,0 +1,11 @@ +# ListCompaniesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCompaniesResponse.md b/lending/docs/models/operations/ListCompaniesResponse.md new file mode 100644 index 00000000..132278cf --- /dev/null +++ b/lending/docs/models/operations/ListCompaniesResponse.md @@ -0,0 +1,12 @@ +# ListCompaniesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `companies` | [Optional](../../models/shared/Companies.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListConnectionsRequest.md b/lending/docs/models/operations/ListConnectionsRequest.md new file mode 100644 index 00000000..1b9d10ba --- /dev/null +++ b/lending/docs/models/operations/ListConnectionsRequest.md @@ -0,0 +1,12 @@ +# ListConnectionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListConnectionsResponse.md b/lending/docs/models/operations/ListConnectionsResponse.md new file mode 100644 index 00000000..14561e45 --- /dev/null +++ b/lending/docs/models/operations/ListConnectionsResponse.md @@ -0,0 +1,12 @@ +# ListConnectionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `connections` | [Optional](../../models/shared/Connections.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListCreateOperationsRequest.md b/lending/docs/models/operations/ListCreateOperationsRequest.md new file mode 100644 index 00000000..60f4d705 --- /dev/null +++ b/lending/docs/models/operations/ListCreateOperationsRequest.md @@ -0,0 +1,12 @@ +# ListCreateOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListCreateOperationsResponse.md b/lending/docs/models/operations/ListCreateOperationsResponse.md new file mode 100644 index 00000000..fd7de4d6 --- /dev/null +++ b/lending/docs/models/operations/ListCreateOperationsResponse.md @@ -0,0 +1,12 @@ +# ListCreateOperationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `pushOperations` | [Optional](../../models/shared/PushOperations.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/ListDataIntegrityDetailsRequest.md b/lending/docs/models/operations/ListDataIntegrityDetailsRequest.md new file mode 100644 index 00000000..45e86399 --- /dev/null +++ b/lending/docs/models/operations/ListDataIntegrityDetailsRequest.md @@ -0,0 +1,13 @@ +# ListDataIntegrityDetailsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataType` | [io.codat.lending.models.shared.DataIntegrityDataType](../../models/shared/DataIntegrityDataType.md) | :heavy_check_mark: | A key for a Codat data type. | banking-accounts | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListDataIntegrityDetailsResponse.md b/lending/docs/models/operations/ListDataIntegrityDetailsResponse.md new file mode 100644 index 00000000..f9edea1f --- /dev/null +++ b/lending/docs/models/operations/ListDataIntegrityDetailsResponse.md @@ -0,0 +1,12 @@ +# ListDataIntegrityDetailsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `dataIntegrityDetails` | [Optional](../../models/shared/DataIntegrityDetails.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/ListFilesRequest.md b/lending/docs/models/operations/ListFilesRequest.md new file mode 100644 index 00000000..1bf5e366 --- /dev/null +++ b/lending/docs/models/operations/ListFilesRequest.md @@ -0,0 +1,8 @@ +# ListFilesRequest + + +## 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/lending/docs/models/operations/ListFilesResponse.md b/lending/docs/models/operations/ListFilesResponse.md new file mode 100644 index 00000000..7e4c081e --- /dev/null +++ b/lending/docs/models/operations/ListFilesResponse.md @@ -0,0 +1,12 @@ +# ListFilesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `files` | List<[io.codat.lending.models.shared.File](../../models/shared/File.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/lending/docs/models/operations/ListLoanTransactionsQueryParamSourceType.md b/lending/docs/models/operations/ListLoanTransactionsQueryParamSourceType.md new file mode 100644 index 00000000..531b2e7f --- /dev/null +++ b/lending/docs/models/operations/ListLoanTransactionsQueryParamSourceType.md @@ -0,0 +1,12 @@ +# ListLoanTransactionsQueryParamSourceType + +Data source type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `BANKING` | banking | +| `COMMERCE` | commerce | +| `ACCOUNTING` | accounting | \ No newline at end of file diff --git a/lending/docs/models/operations/ListLoanTransactionsRequest.md b/lending/docs/models/operations/ListLoanTransactionsRequest.md new file mode 100644 index 00000000..88cc33a3 --- /dev/null +++ b/lending/docs/models/operations/ListLoanTransactionsRequest.md @@ -0,0 +1,9 @@ +# ListLoanTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `sourceType` | [io.codat.lending.models.operations.ListLoanTransactionsQueryParamSourceType](../../models/operations/ListLoanTransactionsQueryParamSourceType.md) | :heavy_check_mark: | Data source type. | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListLoanTransactionsResponse.md b/lending/docs/models/operations/ListLoanTransactionsResponse.md new file mode 100644 index 00000000..cd646477 --- /dev/null +++ b/lending/docs/models/operations/ListLoanTransactionsResponse.md @@ -0,0 +1,12 @@ +# ListLoanTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `loanTransactions` | [Optional](../../models/shared/LoanTransactions.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/ListPullOperationsRequest.md b/lending/docs/models/operations/ListPullOperationsRequest.md new file mode 100644 index 00000000..b365cf5d --- /dev/null +++ b/lending/docs/models/operations/ListPullOperationsRequest.md @@ -0,0 +1,12 @@ +# ListPullOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `orderBy` | *Optional* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListPullOperationsResponse.md b/lending/docs/models/operations/ListPullOperationsResponse.md new file mode 100644 index 00000000..44f0a323 --- /dev/null +++ b/lending/docs/models/operations/ListPullOperationsResponse.md @@ -0,0 +1,12 @@ +# ListPullOperationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `pullOperations` | [Optional](../../models/shared/PullOperations.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/ListReconciledInvoicesRequest.md b/lending/docs/models/operations/ListReconciledInvoicesRequest.md new file mode 100644 index 00000000..c284d3fe --- /dev/null +++ b/lending/docs/models/operations/ListReconciledInvoicesRequest.md @@ -0,0 +1,11 @@ +# ListReconciledInvoicesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *Optional* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *Optional* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file diff --git a/lending/docs/models/operations/ListReconciledInvoicesResponse.md b/lending/docs/models/operations/ListReconciledInvoicesResponse.md new file mode 100644 index 00000000..5da36be7 --- /dev/null +++ b/lending/docs/models/operations/ListReconciledInvoicesResponse.md @@ -0,0 +1,12 @@ +# ListReconciledInvoicesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `enhancedInvoicesReport` | [Optional](../../models/shared/EnhancedInvoicesReport.md) | :heavy_minus_sign: | OK | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `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/lending/docs/models/operations/QueryParamSourceType.md b/lending/docs/models/operations/QueryParamSourceType.md new file mode 100644 index 00000000..a6121836 --- /dev/null +++ b/lending/docs/models/operations/QueryParamSourceType.md @@ -0,0 +1,12 @@ +# QueryParamSourceType + +Data source type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `BANKING` | banking | +| `COMMERCE` | commerce | +| `ACCOUNTING` | accounting | \ No newline at end of file diff --git a/lending/docs/models/operations/RefreshAllDataTypesRequest.md b/lending/docs/models/operations/RefreshAllDataTypesRequest.md new file mode 100644 index 00000000..81b3f607 --- /dev/null +++ b/lending/docs/models/operations/RefreshAllDataTypesRequest.md @@ -0,0 +1,8 @@ +# RefreshAllDataTypesRequest + + +## 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/lending/docs/models/operations/RefreshAllDataTypesResponse.md b/lending/docs/models/operations/RefreshAllDataTypesResponse.md new file mode 100644 index 00000000..6de680ef --- /dev/null +++ b/lending/docs/models/operations/RefreshAllDataTypesResponse.md @@ -0,0 +1,11 @@ +# RefreshAllDataTypesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/RefreshDataTypeRequest.md b/lending/docs/models/operations/RefreshDataTypeRequest.md new file mode 100644 index 00000000..8026a4cc --- /dev/null +++ b/lending/docs/models/operations/RefreshDataTypeRequest.md @@ -0,0 +1,10 @@ +# RefreshDataTypeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *Optional* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | +| `dataType` | [io.codat.lending.models.shared.SchemaDataType](../../models/shared/SchemaDataType.md) | :heavy_check_mark: | The key of a Codat data type | invoices | \ No newline at end of file diff --git a/lending/docs/models/operations/RefreshDataTypeResponse.md b/lending/docs/models/operations/RefreshDataTypeResponse.md new file mode 100644 index 00000000..6d78175e --- /dev/null +++ b/lending/docs/models/operations/RefreshDataTypeResponse.md @@ -0,0 +1,12 @@ +# RefreshDataTypeResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pullOperation` | [Optional](../../models/shared/PullOperation.md) | :heavy_minus_sign: | OK | +| `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/lending/docs/models/operations/SourceType.md b/lending/docs/models/operations/SourceType.md new file mode 100644 index 00000000..4e702956 --- /dev/null +++ b/lending/docs/models/operations/SourceType.md @@ -0,0 +1,12 @@ +# SourceType + +Data source type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `BANKING` | banking | +| `COMMERCE` | commerce | +| `ACCOUNTING` | accounting | \ No newline at end of file diff --git a/lending/docs/models/operations/UnlinkConnectionRequest.md b/lending/docs/models/operations/UnlinkConnectionRequest.md new file mode 100644 index 00000000..db61b1ab --- /dev/null +++ b/lending/docs/models/operations/UnlinkConnectionRequest.md @@ -0,0 +1,10 @@ +# UnlinkConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `requestBody` | [Optional](../../models/operations/UnlinkConnectionUpdateConnection.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/lending/docs/models/operations/UnlinkConnectionResponse.md b/lending/docs/models/operations/UnlinkConnectionResponse.md new file mode 100644 index 00000000..94ffa59f --- /dev/null +++ b/lending/docs/models/operations/UnlinkConnectionResponse.md @@ -0,0 +1,12 @@ +# UnlinkConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `connection` | [Optional](../../models/shared/Connection.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/UnlinkConnectionUpdateConnection.md b/lending/docs/models/operations/UnlinkConnectionUpdateConnection.md new file mode 100644 index 00000000..6dfabed2 --- /dev/null +++ b/lending/docs/models/operations/UnlinkConnectionUpdateConnection.md @@ -0,0 +1,8 @@ +# UnlinkConnectionUpdateConnection + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `status` | [Optional](../../models/shared/DataConnectionStatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file diff --git a/lending/docs/models/operations/UpdateCompanyRequest.md b/lending/docs/models/operations/UpdateCompanyRequest.md new file mode 100644 index 00000000..362dc1af --- /dev/null +++ b/lending/docs/models/operations/UpdateCompanyRequest.md @@ -0,0 +1,9 @@ +# UpdateCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `companyRequestBody` | [Optional](../../models/shared/CompanyRequestBody.md) | :heavy_minus_sign: | N/A | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/operations/UpdateCompanyResponse.md b/lending/docs/models/operations/UpdateCompanyResponse.md new file mode 100644 index 00000000..1de8a0b0 --- /dev/null +++ b/lending/docs/models/operations/UpdateCompanyResponse.md @@ -0,0 +1,12 @@ +# UpdateCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `company` | [Optional](../../models/shared/Company.md) | :heavy_minus_sign: | OK | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `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/lending/docs/models/operations/UploadFilesRequest.md b/lending/docs/models/operations/UploadFilesRequest.md new file mode 100644 index 00000000..07ca3a3d --- /dev/null +++ b/lending/docs/models/operations/UploadFilesRequest.md @@ -0,0 +1,10 @@ +# UploadFilesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `fileUpload` | [Optional](../../models/shared/FileUpload.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/lending/docs/models/operations/UploadFilesResponse.md b/lending/docs/models/operations/UploadFilesResponse.md new file mode 100644 index 00000000..83a505b5 --- /dev/null +++ b/lending/docs/models/operations/UploadFilesResponse.md @@ -0,0 +1,11 @@ +# UploadFilesResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `errorMessage` | [Optional](../../models/shared/ErrorMessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `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/lending/docs/models/shared/AccountBalance.md b/lending/docs/models/shared/AccountBalance.md new file mode 100644 index 00000000..017d9624 --- /dev/null +++ b/lending/docs/models/shared/AccountBalance.md @@ -0,0 +1,11 @@ +# AccountBalance + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `available` | *Optional* | :heavy_minus_sign: | The account's current balance | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency of the account | GBP | +| `pending` | *Optional* | :heavy_minus_sign: | Funds that are not yet available in the balance | | +| `reserved` | *Optional* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountBalanceAmounts.md b/lending/docs/models/shared/AccountBalanceAmounts.md new file mode 100644 index 00000000..b19df34e --- /dev/null +++ b/lending/docs/models/shared/AccountBalanceAmounts.md @@ -0,0 +1,12 @@ +# AccountBalanceAmounts + +Depending on the data provided by the underlying bank, not all balances are always available. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `available` | *JsonNullable* | :heavy_minus_sign: | The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. | +| `current` | *Optional* | :heavy_minus_sign: | The balance of the account only including cleared transactions. | +| `limit` | *JsonNullable* | :heavy_minus_sign: | The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountCategoriesUpdatedWebhook.md b/lending/docs/models/shared/AccountCategoriesUpdatedWebhook.md new file mode 100644 index 00000000..6bedd0b5 --- /dev/null +++ b/lending/docs/models/shared/AccountCategoriesUpdatedWebhook.md @@ -0,0 +1,18 @@ +# AccountCategoriesUpdatedWebhook + +Webhook request body for account categories updated. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `alertId` | *Optional* | :heavy_minus_sign: | Unique identifier of the webhook event. | | +| `clientId` | *Optional* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | +| `clientName` | *Optional* | :heavy_minus_sign: | Name of your client in Codat. | | +| `companyId` | *Optional* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data` | [Optional](../../models/shared/AccountCategoriesUpdatedWebhookData.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionId` | *Optional* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `message` | *Optional* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `ruleId` | *Optional* | :heavy_minus_sign: | Unique identifier for the rule. | | +| `ruleType` | *Optional* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountCategoriesUpdatedWebhookData.md b/lending/docs/models/shared/AccountCategoriesUpdatedWebhookData.md new file mode 100644 index 00000000..93d21cd1 --- /dev/null +++ b/lending/docs/models/shared/AccountCategoriesUpdatedWebhookData.md @@ -0,0 +1,8 @@ +# AccountCategoriesUpdatedWebhookData + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | The date on which this account categories were last modified in Codat. | 2022-10-23 | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountCategoryLevel.md b/lending/docs/models/shared/AccountCategoryLevel.md new file mode 100644 index 00000000..c9ddc812 --- /dev/null +++ b/lending/docs/models/shared/AccountCategoryLevel.md @@ -0,0 +1,11 @@ +# AccountCategoryLevel + +An object containing an ordered list of account category levels. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `confidence` | *Optional* | :heavy_minus_sign: | Confidence level of the category. This will only be populated where `status` is `Suggested`. | +| `levelName` | *Optional* | :heavy_minus_sign: | Account category name. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountIdentifierType.md b/lending/docs/models/shared/AccountIdentifierType.md new file mode 100644 index 00000000..dff9421e --- /dev/null +++ b/lending/docs/models/shared/AccountIdentifierType.md @@ -0,0 +1,16 @@ +# AccountIdentifierType + +Type of account + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACCOUNT` | Account | +| `CARD` | Card | +| `CREDIT` | Credit | +| `DEPOSITORY` | Depository | +| `INVESTMENT` | Investment | +| `LOAN` | Loan | +| `OTHER` | Other | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountIdentifiers.md b/lending/docs/models/shared/AccountIdentifiers.md new file mode 100644 index 00000000..45cdea4d --- /dev/null +++ b/lending/docs/models/shared/AccountIdentifiers.md @@ -0,0 +1,16 @@ +# AccountIdentifiers + +An object containing bank account identification information. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bankCode` | *JsonNullable* | :heavy_minus_sign: | The local (usually national) routing number for the account.

This is known by different names in different countries:
* BSB code (Australia)
* routing number (Canada, USA)
* sort code (UK) | +| `bic` | *JsonNullable* | :heavy_minus_sign: | The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. | +| `iban` | *JsonNullable* | :heavy_minus_sign: | The international bank account number (IBAN) for the account, if known. | +| `maskedAccountNumber` | *JsonNullable* | :heavy_minus_sign: | A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) | +| `number` | *JsonNullable* | :heavy_minus_sign: | The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. | +| `subtype` | *JsonNullable* | :heavy_minus_sign: | Detailed account category | +| `type` | [io.codat.lending.models.shared.AccountIdentifierType](../../models/shared/AccountIdentifierType.md) | :heavy_check_mark: | Type of account | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountInstitution.md b/lending/docs/models/shared/AccountInstitution.md new file mode 100644 index 00000000..56cf0528 --- /dev/null +++ b/lending/docs/models/shared/AccountInstitution.md @@ -0,0 +1,11 @@ +# AccountInstitution + +The bank or other financial institution providing the account. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | The institution's ID, according to the provider. | +| `name` | *Optional* | :heavy_minus_sign: | The institution's name, according to the underlying provider. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountPrototype.md b/lending/docs/models/shared/AccountPrototype.md new file mode 100644 index 00000000..e4ff34de --- /dev/null +++ b/lending/docs/models/shared/AccountPrototype.md @@ -0,0 +1,19 @@ +# AccountPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currentBalance` | *JsonNullable* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fullyQualifiedCategory` | *JsonNullable* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fullyQualifiedName` | *JsonNullable* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `isBankAccount` | *Optional* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominalCode` | *JsonNullable* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `status` | [Optional](../../models/shared/AccountStatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional](../../models/shared/AccountType.md) | :heavy_minus_sign: | Type of account | Asset | +| `validDatatypeLinks` | List<[io.codat.lending.models.shared.ValidDataTypeLinks](../../models/shared/ValidDataTypeLinks.md)> | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountRef.md b/lending/docs/models/shared/AccountRef.md new file mode 100644 index 00000000..882bb515 --- /dev/null +++ b/lending/docs/models/shared/AccountRef.md @@ -0,0 +1,11 @@ +# AccountRef + +Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | 'id' from the Accounts data type. | +| `name` | *Optional* | :heavy_minus_sign: | 'name' from the Accounts data type. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountStatus.md b/lending/docs/models/shared/AccountStatus.md new file mode 100644 index 00000000..bd4cf2f2 --- /dev/null +++ b/lending/docs/models/shared/AccountStatus.md @@ -0,0 +1,13 @@ +# AccountStatus + +Status of the account + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | +| `PENDING` | Pending | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountTransactionLine.md b/lending/docs/models/shared/AccountTransactionLine.md new file mode 100644 index 00000000..9a2df372 --- /dev/null +++ b/lending/docs/models/shared/AccountTransactionLine.md @@ -0,0 +1,10 @@ +# AccountTransactionLine + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | Amount in the bill payment currency. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description of the account transaction. | +| `recordRef` | [Optional](../../models/shared/AccountTransactionLineRecordRef.md) | :heavy_minus_sign: | Links an account transaction line to the underlying record that created it. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountTransactionLineRecordRef.md b/lending/docs/models/shared/AccountTransactionLineRecordRef.md new file mode 100644 index 00000000..03bbd425 --- /dev/null +++ b/lending/docs/models/shared/AccountTransactionLineRecordRef.md @@ -0,0 +1,11 @@ +# AccountTransactionLineRecordRef + +Links an account transaction line to the underlying record that created it. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `dataType` | [Optional](../../models/shared/AccountTransactionLineRecordRefDataType.md) | :heavy_minus_sign: | Name of underlying data type. | transfers | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountTransactionLineRecordRefDataType.md b/lending/docs/models/shared/AccountTransactionLineRecordRefDataType.md new file mode 100644 index 00000000..570854fd --- /dev/null +++ b/lending/docs/models/shared/AccountTransactionLineRecordRefDataType.md @@ -0,0 +1,20 @@ +# AccountTransactionLineRecordRefDataType + +Name of underlying data type. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CREDIT_NOTES` | creditNotes | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `JOURNAL_ENTRIES` | journalEntries | +| `PAYMENTS` | payments | +| `TRANSFERS` | transfers | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountType.md b/lending/docs/models/shared/AccountType.md new file mode 100644 index 00000000..f9c49f99 --- /dev/null +++ b/lending/docs/models/shared/AccountType.md @@ -0,0 +1,15 @@ +# AccountType + +Type of account + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `UNKNOWN` | Unknown | +| `ASSET` | Asset | +| `EXPENSE` | Expense | +| `INCOME` | Income | +| `LIABILITY` | Liability | +| `EQUITY` | Equity | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAccount.md b/lending/docs/models/shared/AccountingAccount.md new file mode 100644 index 00000000..6df55109 --- /dev/null +++ b/lending/docs/models/shared/AccountingAccount.md @@ -0,0 +1,52 @@ +# AccountingAccount + +> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + +View the coverage for accounts in the Data coverage explorer. + +## Overview + +Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + +The categories for an account include: +* Asset +* Expense +* Income +* Liability +* Equity. + +The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + +At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + +To determine the list of allowed categories for a specific integration, you can: +- Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). +- Refer to the integration's own documentation. + +> **Accounts with no category** +> +> If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. +> +> This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currentBalance` | *JsonNullable* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fullyQualifiedCategory` | *JsonNullable* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fullyQualifiedName` | *JsonNullable* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | +| `isBankAccount` | *Optional* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominalCode` | *JsonNullable* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/AccountStatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional](../../models/shared/AccountType.md) | :heavy_minus_sign: | Type of account | Asset | +| `validDatatypeLinks` | List<[io.codat.lending.models.shared.AccountingAccountValidDataTypeLinks](../../models/shared/AccountingAccountValidDataTypeLinks.md)> | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAccountTransaction.md b/lending/docs/models/shared/AccountingAccountTransaction.md new file mode 100644 index 00000000..da4a24cd --- /dev/null +++ b/lending/docs/models/shared/AccountingAccountTransaction.md @@ -0,0 +1,38 @@ +# AccountingAccountTransaction + +> **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting platform. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). + +> View the coverage for account transactions in the Data coverage explorer. + +## Overview + +In Codat’s data model, account transactions represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + +Account transactions are created as a result of different business activities, for example: + +* Payments: for example, receiving money for payment against an invoice. +* Bill payments: for example, spending money for a payment against a bill. +* Direct costs: for example, withdrawing money from a bank account, either for cash purposes or to make a payment. +* Direct incomes: for example, selling an item directly to a contact and receiving payment at point of sale. +* Transfers: for example, transferring money between two bank accounts. + +Account transactions is the parent data type of [payments](https://docs.codat.io/lending-api#/schemas/Payment), [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment), [direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost), [direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome), and [transfers](https://docs.codat.io/lending-api#/schemas/Transfer). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bankAccountRef` | [Optional](../../models/shared/BankAccountRef.md) | :heavy_minus_sign: | Links to the Account transactions data type. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `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 | +| `id` | *Optional* | :heavy_minus_sign: | Identifier of the direct cost (unique to the company). | | +| `lines` | List<[io.codat.lending.models.shared.AccountTransactionLine](../../models/shared/AccountTransactionLine.md)> | :heavy_minus_sign: | Array of account transaction lines. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Additional information about the account transaction, if available. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/Status.md) | :heavy_minus_sign: | The status of the account transaction. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount of the account transactions, inclusive of tax. | | +| `transactionId` | *JsonNullable* | :heavy_minus_sign: | Identifier of the transaction (unique to the company). | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAccountTransactions.md b/lending/docs/models/shared/AccountingAccountTransactions.md new file mode 100644 index 00000000..30aaa17c --- /dev/null +++ b/lending/docs/models/shared/AccountingAccountTransactions.md @@ -0,0 +1,12 @@ +# AccountingAccountTransactions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingAccountTransaction](../../models/shared/AccountingAccountTransaction.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAccountValidDataTypeLinks.md b/lending/docs/models/shared/AccountingAccountValidDataTypeLinks.md new file mode 100644 index 00000000..9fff54d5 --- /dev/null +++ b/lending/docs/models/shared/AccountingAccountValidDataTypeLinks.md @@ -0,0 +1,50 @@ +# AccountingAccountValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List<*String*> | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *JsonNullable* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAccounts.md b/lending/docs/models/shared/AccountingAccounts.md new file mode 100644 index 00000000..52827705 --- /dev/null +++ b/lending/docs/models/shared/AccountingAccounts.md @@ -0,0 +1,12 @@ +# AccountingAccounts + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingAccount](../../models/shared/AccountingAccount.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAddress.md b/lending/docs/models/shared/AccountingAddress.md new file mode 100644 index 00000000..77691eb5 --- /dev/null +++ b/lending/docs/models/shared/AccountingAddress.md @@ -0,0 +1,14 @@ +# AccountingAddress + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `city` | *JsonNullable* | :heavy_minus_sign: | City of the customer address. | +| `country` | *JsonNullable* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *JsonNullable* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *JsonNullable* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postalCode` | *JsonNullable* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *JsonNullable* | :heavy_minus_sign: | Region of the customer address. | +| `type` | [io.codat.lending.models.shared.AccountingAddressType](../../models/shared/AccountingAddressType.md) | :heavy_check_mark: | The type of the address | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAddressType.md b/lending/docs/models/shared/AccountingAddressType.md new file mode 100644 index 00000000..ab6961bc --- /dev/null +++ b/lending/docs/models/shared/AccountingAddressType.md @@ -0,0 +1,12 @@ +# AccountingAddressType + +The type of the address + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `BILLING` | Billing | +| `DELIVERY` | Delivery | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAgedCreditorReport.md b/lending/docs/models/shared/AccountingAgedCreditorReport.md new file mode 100644 index 00000000..2c7e00c3 --- /dev/null +++ b/lending/docs/models/shared/AccountingAgedCreditorReport.md @@ -0,0 +1,43 @@ +# AccountingAgedCreditorReport + +The Aged Creditors report shows the total balance owed by a business to its suppliers over time. + +You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. + +Total assets or liabilities are grouped into 30-day periods for each supplier, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. + +> It is not guaranteed that write-offs are included in the Aged Creditors report. + +## Underlying data + +The Aged Creditors report is generated from a set of required data types: [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier), [Bills](https://docs.codat.io/lending-api#/schemas/Bill), [Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote), and [Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). + +To generate the report, the underlying data types must have been synced within 24 hours of each other. Otherwise an error is displayed when you try to run the report. Sync the required data types by clicking the link in the error, and then run the report again. + +> The Aged Creditor report runs based on the **issue dates** of the underlying data types rather than the due date. + +## Accessing the Aged Creditors report in Portal + +Apart from returning the report via the API as JSON and query, you can also return the Aged Creditors report in the Codat portal. + +1. In the navigation bar, click **Companies**. +2. Click the name of the company you want to generate the report for. The company's data page is displayed. +3. Click the **Accounting** tab then click **Reports**. +4. Select **Aged Creditors**. +5. _(Optional)_ Edit the default reporting parameters. + a. You can change the report date in the **Date** box. By default, the report includes transactions that occurred up to, but not including, today's date. To include transactions for today, enter tomorrow's date. + b. In the **Period Length Days** box, select the default period length for each column (the default is 30 days). + b. In the **Number of Periods** box, enter the number of periods to show as columns in the report (the default is 4 periods). +6. To run the report, click **Load aged creditors**. +7. The report is generated and displayed at the bottom of the page. + +The report will be grouped per supplier and depending on the periods requested. The details indicates whether the amounts owed come from outstanding bills or bill credit notes. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | List<[io.codat.lending.models.shared.AgedCreditor](../../models/shared/AgedCreditor.md)> | :heavy_minus_sign: | Array of aged creditor. | | +| `generated` | *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 | +| `reportDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAgedDebtorReport.md b/lending/docs/models/shared/AccountingAgedDebtorReport.md new file mode 100644 index 00000000..cd5f30f5 --- /dev/null +++ b/lending/docs/models/shared/AccountingAgedDebtorReport.md @@ -0,0 +1,43 @@ +# AccountingAgedDebtorReport + +The Aged Debtors report shows the total outstanding balance due from customers to the business over time. + +You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. + +Total assets or liabilities are grouped into 30-day periods for each customer, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. + +> It is not guaranteed that write-offs are included in the Aged Debtors report. + +## Underlying data + +The Aged Debtors report is generated from a set of required data types: [Customers](https://docs.codat.io/lending-api#/schemas/Customer), [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice), [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote), and [Payments](https://docs.codat.io/lending-api#/schemas/Payment). + +To generate the report, the underlying data types must have been synced within 24 hours of each other. Otherwise an error is displayed when you try to run the report. Sync the required data types by clicking the link in the error, and then run the report again. + +> The Aged Debtors report runs based on the **issue dates** of the underlying data types rather than the due date. + +## Accessing the Aged Debtors report in Portal + +Apart from returning the report via the API as JSON and query, you can also return the Aged Debtors report in the Codat portal. + +1. In the navigation bar, click **Companies**. +2. Click the name of the company you want to generate the report for. The company's data page is displayed. +3. Click the **Accounting** tab then click **Reports**. +4. Select **Aged Debtors**. +5. _(Optional)_ Edit the default reporting parameters. + a. You can change the report date in the **Date** box. By default, the report includes transactions that occurred up to, but not including, today's date. To include transactions for today, enter tomorrow's date. + b. In the **Period Length Days** box, select the default period length for each column (the default is 30 days). + b. In the **Number of Periods** box, enter the number of periods to show as columns in the report (the default is 4 periods). +6. To run the report, click **Load aged debtors**. +7. The report is generated and displayed at the bottom of the page. + +The report will be grouped per supplier and depending on the periods requested. The details indicates whether the amounts owed come from outstanding invoices or credit notes. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | List<[io.codat.lending.models.shared.AgedDebtor](../../models/shared/AgedDebtor.md)> | :heavy_minus_sign: | Array of aged debtors. | | +| `generated` | *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 | +| `reportDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingAttachment.md b/lending/docs/models/shared/AccountingAttachment.md new file mode 100644 index 00000000..0ff540ec --- /dev/null +++ b/lending/docs/models/shared/AccountingAttachment.md @@ -0,0 +1,35 @@ +# AccountingAttachment + +The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + +> **Retrieving attachments** +> +> If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + +Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + +Note that different integrations have different requirements to file size and extension of attachments. + +| Integration | File size | File extension | +|-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | +| QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | +| NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | +| Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that "You can attach any type of file, such as text, image, or video files". | + +View the coverage for each integration in the Data coverage explorer. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *JsonNullable* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | +| `dateCreated` | *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 | +| `fileSize` | *JsonNullable* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting platform. | | +| `includeWhenSent` | *Optional* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the attachment file. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBalanceSheet.md b/lending/docs/models/shared/AccountingBalanceSheet.md new file mode 100644 index 00000000..d7bca16b --- /dev/null +++ b/lending/docs/models/shared/AccountingBalanceSheet.md @@ -0,0 +1,30 @@ +# AccountingBalanceSheet + +> View the coverage for balance sheet in the Data coverage explorer. + +## Overview + +The balance sheet is a snapshot of a company's accounts at a single point in time that provides a statement of the assets, liabilities and equity of an organization. It gives interested parties an idea of the company's financial position, in addition to displaying what the company owns and owes. + +> **Balance sheet or profit and loss report?** +> +> A profit and loss report summarises the total revenue, expenses, and profit or loss during a specified time period. A balance sheet report shows the financial position of a company at a specific moment in time. + +**Structure of this report** +This report will reflect the structure and line descriptions that the business has set in their own accounting platform. + +**History** +By default, Codat pulls (up to) 24 months of balance sheets for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `balanceSheet` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/update-sync-settings). + +**Want to pull this in a standardised structure?** +Our [Enhanced Financials](https://docs.codat.io/assess/enhanced-financials/overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `earliestAvailableMonth` | *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 | +| `mostRecentAvailableMonth` | *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 | +| `reports` | List<[io.codat.lending.models.shared.BalanceSheet](../../models/shared/BalanceSheet.md)> | :heavy_check_mark: | An array of balance sheet reports. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBankAccount.md b/lending/docs/models/shared/AccountingBankAccount.md new file mode 100644 index 00000000..ea3f728a --- /dev/null +++ b/lending/docs/models/shared/AccountingBankAccount.md @@ -0,0 +1,40 @@ +# AccountingBankAccount + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/schemas/Account) + +> View the coverage for bank accounts in the Data coverage explorer. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting platform. +* The currency and balance of the account. +* The sort code and account number. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *JsonNullable* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `accountNumber` | *JsonNullable* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

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

## Unknown currencies

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

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

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

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

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBankAccountType.md b/lending/docs/models/shared/AccountingBankAccountType.md new file mode 100644 index 00000000..2cb08dd9 --- /dev/null +++ b/lending/docs/models/shared/AccountingBankAccountType.md @@ -0,0 +1,14 @@ +# AccountingBankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBankAccounts.md b/lending/docs/models/shared/AccountingBankAccounts.md new file mode 100644 index 00000000..d225b054 --- /dev/null +++ b/lending/docs/models/shared/AccountingBankAccounts.md @@ -0,0 +1,12 @@ +# AccountingBankAccounts + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingBankAccount](../../models/shared/AccountingBankAccount.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBankTransaction.md b/lending/docs/models/shared/AccountingBankTransaction.md new file mode 100644 index 00000000..347371a3 --- /dev/null +++ b/lending/docs/models/shared/AccountingBankTransaction.md @@ -0,0 +1,34 @@ +# AccountingBankTransaction + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions) + +> View the coverage for bank transactions in the Data coverage explorer. + +## Overview + +Transactional banking data for a specific company and account. + +Bank transactions include the: +* Amount of the transaction. +* Current account balance. +* Transaction type, for example, credit, debit, or transfer. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *JsonNullable* | :heavy_minus_sign: | Unique identifier to the `accountId` the bank transactions originates from. | | +| `amount` | *Optional* | :heavy_minus_sign: | The amount transacted in the bank transaction. | | +| `balance` | *Optional* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. | | +| `clearedOnDate` | *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. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the bank transaction, unique to the company in the accounting platform. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `reconciled` | *Optional* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `transactionType` | [Optional](../../models/shared/BankTransactionType.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBankTransactions.md b/lending/docs/models/shared/AccountingBankTransactions.md new file mode 100644 index 00000000..a4f387b4 --- /dev/null +++ b/lending/docs/models/shared/AccountingBankTransactions.md @@ -0,0 +1,12 @@ +# AccountingBankTransactions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingBankTransaction](../../models/shared/AccountingBankTransaction.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBill.md b/lending/docs/models/shared/AccountingBill.md new file mode 100644 index 00000000..c15347cd --- /dev/null +++ b/lending/docs/models/shared/AccountingBill.md @@ -0,0 +1,48 @@ +# AccountingBill + +> **Invoices or bills?** +> +> We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. +> +> See [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + +View the coverage for bills in the Data coverage explorer. + +## Overview + +In Codat, a bill contains details of: +* When the bill was recorded in the accounting system. +* How much the bill is for and the currency of the amount. +* Who the bill was received from — the *supplier*. +* What the bill is for — the *line items*. + +Some accounting platforms give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + +You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amountDue` | *JsonNullable* | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `dueDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting platform. | | +| `issueDate` | *String* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `lineItems` | List<[io.codat.lending.models.shared.BillLineItem](../../models/shared/BillLineItem.md)> | :heavy_minus_sign: | Array of Bill line items. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_minus_sign: | An array of payment allocations. | | +| `purchaseOrderRefs` | List<[io.codat.lending.models.shared.PurchaseOrderReference](../../models/shared/PurchaseOrderReference.md)> | :heavy_minus_sign: | N/A | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.BillStatus](../../models/shared/BillStatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `subTotal` | *double* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplierRef` | [Optional](../../models/shared/SupplierRef.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `taxAmount` | *double* | :heavy_check_mark: | Amount of tax on the bill. | | +| `totalAmount` | *double* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `withholdingTax` | List<[io.codat.lending.models.shared.WithholdingTax](../../models/shared/WithholdingTax.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBillCreditNote.md b/lending/docs/models/shared/AccountingBillCreditNote.md new file mode 100644 index 00000000..4c536c98 --- /dev/null +++ b/lending/docs/models/shared/AccountingBillCreditNote.md @@ -0,0 +1,46 @@ +# AccountingBillCreditNote + +> **Bill credit notes or credit notes?** +> +> In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + +View the coverage for bill credit notes in the Data coverage explorer. + +## Overview + +A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + +In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/lending-api#/schemas/Supplier). + +A bill credit note includes details of: +* The original and remaining credit. +* Any allocations of the credit against other records, such as [bills](https://docs.codat.io/lending-api#/schemas/Bill). +* The supplier that issued the bill credit note. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocatedOnDate` | *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 | +| `billCreditNoteNumber` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `discountPercentage` | *double* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting platform. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.BillCreditNoteLineItem](../../models/shared/BillCreditNoteLineItem.md)> | :heavy_minus_sign: | An array of line | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_minus_sign: | An array of payment allocations. | | +| `remainingCredit` | *Optional* | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.BillCreditNoteStatus](../../models/shared/BillCreditNoteStatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `subTotal` | *double* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplierRef` | [Optional](../../models/shared/SupplierRef.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `totalAmount` | *double* | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | +| `totalDiscount` | *double* | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `totalTaxAmount` | *double* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `withholdingTax` | List<[io.codat.lending.models.shared.WithholdingTaxItems](../../models/shared/WithholdingTaxItems.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBillCreditNotes.md b/lending/docs/models/shared/AccountingBillCreditNotes.md new file mode 100644 index 00000000..821f30fc --- /dev/null +++ b/lending/docs/models/shared/AccountingBillCreditNotes.md @@ -0,0 +1,12 @@ +# AccountingBillCreditNotes + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingBillCreditNote](../../models/shared/AccountingBillCreditNote.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBillPayment.md b/lending/docs/models/shared/AccountingBillPayment.md new file mode 100644 index 00000000..a35098e3 --- /dev/null +++ b/lending/docs/models/shared/AccountingBillPayment.md @@ -0,0 +1,174 @@ +# AccountingBillPayment + +> **Bill payments or payments?** +> +> We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. +> +> See [payments](https://docs.codat.io/lending-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + +> View the coverage for bill payments in the Data coverage explorer. + +## Overview + +Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/lending-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/lending-api#/schemas/BillCreditNote)). + +A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + +- A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. +- An allocation of a supplier's credit note to a bill or perhaps a refund. +- A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + +Depending on the bill payments which are allowed by the underlying accounting package, some of these types may be combined. Please see the example data section for samples of what these cases look like. + +In Codat, a bill payment contains details of: + +- When the bill payment was recorded in the accounting system. +- How much it is for and in the currency. +- Who the payment has been paid to, the _supplier_. +- The types of bill payments, the _line items_. + +Some accounting platforms give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. + +Bill payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + +--- + +## Bill payment types + +### Payment of a bill + +A payment paying a single bill should have the following properties: + +- A `totalAmount` indicating the amount of the bill that was paid. This is always positive. +- A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + +### Payment of multiple bills + +It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + +1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. +2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + +Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + +> Pushing batch payments to Xero +> +> When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + +### Payments and refunds on account + +A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + +The line has the following properties: + +- A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + +It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + +### Using a credit note to pay a bill + +The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + +- An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. +- A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +### Refunding a credit note + +A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + +- An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + +The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + +### Refunding a payment + +If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + +- One for the incoming overpayment. +- Another for the outgoing refund. + +The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + +- An **amount** indicating the amount that was refunded. This is always negative. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + +The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + +The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + +- One for £1,000 linked to the bill that was paid +- Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + +The line linked to the bill payment has the following properties: + +- An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + +> Linked payments +> +> Not all accounting packages support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + +## Foreign currencies + +There are two types of currency rate that are detailed in the bill payments data type: + +Payment currency rate: + +- Base currency of the accounts payable account. +- Foreign currency of the bill payment. + +Payment line link currency rate: + +- Base currency of the item that the link represents. +- Foreign currency of the payment. + +These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + +- The base currency for the accounts payable account. +- The currency of the item. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional* | :heavy_minus_sign: | N/A | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `date` | *String* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting platform. | 3d5a8e00-d108-4045-8823-7f342676cffa | +| `lines` | List<[io.codat.lending.models.shared.BillPaymentLine](../../models/shared/BillPaymentLine.md)> | :heavy_minus_sign: | An array of bill payment lines. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `paymentMethodRef` | [Optional](../../models/shared/PaymentMethodRef.md) | :heavy_minus_sign: | N/A | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | Additional information associated with the payment. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplierRef` | [Optional](../../models/shared/SupplierRef.md) | :heavy_minus_sign: | N/A | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. | 1329.54 | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBillPayments.md b/lending/docs/models/shared/AccountingBillPayments.md new file mode 100644 index 00000000..e9ef31cb --- /dev/null +++ b/lending/docs/models/shared/AccountingBillPayments.md @@ -0,0 +1,12 @@ +# AccountingBillPayments + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingBillPayment](../../models/shared/AccountingBillPayment.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingBills.md b/lending/docs/models/shared/AccountingBills.md new file mode 100644 index 00000000..cc39ae75 --- /dev/null +++ b/lending/docs/models/shared/AccountingBills.md @@ -0,0 +1,12 @@ +# AccountingBills + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingBill](../../models/shared/AccountingBill.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCashFlowStatement.md b/lending/docs/models/shared/AccountingCashFlowStatement.md new file mode 100644 index 00000000..66960efe --- /dev/null +++ b/lending/docs/models/shared/AccountingCashFlowStatement.md @@ -0,0 +1,27 @@ +# AccountingCashFlowStatement + +> View the coverage for cash flow statement in the Data coverage explorer. + +> **Operating activities only** +> +> Currently, the cash flow statement shows cash that flows into and out of the company from operating activities *only*. Operating activities generate cash from the sale of goods or services. + +## Overview + +A cash flow statement is a financial report that records all cash that is received or spent by a company during a given period. It gives you a clearer picture of the company’s performance, and their ability to pay creditors and finance growth. + +> **Cash flow statement or balance sheet?** +> +> Look at the cash flow statement to understand a company's ability to pay its bills. Although the balance sheet may show healthy earnings at a specific point in time, the cash flow statement allows you to see whether the company is meeting its financial commitments, such as paying creditors or its employees. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `earliestAvailableMonth` | *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 | +| `mostRecentAvailableMonth` | *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 | +| `reportBasis` | [io.codat.lending.models.shared.ReportBasis](../../models/shared/ReportBasis.md) | :heavy_check_mark: | Accounting method used when aggregating the report data. In this case, `Cash`. | | +| `reportInput` | [io.codat.lending.models.shared.ReportInput](../../models/shared/ReportInput.md) | :heavy_check_mark: | Accounting method used to prepare the cash flow statement. | | +| `reports` | List<[io.codat.lending.models.shared.CashFlowStatement](../../models/shared/CashFlowStatement.md)> | :heavy_check_mark: | Array of cash flow statements. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCompanyInfo.md b/lending/docs/models/shared/AccountingCompanyInfo.md new file mode 100644 index 00000000..933881c9 --- /dev/null +++ b/lending/docs/models/shared/AccountingCompanyInfo.md @@ -0,0 +1,29 @@ +# AccountingCompanyInfo + +> View the coverage for company profile in the Data coverage explorer. + +Company info provides standard details about a linked company such as their address, phone number, and company registration. + +> **Company information or companies?** +> +> Company profile is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountingPlatformRef` | *JsonNullable* | :heavy_minus_sign: | Identifier or reference for the company in the accounting platform. | | +| `addresses` | List<[io.codat.lending.models.shared.AccountingAddress](../../models/shared/AccountingAddress.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `baseCurrency` | *JsonNullable* | :heavy_minus_sign: | Currency set in the accounting platform of the linked company. Used by the currency rate. | | +| `companyLegalName` | *JsonNullable* | :heavy_minus_sign: | Registered legal name of the linked company. | | +| `companyName` | *JsonNullable* | :heavy_minus_sign: | Name of the linked company. | | +| `createdDate` | *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 | +| `financialYearStartDate` | *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 | +| `ledgerLockDate` | *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 | +| `phoneNumbers` | List<[io.codat.lending.models.shared.PhoneNumber](../../models/shared/PhoneNumber.md)> | :heavy_minus_sign: | An array of phone numbers. | | +| `registrationNumber` | *JsonNullable* | :heavy_minus_sign: | Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. | | +| `sourceUrls` | Map | :heavy_minus_sign: | URL addresses for the accounting source.

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

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxNumber` | *JsonNullable* | :heavy_minus_sign: | Company tax number. | | +| `webLinks` | List<[io.codat.lending.models.shared.WebLink](../../models/shared/WebLink.md)> | :heavy_minus_sign: | An array of weblinks. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateAccountResponse.md b/lending/docs/models/shared/AccountingCreateAccountResponse.md new file mode 100644 index 00000000..b822946b --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateAccountResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreateAccountResponseAccountingAccount.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateAccountResponseAccountingAccount.md b/lending/docs/models/shared/AccountingCreateAccountResponseAccountingAccount.md new file mode 100644 index 00000000..ef4edea3 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateAccountResponseAccountingAccount.md @@ -0,0 +1,54 @@ +# ~~AccountingCreateAccountResponseAccountingAccount~~ + +> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + +View the coverage for accounts in the Data coverage explorer. + +## Overview + +Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + +The categories for an account include: +* Asset +* Expense +* Income +* Liability +* Equity. + +The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + +At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + +To determine the list of allowed categories for a specific integration, you can: +- Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). +- Refer to the integration's own documentation. + +> **Accounts with no category** +> +> If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. +> +> This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currentBalance` | *JsonNullable* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fullyQualifiedCategory` | *JsonNullable* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fullyQualifiedName` | *JsonNullable* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | +| `isBankAccount` | *Optional* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominalCode` | *JsonNullable* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/AccountStatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional](../../models/shared/AccountType.md) | :heavy_minus_sign: | Type of account | Asset | +| `validDatatypeLinks` | List<[io.codat.lending.models.shared.AccountingCreateAccountResponseValidDataTypeLinks](../../models/shared/AccountingCreateAccountResponseValidDataTypeLinks.md)> | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.md b/lending/docs/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.md new file mode 100644 index 00000000..a2969b5a --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.md @@ -0,0 +1,50 @@ +# AccountingCreateAccountResponseValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List<*String*> | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *JsonNullable* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateBankAccountResponse.md b/lending/docs/models/shared/AccountingCreateBankAccountResponse.md new file mode 100644 index 00000000..82119189 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateBankAccountResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.md b/lending/docs/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.md new file mode 100644 index 00000000..f7a198f8 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.md @@ -0,0 +1,42 @@ +# ~~AccountingCreateBankAccountResponseAccountingBankAccount~~ + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/schemas/Account) + +> View the coverage for bank accounts in the Data coverage explorer. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting platform. +* The currency and balance of the account. +* The sort code and account number. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *JsonNullable* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | +| `accountNumber` | *JsonNullable* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

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

## Unknown currencies

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

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

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

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

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateBankAccountTransactions.md b/lending/docs/models/shared/AccountingCreateBankAccountTransactions.md new file mode 100644 index 00000000..7595aa36 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateBankAccountTransactions.md @@ -0,0 +1,11 @@ +# ~~AccountingCreateBankAccountTransactions~~ + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `accountId` | *Optional* | :heavy_minus_sign: | Unique identifier for a bank account. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `transactions` | List<[io.codat.lending.models.shared.CreateBankAccountTransaction](../../models/shared/CreateBankAccountTransaction.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateBankTransactions.md b/lending/docs/models/shared/AccountingCreateBankTransactions.md new file mode 100644 index 00000000..f9644b88 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateBankTransactions.md @@ -0,0 +1,9 @@ +# AccountingCreateBankTransactions + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `accountId` | *Optional* | :heavy_minus_sign: | Unique identifier for a bank account. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `transactions` | List<[io.codat.lending.models.shared.CreateBankAccountTransaction](../../models/shared/CreateBankAccountTransaction.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateBankTransactionsResponse.md b/lending/docs/models/shared/AccountingCreateBankTransactionsResponse.md new file mode 100644 index 00000000..a993eea0 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateBankTransactionsResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateBankTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [Optional](../../models/shared/AccountingCreateBankAccountTransactions.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateDirectCostResponse.md b/lending/docs/models/shared/AccountingCreateDirectCostResponse.md new file mode 100644 index 00000000..d2ef5cf3 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateDirectCostResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateDirectCostResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.md b/lending/docs/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.md new file mode 100644 index 00000000..cfc5fb16 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.md @@ -0,0 +1,41 @@ +# ~~AccountingCreateDirectCostResponseAccountingDirectCost~~ + +> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. + +> View the coverage for direct costs in the Data coverage explorer. + +## Overview + +Direct costs are the expenses associated with a business' operations. For example, purchases of raw materials and service fees are considered direct costs. + +Direct costs include: + * Purchasing an item and paying it off at the point of the purchase + * Receiving cash from a refunded item if the refund is made by the supplier + * Withdrawing money from a bank account + * Writing a cheque + +Direct costs is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/AccountingCreateDirectCostResponseContactReference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.DirectCostLineItem](../../models/shared/DirectCostLineItem.md)> | :heavy_check_mark: | An array of line items. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_check_mark: | An array of payment allocations. | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `subTotal` | *double* | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxAmount` | *double* | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `totalAmount` | *double* | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateDirectCostResponseContactReference.md b/lending/docs/models/shared/AccountingCreateDirectCostResponseContactReference.md new file mode 100644 index 00000000..d958619d --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateDirectCostResponseContactReference.md @@ -0,0 +1,11 @@ +# AccountingCreateDirectCostResponseContactReference + +A customer or supplier associated with the direct cost. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [JsonNullable](../../models/shared/AccountingCreateDirectCostResponseDataType.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *String* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateDirectCostResponseDataType.md b/lending/docs/models/shared/AccountingCreateDirectCostResponseDataType.md new file mode 100644 index 00000000..6dcea57c --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateDirectCostResponseDataType.md @@ -0,0 +1,11 @@ +# AccountingCreateDirectCostResponseDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreatePaymentResponse.md b/lending/docs/models/shared/AccountingCreatePaymentResponse.md new file mode 100644 index 00000000..fbd6686e --- /dev/null +++ b/lending/docs/models/shared/AccountingCreatePaymentResponse.md @@ -0,0 +1,21 @@ +# AccountingCreatePaymentResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreatePaymentResponseAccountingPayment.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreatePaymentResponseAccountingPayment.md b/lending/docs/models/shared/AccountingCreatePaymentResponseAccountingPayment.md new file mode 100644 index 00000000..c8c63789 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreatePaymentResponseAccountingPayment.md @@ -0,0 +1,703 @@ +# ~~AccountingCreatePaymentResponseAccountingPayment~~ + +> **Payments or bill payments?** +> +> In Codat, payments represent accounts receivable only. For accounts payable, see [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). These include [bills](https://docs.codat.io/lending-api#/schemas/Bill) and credit notes against bills. + +> View the coverage for payments in the Data coverage explorer. + +## Overview + +Payments include all accounts receivable transaction data. This includes [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + +A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to: + +- A payment made against an invoice, like a credit card, cheque, or cash payment. +- An allocation of a customer's credit note, either to an invoice or maybe a refund. +- A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. + +Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. + +In Codat, a payment contains details of: + +- When the payment was recorded in the accounting system. +- How much it is for and in what currency that amount is in. +- Who the payment was _paid by_ – the _customer_. +- The payment method used. +- The breakdown of the types of payments – the _line items_. + +Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + +## Payment types + +## Payment of an invoice + +A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties: + +- An _amount_ that indicates the amount of the invoice that was paid. This is always positive. +- A **links** array containing one element with the following properties: + - A **type** that indicates the type of **link**, in this case an `Invoice`. + - An **id** that contains the ID of the invoice that was paid. + - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +## Payment of multiple invoices + +A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books: + +- The payment has multiple entries in its **lines** array, one for each invoice that is paid. Each line follows the example and rules described in [Payment of an invoice](#payment-of-an-invoice). +- The payment has a line with multiple links to each invoice. This occurs when the proportion of the original payment allocated to each invoice is not available. + +Each **line** has the same properties as those described in [Payment of an invoice](#payment-of-an-invoice), with the **amount** indicating how much of the payment was allocated to the invoice. The sum of line amounts equals the **totalAmount** on the payment. + +## Payments and refunds on account + +A payment on account, that is a payment that doesn’t pay a specific invoice, has one entry in its lines array. The **line** has the following properties: + +- A **totalAmount** that indicates the amount paid by a customer or refunded to them by a company. A payment to the customer is always negative. A refund is always positive. +- A **links** array containing one element with the following properties: +- A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. +- The **id** containing the ID of the customer. +- The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund. + +It is possible to have a payment that is part _on account_ and part _allocated_ to an invoice. Each line should follow the examples above. + +## Using a credit note to pay an invoice + +The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties: + +- An **amount** that indicates the amount of money moved, which in this case is `0`, as the credit note and invoice allocation must balance each other. +- A **links** array containing two elements: + - The first **link** has: + - A **type** that indicates the type of **link**, in this case an `Invoice`. + - An **id** that contains the ID of the invoice that was paid. + - The second **link** has: + - A **type** that indicates the type of **link**, in this case a `CreditNote`. + - An **id** that contains the ID of the credit note used by this payment. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +## Refunding a credit note + +A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties: + +- An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund. +- A **links** array that contains one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `CreditNote`. + - An **id** that contains the ID of the credit note that was refunded. + +The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable. + +## Refunding a payment + +If a payment is refunded, for example, if a customer overpaid an invoice and the overpayment is returned to the customer, there are two payment records: + +- One for the incoming over payment. +- Another for the outgoing refund. + +The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties: + +- An **amount** that indicates the amount that was refunded. This is always negative. +- A **links** array that contains one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `Payment`. + - An **id** that contains the ID of the payment that was refunded. + +The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable. + +The payment that was refunded has a line where the **amount** is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was used to partly pay an invoice. + +For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines: + +- One for £1,000 linked to the invoice that was paid. +- Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment. + +The **line** linked to the payment has the following properties: + +- An **amount** that indicates the amount that was refunded. This is positive as its money that was added to accounts receivable. It's balanced out by the negative amount of the refund. +- A **links** array containing one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `Refund`. + - An **id** that contains the ID of the payment that refunded this line. + +> **Support for linked payments** +> +> Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. + +## Foreign currencies + +There are two types of currency rate that are included in the payments data type: + +Payment currency rate: + +- Base currency of the accounts receivable account. +- Foreign currency of the payment. + +Payment line link currency rate: + +- Base currency of the item the link represents. +- Foreign currency of the payment. + +These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a payment is applied to an item in a currency that doesn't match either: + +- The base currency for the accounts receivable account. +- The currency of the item. + + ```json title="Currency rate example" + { + "id": "123", + "note": "", + "totalAmount": 99.99, + "currency": "GBP", + "lines": [ + { + "amount": 99.99, + "links": [ + { + "type": "Invoice", + "id": "178", + "amount": -50, + "currencyRate": 1.9998 + } + ] + } + ] + } + ``` + + + +## Example data + +> **Object properties** +> +> For the sake of brevity, the examples here may omit properties from objects. For the full object definition, see [Payments](https://api.codat.io/swagger/index.html#/Payments). + +## Simple examples + + ```json title="Payment for invoice" + { + "totalAmount": 1000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Allocation of credit note" + { + "totalAmount": 0, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Payment of invoice and payment on account" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "y", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Refund of credit note" + { + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Refund on accounts receivable account" + { + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Linked refund on accounts receivable account" + { + "id" : "payment-001", + "totalAmount": 1000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Refund", + "id" : "refund-001", + "amount" : -1000 + } + ] + } + ] + } + { + "id" : "refund-001", + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "Payment", + "id" : "payment-001", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Using a credit note and cash to pay an invoice" + { + "totalAmount": 250, + "lines": [ + { + "amount": 0, + "links": [ + { + "type": "Invoice", + "id": "x", + "amount": -750 + }, + { + "type": "CreditNote", + "id": "y", + "amount": 750 + } + ] + }, + { + "amount": 250, + "links": [ + { + "type": "Invoice", + "id": "x", + "amount": -250 + } + ] + } + ] + } + ``` + + + +## Complex examples + + ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice" + { + "totalAmount": 1000, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + }, + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + }, + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "customer-001", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes pay two invoices with no allocation amount specified" + { + "totalAmount": 0, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "w", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "w", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "u", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Refund", + "id" : "refund-001", + "amount" : -1000 + } + ] + } + ] + } + { + "id" : "refund-001", + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "Payment", + "id" : "payment-001", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + +In this example, a payment on account is used to pay the same invoice in January and again in February. + + ```json title="January" + { + "id": "001", + "totalAmount": 5000, + "date" : "1901-01-01", + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-x", + "amount" : -1000 + } + ] + }, + { + "amount" : 4000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "PaymentOnAccount-y", + "amount" : -4000 + } + ] + } + ] + } + ``` + + + + ```json title="February" + { + "id": "001", + "totalAmount": 5000, + "date" : "1901-02-01", + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-y", + "amount" : -1000 + } + ] + }, + { + "amount" : 3000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "PaymentOnAccount-y", + "amount" : -3000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes and some cash pay two invoices with no allocations specified" + { + "totalAmount": 500, + "lines": [ + { + "amount": 500, + "links": [{ + "type": "Invoice", + "id": "a", + "amount": -1000 + }, { + "type": "Invoice", + "id": "b", + "amount": -1000 + }, { + "type": "CreditNote", + "id": "y", + "amount": 750 + },{ + "type": "CreditNote", + "id": "z", + "amount": 750 + } + ] + } + ] + } + ``` + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | | +| `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 | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | | +| `lines` | List<[io.codat.lending.models.shared.PaymentLine](../../models/shared/PaymentLine.md)> | :heavy_minus_sign: | An array of payment lines. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any additional information associated with the payment. | | +| `paymentMethodRef` | [Optional](../../models/shared/PaymentMethodRef.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the payment. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateSupplierResponse.md b/lending/docs/models/shared/AccountingCreateSupplierResponse.md new file mode 100644 index 00000000..d681681f --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateSupplierResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreateSupplierResponseAccountingSupplier.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateSupplierResponseAccountingSupplier.md b/lending/docs/models/shared/AccountingCreateSupplierResponseAccountingSupplier.md new file mode 100644 index 00000000..2f5a4555 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateSupplierResponseAccountingSupplier.md @@ -0,0 +1,29 @@ +# ~~AccountingCreateSupplierResponseAccountingSupplier~~ + +> View the coverage for suppliers in the Data coverage explorer. + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/lending-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/lending-api#/schemas/Bill). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | List<[io.codat.lending.models.shared.AccountingAddress](../../models/shared/AccountingAddress.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `contactName` | *JsonNullable* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `defaultCurrency` | *JsonNullable* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `emailAddress` | *JsonNullable* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *JsonNullable* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registrationNumber` | *JsonNullable* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.SupplierStatus](../../models/shared/SupplierStatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplierName` | *JsonNullable* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `taxNumber` | *JsonNullable* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateTransferResponse.md b/lending/docs/models/shared/AccountingCreateTransferResponse.md new file mode 100644 index 00000000..b5ac0ad1 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateTransferResponse.md @@ -0,0 +1,21 @@ +# AccountingCreateTransferResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `data` | [JsonNullable](../../models/shared/AccountingCreateTransferResponseAccountingTransfer.md) | :heavy_minus_sign: | N/A | | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreateTransferResponseAccountingTransfer.md b/lending/docs/models/shared/AccountingCreateTransferResponseAccountingTransfer.md new file mode 100644 index 00000000..981d0c71 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreateTransferResponseAccountingTransfer.md @@ -0,0 +1,25 @@ +# ~~AccountingCreateTransferResponseAccountingTransfer~~ + +> View the coverage for transfers in the Data coverage explorer. + +A transfer records the movement of money between two bank accounts, or between a bank account and a nominal account. It is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/ContactRef.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `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 | +| `depositedRecordRefs` | List<[io.codat.lending.models.shared.RecordRef](../../models/shared/RecordRef.md)> | :heavy_minus_sign: | List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. | | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description of the transfer. | | +| `from` | [Optional](../../models/shared/TransferAccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the transfer. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `to` | [Optional](../../models/shared/TransferAccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | +| `trackingCategoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | Reference to the tracking categories this transfer is being tracked against. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreditNote.md b/lending/docs/models/shared/AccountingCreditNote.md new file mode 100644 index 00000000..02f1d5d8 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreditNote.md @@ -0,0 +1,44 @@ +# AccountingCreditNote + +> View the coverage for credit notes in the Data coverage explorer. + +## Overview + +Think of a credit note as a voucher issued to a customer. It is a reduction that can be applied against one or multiple invoices. A credit note can either reduce the amount owed or cancel out an invoice entirely. + +In the Codat system a credit note is issued to a [customer's](https://docs.codat.io/lending-api#/schemas/Customer) accounts receivable. + +It contains details of: +* The amount of credit remaining and its status. +* Payment allocations against the payments type, in this case an invoice. +* Which customers the credit notes have been issued to. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalTaxAmount` | *Optional* | :heavy_minus_sign: | Additional tax amount applied to credit note. | | +| `additionalTaxPercentage` | *Optional* | :heavy_minus_sign: | Percentage rate of any additional tax applied to the credit note. | | +| `allocatedOnDate` | *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 | +| `creditNoteNumber` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the credit note. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | | +| `discountPercentage` | *double* | :heavy_check_mark: | Percentage rate (from 0 to 100) of discounts applied to the credit note. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the credit note, unique to the company in the accounting platform. | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.CreditNoteLineItem](../../models/shared/CreditNoteLineItem.md)> | :heavy_minus_sign: | N/A | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_minus_sign: | An array of payment allocations. | | +| `remainingCredit` | *double* | :heavy_check_mark: | Unused balance of totalAmount originally raised. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.CreditNoteStatus](../../models/shared/CreditNoteStatus.md) | :heavy_check_mark: | Current state of the credit note. | | +| `subTotal` | *double* | :heavy_check_mark: | Value of the credit note, including discounts and excluding tax. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *double* | :heavy_check_mark: | Total amount of credit that has been applied to the customer's accounts receivable | | +| `totalDiscount` | *double* | :heavy_check_mark: | Any discounts applied to the credit note amount. | | +| `totalTaxAmount` | *double* | :heavy_check_mark: | Any tax applied to the credit note amount. | | +| `withholdingTax` | List<[io.codat.lending.models.shared.WithholdingTaxItems](../../models/shared/WithholdingTaxItems.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCreditNotes.md b/lending/docs/models/shared/AccountingCreditNotes.md new file mode 100644 index 00000000..db2436a6 --- /dev/null +++ b/lending/docs/models/shared/AccountingCreditNotes.md @@ -0,0 +1,12 @@ +# AccountingCreditNotes + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingCreditNote](../../models/shared/AccountingCreditNote.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCustomer.md b/lending/docs/models/shared/AccountingCustomer.md new file mode 100644 index 00000000..ef38cccf --- /dev/null +++ b/lending/docs/models/shared/AccountingCustomer.md @@ -0,0 +1,31 @@ +# AccountingCustomer + +> View the coverage for customers in the Data coverage explorer. + +## Overview + +A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + +Customers' data links to accounts receivable [invoices](https://docs.codat.io/lending-api#/schemas/Invoice). + + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | List<[io.codat.lending.models.shared.AccountingAddress](../../models/shared/AccountingAddress.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `contactName` | *JsonNullable* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | +| `contacts` | List<[io.codat.lending.models.shared.Contact](../../models/shared/Contact.md)> | :heavy_minus_sign: | An array of Contacts. | | +| `customerName` | *JsonNullable* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | +| `defaultCurrency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `emailAddress` | *JsonNullable* | :heavy_minus_sign: | Email address the customer can be contacted by. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting platform. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *JsonNullable* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | +| `registrationNumber` | *JsonNullable* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.CustomerStatus](../../models/shared/CustomerStatus.md) | :heavy_check_mark: | Status of customer. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxNumber` | *JsonNullable* | :heavy_minus_sign: | Company tax number. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCustomerRef.md b/lending/docs/models/shared/AccountingCustomerRef.md new file mode 100644 index 00000000..549a429a --- /dev/null +++ b/lending/docs/models/shared/AccountingCustomerRef.md @@ -0,0 +1,9 @@ +# AccountingCustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `companyName` | *JsonNullable* | :heavy_minus_sign: | `customerName` from the Customer data type | +| `id` | *String* | :heavy_check_mark: | `id` from the Customers data type | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingCustomers.md b/lending/docs/models/shared/AccountingCustomers.md new file mode 100644 index 00000000..7f895636 --- /dev/null +++ b/lending/docs/models/shared/AccountingCustomers.md @@ -0,0 +1,12 @@ +# AccountingCustomers + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingCustomer](../../models/shared/AccountingCustomer.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectCost.md b/lending/docs/models/shared/AccountingDirectCost.md new file mode 100644 index 00000000..c9f93e21 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectCost.md @@ -0,0 +1,39 @@ +# AccountingDirectCost + +> **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. + +> View the coverage for direct costs in the Data coverage explorer. + +## Overview + +Direct costs are the expenses associated with a business' operations. For example, purchases of raw materials and service fees are considered direct costs. + +Direct costs include: + * Purchasing an item and paying it off at the point of the purchase + * Receiving cash from a refunded item if the refund is made by the supplier + * Withdrawing money from a bank account + * Writing a cheque + +Direct costs is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/AccountingDirectCostContactReference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier of the direct cost, unique for the company. | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.DirectCostLineItem](../../models/shared/DirectCostLineItem.md)> | :heavy_check_mark: | An array of line items. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_check_mark: | An array of payment allocations. | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `subTotal` | *double* | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxAmount` | *double* | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `totalAmount` | *double* | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectCostContactReference.md b/lending/docs/models/shared/AccountingDirectCostContactReference.md new file mode 100644 index 00000000..2ddd8433 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectCostContactReference.md @@ -0,0 +1,11 @@ +# AccountingDirectCostContactReference + +A customer or supplier associated with the direct cost. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `dataType` | [JsonNullable](../../models/shared/AccountingDirectCostDataType.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *String* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectCostDataType.md b/lending/docs/models/shared/AccountingDirectCostDataType.md new file mode 100644 index 00000000..4228f189 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectCostDataType.md @@ -0,0 +1,11 @@ +# AccountingDirectCostDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectCosts.md b/lending/docs/models/shared/AccountingDirectCosts.md new file mode 100644 index 00000000..8c663444 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectCosts.md @@ -0,0 +1,12 @@ +# AccountingDirectCosts + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingDirectCost](../../models/shared/AccountingDirectCost.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectIncome.md b/lending/docs/models/shared/AccountingDirectIncome.md new file mode 100644 index 00000000..4d9ca3c2 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectIncome.md @@ -0,0 +1,40 @@ +# AccountingDirectIncome + +> **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting platforms. + +> View the coverage for direct incomes in the Data coverage explorer. + +## Overview + +Direct incomes are incomes received directly from the business' operations. For example, cash sales of items to a customer, referral commissions, and service fee refunds are considered direct incomes. + +Direct incomes include: + +- Selling an item directly to a contact, and receiving payment at the point of the sale. +- Refunding an item in cash to a contact. +- Depositing money into a bank account. + +Direct incomes is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/ContactRef.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier of the direct income, unique for the company. | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.DirectIncomeLineItem](../../models/shared/DirectIncomeLineItem.md)> | :heavy_check_mark: | An array of line items. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_check_mark: | N/A | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | User-friendly reference for the direct income. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `subTotal` | *double* | :heavy_check_mark: | The total amount of the direct incomes, excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxAmount` | *double* | :heavy_check_mark: | The total amount of tax on the direct incomes. | | +| `totalAmount` | *double* | :heavy_check_mark: | The amount of the direct incomes, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingDirectIncomes.md b/lending/docs/models/shared/AccountingDirectIncomes.md new file mode 100644 index 00000000..b274f5b9 --- /dev/null +++ b/lending/docs/models/shared/AccountingDirectIncomes.md @@ -0,0 +1,12 @@ +# AccountingDirectIncomes + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingDirectIncome](../../models/shared/AccountingDirectIncome.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingInvoice.md b/lending/docs/models/shared/AccountingInvoice.md new file mode 100644 index 00000000..320ecb00 --- /dev/null +++ b/lending/docs/models/shared/AccountingInvoice.md @@ -0,0 +1,63 @@ +# AccountingInvoice + +> **Invoices or bills?** +> +> We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company issued an invoice, and is owed money (accounts receivable) we call this an Invoice. +> +> See [Bills](https://docs.codat.io/lending-api#/schemas/Bill) for the accounts payable equivalent of bills. + +View the coverage for invoices in the Data coverage explorer. + +## Overview + +An invoice is an itemized record of goods sold or services provided to a [customer](https://docs.codat.io/lending-api#/schemas/Customer). + +In Codat, an invoice contains details of: + +- The timeline of the invoice—when it was raised, marked as paid, last edited, and so on. +- How much the invoice is for, what portion of the invoice is tax or discounts, and what currency the amounts are represented in. +- Who the invoice has been raised to; the _customer_. +- The breakdown of what the invoice is for; the _line items_. +- Any [payments](https://docs.codat.io/lending-api#/schemas/Payment) assigned to the invoice; the _payment allocations_. + +> **Invoice PDF downloads** +> +> You can download a PDF version of an invoice for supported integrations. +> +> The filename will be invoice-{number}.pdf. + +> **Referencing an invoice in Sage 50 and ClearBooks** +> +> In Sage 50 and ClearBooks, you may prefer to use the **invoiceNumber** to identify an invoice rather than the invoice **id**. Each time a draft invoice is submitted or printed, the draft **id** becomes void and a submitted invoice with a new **id** exists in its place. In both platforms, the **invoiceNumber** should remain the same. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalTaxAmount` | *Optional* | :heavy_minus_sign: | Additional tax amount applied to invoice. | | +| `additionalTaxPercentage` | *Optional* | :heavy_minus_sign: | Percentage rate of any additional tax applied to the invoice. | | +| `amountDue` | *double* | :heavy_check_mark: | Amount outstanding on the invoice. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. | | +| `dueDate` | *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 | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the invoice, unique to the company in the accounting platform. | | +| `invoiceNumber` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.InvoiceLineItem](../../models/shared/InvoiceLineItem.md)> | :heavy_minus_sign: | An array of line items. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. | | +| `paidOnDate` | *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 | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_minus_sign: | An array of payment allocations. | | +| `salesOrderRefs` | List<[io.codat.lending.models.shared.SalesOrderReference](../../models/shared/SalesOrderReference.md)> | :heavy_minus_sign: | List of references to related Sales orders. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.InvoiceStatus](../../models/shared/InvoiceStatus.md) | :heavy_check_mark: | Current state of the invoice:

- `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email.
- `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount).
- `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount).
- `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0).
- `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. | | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Total amount of the invoice excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *double* | :heavy_check_mark: | Amount of the invoice, inclusive of tax. | | +| `totalDiscount` | *JsonNullable* | :heavy_minus_sign: | Numerical value of discounts applied to the invoice. | | +| `totalTaxAmount` | *double* | :heavy_check_mark: | Amount of tax on the invoice. | | +| `withholdingTax` | List<[io.codat.lending.models.shared.WithholdingTaxItems](../../models/shared/WithholdingTaxItems.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingInvoiceDataType.md b/lending/docs/models/shared/AccountingInvoiceDataType.md new file mode 100644 index 00000000..6ec5eacd --- /dev/null +++ b/lending/docs/models/shared/AccountingInvoiceDataType.md @@ -0,0 +1,10 @@ +# AccountingInvoiceDataType + +The underlying data type associated to the reference `id`. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `SALES_ORDERS` | salesOrders | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingInvoices.md b/lending/docs/models/shared/AccountingInvoices.md new file mode 100644 index 00000000..a4639b83 --- /dev/null +++ b/lending/docs/models/shared/AccountingInvoices.md @@ -0,0 +1,12 @@ +# AccountingInvoices + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingInvoice](../../models/shared/AccountingInvoice.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingJournal.md b/lending/docs/models/shared/AccountingJournal.md new file mode 100644 index 00000000..2b5b5365 --- /dev/null +++ b/lending/docs/models/shared/AccountingJournal.md @@ -0,0 +1,42 @@ +# AccountingJournal + +> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) data type + +> View the coverage for journals in the Data coverage explorer. + +## Overview + +In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/lending-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + +When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + +Such journals can be divided into two categories: + +- Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. +- General journals: journals used to record transactions that fall outside the scope of the special journals. + +Multiple journals or subjournals are used in the following Codat integrations: + +- [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) +- [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) +- [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + +> When pushing journal entries to an accounting platform that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdOn` | *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 | +| `hasChildren` | *Optional* | :heavy_minus_sign: | If the journal has child journals, this value is true. If it doesn’t, it is false. | | +| `id` | *Optional* | :heavy_minus_sign: | Journal ID. | | +| `journalCode` | *JsonNullable* | :heavy_minus_sign: | Native journal number or code. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *JsonNullable* | :heavy_minus_sign: | Journal name.
The maximum length for a journal name is 256 characters. All characters above that number will be truncated. | | +| `parentId` | *JsonNullable* | :heavy_minus_sign: | Parent journal ID.
If the journal is a parent journal, this value is not present. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/JournalStatus.md) | :heavy_minus_sign: | Current journal status. | | +| `type` | *JsonNullable* | :heavy_minus_sign: | The type of the journal. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingJournalEntries.md b/lending/docs/models/shared/AccountingJournalEntries.md new file mode 100644 index 00000000..743ad137 --- /dev/null +++ b/lending/docs/models/shared/AccountingJournalEntries.md @@ -0,0 +1,12 @@ +# AccountingJournalEntries + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingJournalEntry](../../models/shared/AccountingJournalEntry.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingJournalEntry.md b/lending/docs/models/shared/AccountingJournalEntry.md new file mode 100644 index 00000000..aecb809f --- /dev/null +++ b/lending/docs/models/shared/AccountingJournalEntry.md @@ -0,0 +1,42 @@ +# AccountingJournalEntry + +> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/lending-api#/schemas/Journal) data type + +> View the coverage for journal entries in the Data coverage explorer. + +## Overview + +A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/lending-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + +A journal entry line item is a single transaction line on the journal entry. For example: + +- When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. +- When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + +In Codat a journal entry contains details of: + +- The date on which the entry was created and posted. +- Itemised lines, including amounts and currency. +- A reference to the associated accounts. +- A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + +> **Pushing journal entries** +> Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdOn` | *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: | Optional description of the journal entry. | | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier of the journal entry for the company in the accounting platform. | | +| `journalLines` | List<[io.codat.lending.models.shared.JournalLine](../../models/shared/JournalLine.md)> | :heavy_minus_sign: | An array of journal lines. | | +| `journalRef` | [Optional](../../models/shared/JournalRef.md) | :heavy_minus_sign: | Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `postedOn` | *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 | +| `recordRef` | [Optional](../../models/shared/JournalEntryRecordRef.md) | :heavy_minus_sign: | Links a journal entry to the underlying record that created it. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `updatedOn` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingJournals.md b/lending/docs/models/shared/AccountingJournals.md new file mode 100644 index 00000000..5720cefb --- /dev/null +++ b/lending/docs/models/shared/AccountingJournals.md @@ -0,0 +1,12 @@ +# AccountingJournals + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingJournal](../../models/shared/AccountingJournal.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingPayment.md b/lending/docs/models/shared/AccountingPayment.md new file mode 100644 index 00000000..5108e81c --- /dev/null +++ b/lending/docs/models/shared/AccountingPayment.md @@ -0,0 +1,701 @@ +# AccountingPayment + +> **Payments or bill payments?** +> +> In Codat, payments represent accounts receivable only. For accounts payable, see [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). These include [bills](https://docs.codat.io/lending-api#/schemas/Bill) and credit notes against bills. + +> View the coverage for payments in the Data coverage explorer. + +## Overview + +Payments include all accounts receivable transaction data. This includes [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + +A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to: + +- A payment made against an invoice, like a credit card, cheque, or cash payment. +- An allocation of a customer's credit note, either to an invoice or maybe a refund. +- A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. + +Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. + +In Codat, a payment contains details of: + +- When the payment was recorded in the accounting system. +- How much it is for and in what currency that amount is in. +- Who the payment was _paid by_ – the _customer_. +- The payment method used. +- The breakdown of the types of payments – the _line items_. + +Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + +## Payment types + +## Payment of an invoice + +A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties: + +- An _amount_ that indicates the amount of the invoice that was paid. This is always positive. +- A **links** array containing one element with the following properties: + - A **type** that indicates the type of **link**, in this case an `Invoice`. + - An **id** that contains the ID of the invoice that was paid. + - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +## Payment of multiple invoices + +A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books: + +- The payment has multiple entries in its **lines** array, one for each invoice that is paid. Each line follows the example and rules described in [Payment of an invoice](#payment-of-an-invoice). +- The payment has a line with multiple links to each invoice. This occurs when the proportion of the original payment allocated to each invoice is not available. + +Each **line** has the same properties as those described in [Payment of an invoice](#payment-of-an-invoice), with the **amount** indicating how much of the payment was allocated to the invoice. The sum of line amounts equals the **totalAmount** on the payment. + +## Payments and refunds on account + +A payment on account, that is a payment that doesn’t pay a specific invoice, has one entry in its lines array. The **line** has the following properties: + +- A **totalAmount** that indicates the amount paid by a customer or refunded to them by a company. A payment to the customer is always negative. A refund is always positive. +- A **links** array containing one element with the following properties: +- A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. +- The **id** containing the ID of the customer. +- The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund. + +It is possible to have a payment that is part _on account_ and part _allocated_ to an invoice. Each line should follow the examples above. + +## Using a credit note to pay an invoice + +The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties: + +- An **amount** that indicates the amount of money moved, which in this case is `0`, as the credit note and invoice allocation must balance each other. +- A **links** array containing two elements: + - The first **link** has: + - A **type** that indicates the type of **link**, in this case an `Invoice`. + - An **id** that contains the ID of the invoice that was paid. + - The second **link** has: + - A **type** that indicates the type of **link**, in this case a `CreditNote`. + - An **id** that contains the ID of the credit note used by this payment. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +## Refunding a credit note + +A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties: + +- An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund. +- A **links** array that contains one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `CreditNote`. + - An **id** that contains the ID of the credit note that was refunded. + +The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable. + +## Refunding a payment + +If a payment is refunded, for example, if a customer overpaid an invoice and the overpayment is returned to the customer, there are two payment records: + +- One for the incoming over payment. +- Another for the outgoing refund. + +The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties: + +- An **amount** that indicates the amount that was refunded. This is always negative. +- A **links** array that contains one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `Payment`. + - An **id** that contains the ID of the payment that was refunded. + +The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable. + +The payment that was refunded has a line where the **amount** is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was used to partly pay an invoice. + +For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines: + +- One for £1,000 linked to the invoice that was paid. +- Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment. + +The **line** linked to the payment has the following properties: + +- An **amount** that indicates the amount that was refunded. This is positive as its money that was added to accounts receivable. It's balanced out by the negative amount of the refund. +- A **links** array containing one element with the following properties: + - A **type** that indicates the type of **link**, in this case a `Refund`. + - An **id** that contains the ID of the payment that refunded this line. + +> **Support for linked payments** +> +> Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. + +## Foreign currencies + +There are two types of currency rate that are included in the payments data type: + +Payment currency rate: + +- Base currency of the accounts receivable account. +- Foreign currency of the payment. + +Payment line link currency rate: + +- Base currency of the item the link represents. +- Foreign currency of the payment. + +These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a payment is applied to an item in a currency that doesn't match either: + +- The base currency for the accounts receivable account. +- The currency of the item. + + ```json title="Currency rate example" + { + "id": "123", + "note": "", + "totalAmount": 99.99, + "currency": "GBP", + "lines": [ + { + "amount": 99.99, + "links": [ + { + "type": "Invoice", + "id": "178", + "amount": -50, + "currencyRate": 1.9998 + } + ] + } + ] + } + ``` + + + +## Example data + +> **Object properties** +> +> For the sake of brevity, the examples here may omit properties from objects. For the full object definition, see [Payments](https://api.codat.io/swagger/index.html#/Payments). + +## Simple examples + + ```json title="Payment for invoice" + { + "totalAmount": 1000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Allocation of credit note" + { + "totalAmount": 0, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Payment of invoice and payment on account" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "y", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Refund of credit note" + { + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Refund on accounts receivable account" + { + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "y", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Linked refund on accounts receivable account" + { + "id" : "payment-001", + "totalAmount": 1000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Refund", + "id" : "refund-001", + "amount" : -1000 + } + ] + } + ] + } + { + "id" : "refund-001", + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "Payment", + "id" : "payment-001", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Using a credit note and cash to pay an invoice" + { + "totalAmount": 250, + "lines": [ + { + "amount": 0, + "links": [ + { + "type": "Invoice", + "id": "x", + "amount": -750 + }, + { + "type": "CreditNote", + "id": "y", + "amount": 750 + } + ] + }, + { + "amount": 250, + "links": [ + { + "type": "Invoice", + "id": "x", + "amount": -250 + } + ] + } + ] + } + ``` + + + +## Complex examples + + ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice" + { + "totalAmount": 1000, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + }, + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + } + ] + }, + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "customer-001", + "amount" : -1000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes pay two invoices with no allocation amount specified" + { + "totalAmount": 0, + "lines": [ + { + "amount" : 0, + "links" : [ + { + "type" : "Invoice", + "id" : "w", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash" + { + "totalAmount": 2000, + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "w", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "x", + "amount" : -1000 + }, + { + "type" : "Invoice", + "id" : "u", + "amount" : -1000 + }, + { + "type" : "CreditNote", + "id" : "y", + "amount" : 1000 + }, + { + "type" : "CreditNote", + "id" : "z", + "amount" : 1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Refund", + "id" : "refund-001", + "amount" : -1000 + } + ] + } + ] + } + { + "id" : "refund-001", + "totalAmount": -1000, + "lines": [ + { + "amount" : -1000, + "links" : [ + { + "type" : "Payment", + "id" : "payment-001", + "amount" : 1000 + } + ] + } + ] + } + ``` + + + +In this example, a payment on account is used to pay the same invoice in January and again in February. + + ```json title="January" + { + "id": "001", + "totalAmount": 5000, + "date" : "1901-01-01", + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-x", + "amount" : -1000 + } + ] + }, + { + "amount" : 4000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "PaymentOnAccount-y", + "amount" : -4000 + } + ] + } + ] + } + ``` + + + + ```json title="February" + { + "id": "001", + "totalAmount": 5000, + "date" : "1901-02-01", + "lines": [ + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-x", + "amount" : -1000 + } + ] + }, + { + "amount" : 1000, + "links" : [ + { + "type" : "Invoice", + "id" : "Invoice-y", + "amount" : -1000 + } + ] + }, + { + "amount" : 3000, + "links" : [ + { + "type" : "PaymentOnAccount", + "id" : "PaymentOnAccount-y", + "amount" : -3000 + } + ] + } + ] + } + ``` + + + + ```json title="Two credit notes and some cash pay two invoices with no allocations specified" + { + "totalAmount": 500, + "lines": [ + { + "amount": 500, + "links": [{ + "type": "Invoice", + "id": "a", + "amount": -1000 + }, { + "type": "Invoice", + "id": "b", + "amount": -1000 + }, { + "type": "CreditNote", + "id": "y", + "amount": 750 + },{ + "type": "CreditNote", + "id": "z", + "amount": 750 + } + ] + } + ] + } + ``` + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | | +| `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 | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | | +| `lines` | List<[io.codat.lending.models.shared.PaymentLine](../../models/shared/PaymentLine.md)> | :heavy_minus_sign: | An array of payment lines. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *JsonNullable* | :heavy_minus_sign: | Any additional information associated with the payment. | | +| `paymentMethodRef` | [Optional](../../models/shared/PaymentMethodRef.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the payment. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingPaymentAllocation.md b/lending/docs/models/shared/AccountingPaymentAllocation.md new file mode 100644 index 00000000..f6a3c875 --- /dev/null +++ b/lending/docs/models/shared/AccountingPaymentAllocation.md @@ -0,0 +1,9 @@ +# AccountingPaymentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `allocation` | [io.codat.lending.models.shared.Allocation](../../models/shared/Allocation.md) | :heavy_check_mark: | N/A | +| `payment` | [io.codat.lending.models.shared.PaymentAllocationPayment](../../models/shared/PaymentAllocationPayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingPayments.md b/lending/docs/models/shared/AccountingPayments.md new file mode 100644 index 00000000..0ffbe88f --- /dev/null +++ b/lending/docs/models/shared/AccountingPayments.md @@ -0,0 +1,12 @@ +# AccountingPayments + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingPayment](../../models/shared/AccountingPayment.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingProfitAndLossReport.md b/lending/docs/models/shared/AccountingProfitAndLossReport.md new file mode 100644 index 00000000..205b4d6e --- /dev/null +++ b/lending/docs/models/shared/AccountingProfitAndLossReport.md @@ -0,0 +1,35 @@ +# AccountingProfitAndLossReport + +> **Language tip:** Profit and loss statement is also referred to as **income statement** under US GAAP (Generally Accepted Accounting Principles). + +> View the coverage for profit and loss in the Data coverage explorer. + +## Overview + +The purpose of a profit and loss report is to present the financial performance of a company over a specified time period. + +A profit and loss report shows a company's total income and expenses for a specified period of time and whether a profit or loss has been made. + +> **Profit and loss or balance sheet?** +> Profit and loss reports summarise the total revenue, expenses, and profit or loss over a specified time period. A balance sheet report presents all assets, liability, and equity for a given date. + + +**Structure of this report** +This report will reflect the structure and line descriptions that the business has set in their own accounting platform. + +**History** +By default, Codat pulls (up to) 24 months of profit and loss history for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `profitAndLoss` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/post-profile-syncSettings). + +**Want to pull this in a standardised structure?** +Our [Enhanced Financials](https://docs.codat.io/assess/reports/enhanced-financials/financials) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *String* | :heavy_check_mark: | Base currency of the company in which the profit and loss report is presented. | | +| `earliestAvailableMonth` | *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 | +| `mostRecentAvailableMonth` | *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 | +| `reportBasis` | [io.codat.lending.models.shared.ReportBasis](../../models/shared/ReportBasis.md) | :heavy_check_mark: | The basis of a report. | | +| `reports` | List<[io.codat.lending.models.shared.ProfitAndLossReport](../../models/shared/ProfitAndLossReport.md)> | :heavy_check_mark: | An array of profit and loss reports. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingSupplier.md b/lending/docs/models/shared/AccountingSupplier.md new file mode 100644 index 00000000..f571fdaf --- /dev/null +++ b/lending/docs/models/shared/AccountingSupplier.md @@ -0,0 +1,27 @@ +# AccountingSupplier + +> View the coverage for suppliers in the Data coverage explorer. + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/lending-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/lending-api#/schemas/Bill). + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | List<[io.codat.lending.models.shared.AccountingAddress](../../models/shared/AccountingAddress.md)> | :heavy_minus_sign: | An array of Addresses. | | +| `contactName` | *JsonNullable* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `defaultCurrency` | *JsonNullable* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `emailAddress` | *JsonNullable* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting platform. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *JsonNullable* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registrationNumber` | *JsonNullable* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [io.codat.lending.models.shared.SupplierStatus](../../models/shared/SupplierStatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplierName` | *JsonNullable* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `taxNumber` | *JsonNullable* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingSuppliers.md b/lending/docs/models/shared/AccountingSuppliers.md new file mode 100644 index 00000000..717c7582 --- /dev/null +++ b/lending/docs/models/shared/AccountingSuppliers.md @@ -0,0 +1,12 @@ +# AccountingSuppliers + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingSupplier](../../models/shared/AccountingSupplier.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingTransfer.md b/lending/docs/models/shared/AccountingTransfer.md new file mode 100644 index 00000000..51077f7b --- /dev/null +++ b/lending/docs/models/shared/AccountingTransfer.md @@ -0,0 +1,23 @@ +# AccountingTransfer + +> View the coverage for transfers in the Data coverage explorer. + +A transfer records the movement of money between two bank accounts, or between a bank account and a nominal account. It is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/ContactRef.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `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 | +| `depositedRecordRefs` | List<[io.codat.lending.models.shared.RecordRef](../../models/shared/RecordRef.md)> | :heavy_minus_sign: | List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. | | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description of the transfer. | | +| `from` | [Optional](../../models/shared/TransferAccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the transfer. | | +| `metadata` | [Optional](../../models/shared/Metadata.md) | :heavy_minus_sign: | N/A | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `to` | [Optional](../../models/shared/TransferAccount.md) | :heavy_minus_sign: | Account details of the account sending or receiving the transfer. | | +| `trackingCategoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | Reference to the tracking categories this transfer is being tracked against. | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountingTransfers.md b/lending/docs/models/shared/AccountingTransfers.md new file mode 100644 index 00000000..b1244540 --- /dev/null +++ b/lending/docs/models/shared/AccountingTransfers.md @@ -0,0 +1,12 @@ +# AccountingTransfers + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.AccountingTransfer](../../models/shared/AccountingTransfer.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/Accounts.md b/lending/docs/models/shared/Accounts.md new file mode 100644 index 00000000..16b3893e --- /dev/null +++ b/lending/docs/models/shared/Accounts.md @@ -0,0 +1,14 @@ +# Accounts + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *Optional* | :heavy_minus_sign: | The name of the account according to the provider. | | +| `accountProvider` | *Optional* | :heavy_minus_sign: | The bank or other financial institution providing the account. | | +| `accountType` | *Optional* | :heavy_minus_sign: | The type of banking account, e.g. credit or debit. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currentBalance` | *Optional* | :heavy_minus_sign: | The balance of the bank account. | | +| `platformName` | *Optional* | :heavy_minus_sign: | Name of the banking data source, e.g. "Plaid". | | +| `sourceRef` | [Optional](../../models/shared/SourceRef.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountsPayableTracking.md b/lending/docs/models/shared/AccountsPayableTracking.md new file mode 100644 index 00000000..ef95de34 --- /dev/null +++ b/lending/docs/models/shared/AccountsPayableTracking.md @@ -0,0 +1,14 @@ +# AccountsPayableTracking + +Categories, and a project and customer, against which the item is tracked. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `categoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_check_mark: | N/A | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | +| `isBilledTo` | [io.codat.lending.models.shared.BilledToType](../../models/shared/BilledToType.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `isRebilledTo` | [io.codat.lending.models.shared.BilledToType](../../models/shared/BilledToType.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `projectRef` | [Optional](../../models/shared/ProjectRef.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/AccountsReceivableTracking.md b/lending/docs/models/shared/AccountsReceivableTracking.md new file mode 100644 index 00000000..047c0269 --- /dev/null +++ b/lending/docs/models/shared/AccountsReceivableTracking.md @@ -0,0 +1,15 @@ +# AccountsReceivableTracking + +Categories, and a project and customer, against which the item is tracked. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `categoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_check_mark: | N/A | +| `customerRef` | [Optional](../../models/shared/AccountingCustomerRef.md) | :heavy_minus_sign: | N/A | +| `isBilledTo` | [io.codat.lending.models.shared.BilledToType1](../../models/shared/BilledToType1.md) | :heavy_check_mark: | Defines if the bill or bill credit note is billed/rebilled to a project. | +| `isRebilledTo` | [io.codat.lending.models.shared.BilledToType1](../../models/shared/BilledToType1.md) | :heavy_check_mark: | Defines if the bill or bill credit note is billed/rebilled to a project. | +| `projectRef` | [Optional](../../models/shared/ProjectRef.md) | :heavy_minus_sign: | N/A | +| `recordRef` | [Optional](../../models/shared/RecordReference.md) | :heavy_minus_sign: | Links the current record to the underlying record or data type that created it.

For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. | \ No newline at end of file diff --git a/lending/docs/models/shared/AgedCreditor.md b/lending/docs/models/shared/AgedCreditor.md new file mode 100644 index 00000000..cf3beefc --- /dev/null +++ b/lending/docs/models/shared/AgedCreditor.md @@ -0,0 +1,10 @@ +# AgedCreditor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `agedCurrencyOutstanding` | List<[io.codat.lending.models.shared.AgedCurrencyOutstanding](../../models/shared/AgedCurrencyOutstanding.md)> | :heavy_minus_sign: | Array of aged creditors by currency. | | +| `supplierId` | *Optional* | :heavy_minus_sign: | Supplier ID of the aged creditor. | f594cefb-7750-4c3a-bab2-b5322026dee9 | +| `supplierName` | *Optional* | :heavy_minus_sign: | Supplier name of the aged creditor. | John Doe | \ No newline at end of file diff --git a/lending/docs/models/shared/AgedCurrencyOutstanding.md b/lending/docs/models/shared/AgedCurrencyOutstanding.md new file mode 100644 index 00000000..1ac49ccc --- /dev/null +++ b/lending/docs/models/shared/AgedCurrencyOutstanding.md @@ -0,0 +1,9 @@ +# AgedCurrencyOutstanding + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `agedOutstandingAmounts` | List<[io.codat.lending.models.shared.AgedOutstandingAmount](../../models/shared/AgedOutstandingAmount.md)> | :heavy_minus_sign: | Array of outstanding amounts by period. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | \ No newline at end of file diff --git a/lending/docs/models/shared/AgedDebtor.md b/lending/docs/models/shared/AgedDebtor.md new file mode 100644 index 00000000..b5e25402 --- /dev/null +++ b/lending/docs/models/shared/AgedDebtor.md @@ -0,0 +1,10 @@ +# AgedDebtor + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `agedCurrencyOutstanding` | List<[io.codat.lending.models.shared.AgedCurrencyOutstanding](../../models/shared/AgedCurrencyOutstanding.md)> | :heavy_minus_sign: | Array of aged debtors by currency. | | +| `customerId` | *Optional* | :heavy_minus_sign: | Customer ID of the aged debtor. | f594cefb-7750-4c3a-bab2-b5322026dee9 | +| `customerName` | *Optional* | :heavy_minus_sign: | Customer name of the aged debtor. | John Doe | \ No newline at end of file diff --git a/lending/docs/models/shared/AgedOutstandingAmount.md b/lending/docs/models/shared/AgedOutstandingAmount.md new file mode 100644 index 00000000..0308350f --- /dev/null +++ b/lending/docs/models/shared/AgedOutstandingAmount.md @@ -0,0 +1,11 @@ +# AgedOutstandingAmount + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The amount outstanding. | | +| `details` | List<[io.codat.lending.models.shared.AgedOutstandingAmountDetail](../../models/shared/AgedOutstandingAmountDetail.md)> | :heavy_minus_sign: | Array of details. | | +| `fromDate` | *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 | +| `toDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/AgedOutstandingAmountDetail.md b/lending/docs/models/shared/AgedOutstandingAmountDetail.md new file mode 100644 index 00000000..c4a25f1a --- /dev/null +++ b/lending/docs/models/shared/AgedOutstandingAmountDetail.md @@ -0,0 +1,9 @@ +# AgedOutstandingAmountDetail + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The amount outstanding. | +| `name` | *Optional* | :heavy_minus_sign: | Name of data type with outstanding amount for given period. | \ No newline at end of file diff --git a/lending/docs/models/shared/Allocation.md b/lending/docs/models/shared/Allocation.md new file mode 100644 index 00000000..b9950793 --- /dev/null +++ b/lending/docs/models/shared/Allocation.md @@ -0,0 +1,11 @@ +# Allocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocatedOnDate` | *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 | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/lending/docs/models/shared/Attachments.md b/lending/docs/models/shared/Attachments.md new file mode 100644 index 00000000..8e1e0f2f --- /dev/null +++ b/lending/docs/models/shared/Attachments.md @@ -0,0 +1,8 @@ +# Attachments + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `attachments` | List<[io.codat.lending.models.shared.AccountingAttachment](../../models/shared/AccountingAttachment.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/BalanceSheet.md b/lending/docs/models/shared/BalanceSheet.md new file mode 100644 index 00000000..efa3c880 --- /dev/null +++ b/lending/docs/models/shared/BalanceSheet.md @@ -0,0 +1,12 @@ +# BalanceSheet + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `assets` | [Optional](../../models/shared/ReportLine.md) | :heavy_minus_sign: | N/A | | +| `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 | +| `equity` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `liabilities` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `netAssets` | *double* | :heavy_check_mark: | Value of net assets for a company in their base currency. | | \ No newline at end of file diff --git a/lending/docs/models/shared/BankAccountRef.md b/lending/docs/models/shared/BankAccountRef.md new file mode 100644 index 00000000..2eaf8c3a --- /dev/null +++ b/lending/docs/models/shared/BankAccountRef.md @@ -0,0 +1,11 @@ +# BankAccountRef + +Links to the Account transactions data type. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *Optional* | :heavy_minus_sign: | Bank account 'id' for the account transaction. | +| `name` | *Optional* | :heavy_minus_sign: | bank account 'name' for the account transaction. | \ No newline at end of file diff --git a/lending/docs/models/shared/BankTransactionType.md b/lending/docs/models/shared/BankTransactionType.md new file mode 100644 index 00000000..a1eb51c5 --- /dev/null +++ b/lending/docs/models/shared/BankTransactionType.md @@ -0,0 +1,27 @@ +# BankTransactionType + +Type of transaction for the bank statement line. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | +| `INT_` | Int | +| `DIV` | Div | +| `FEE` | Fee | +| `SER_CHG` | SerChg | +| `DEP` | Dep | +| `ATM` | Atm | +| `POS` | Pos | +| `XFER` | Xfer | +| `CHECK` | Check | +| `PAYMENT` | Payment | +| `CASH` | Cash | +| `DIRECT_DEP` | DirectDep | +| `DIRECT_DEBIT` | DirectDebit | +| `REPEAT_PMT` | RepeatPmt | +| `OTHER` | Other | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingAccount.md b/lending/docs/models/shared/BankingAccount.md new file mode 100644 index 00000000..48ef30c6 --- /dev/null +++ b/lending/docs/models/shared/BankingAccount.md @@ -0,0 +1,24 @@ +# BankingAccount + +This data type provides a list of all the SMB's bank accounts, with rich data like balances, account numbers, and institutions holding the accounts. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-accounts). + +Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `balance` | [io.codat.lending.models.shared.AccountBalanceAmounts](../../models/shared/AccountBalanceAmounts.md) | :heavy_check_mark: | Depending on the data provided by the underlying bank, not all balances are always available. | | +| `currency` | *String* | :heavy_check_mark: | The currency code for the account. | | +| `holder` | *JsonNullable* | :heavy_minus_sign: | The name of the person or company who holds the account. | | +| `id` | *String* | :heavy_check_mark: | The ID of the account from the provider. | | +| `identifiers` | [io.codat.lending.models.shared.AccountIdentifiers](../../models/shared/AccountIdentifiers.md) | :heavy_check_mark: | An object containing bank account identification information. | | +| `informalName` | *JsonNullable* | :heavy_minus_sign: | The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. | | +| `institution` | [io.codat.lending.models.shared.AccountInstitution](../../models/shared/AccountInstitution.md) | :heavy_check_mark: | The bank or other financial institution providing the account. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *String* | :heavy_check_mark: | The name of the account according to the provider. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `type` | [io.codat.lending.models.shared.AccountingBankAccountType](../../models/shared/AccountingBankAccountType.md) | :heavy_check_mark: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingAccountBalance.md b/lending/docs/models/shared/BankingAccountBalance.md new file mode 100644 index 00000000..eccfb5c0 --- /dev/null +++ b/lending/docs/models/shared/BankingAccountBalance.md @@ -0,0 +1,22 @@ +# BankingAccountBalance + +The Banking Account Balances data type provides a list of balances for a bank account including end-of-day batch balance or running balances per transaction. + +Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + +> **How often should I pull Account Balances?** +> +> Because these balances are closing balances, we recommend you pull Account Balance no more frequently than daily. If you require a live intraday balance, this can be found for each account on the [Account](https://docs.codat.io/lending-api#/schemas/Account) data type. +> +> Whilst you can choose to sync hourly, this may incur usage charges from Plaid or TrueLayer. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *String* | :heavy_check_mark: | The unique identifier of the account. | | +| `balance` | [io.codat.lending.models.shared.AccountBalanceAmounts](../../models/shared/AccountBalanceAmounts.md) | :heavy_check_mark: | Depending on the data provided by the underlying bank, not all balances are always available. | | +| `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 | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingAccountBalances.md b/lending/docs/models/shared/BankingAccountBalances.md new file mode 100644 index 00000000..7ffa1f63 --- /dev/null +++ b/lending/docs/models/shared/BankingAccountBalances.md @@ -0,0 +1,12 @@ +# BankingAccountBalances + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.BankingAccountBalance](../../models/shared/BankingAccountBalance.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingAccounts.md b/lending/docs/models/shared/BankingAccounts.md new file mode 100644 index 00000000..e33cd11c --- /dev/null +++ b/lending/docs/models/shared/BankingAccounts.md @@ -0,0 +1,12 @@ +# BankingAccounts + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.BankingAccount](../../models/shared/BankingAccount.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingTransaction.md b/lending/docs/models/shared/BankingTransaction.md new file mode 100644 index 00000000..12ffa898 --- /dev/null +++ b/lending/docs/models/shared/BankingTransaction.md @@ -0,0 +1,25 @@ +# BankingTransaction + +The Banking Transactions data type provides an immutable source of up-to-date information on income and expenditure. + +Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + +View the coverage for banking transactions in the [Data Coverage Explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactions). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *String* | :heavy_check_mark: | The unique identifier of the bank account. | | +| `amount` | *Optional* | :heavy_minus_sign: | The amount of the bank transaction. | | +| `authorizedDate` | *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 | +| `code` | [Optional](../../models/shared/TransactionCode.md) | :heavy_minus_sign: | Code to identify the underlying transaction. | | +| `currency` | *String* | :heavy_check_mark: | The currency of the bank transaction. | | +| `description` | *JsonNullable* | :heavy_minus_sign: | The description of the bank transaction. | | +| `id` | *String* | :heavy_check_mark: | The unique identifier of the bank transaction. | | +| `merchantName` | *JsonNullable* | :heavy_minus_sign: | The name of the merchant. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `postedDate` | *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 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `transactionCategoryRef` | [Optional](../../models/shared/TransactionCategoryRef.md) | :heavy_minus_sign: | An object of bank transaction category reference data. | | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingTransactionCategories.md b/lending/docs/models/shared/BankingTransactionCategories.md new file mode 100644 index 00000000..161dc75f --- /dev/null +++ b/lending/docs/models/shared/BankingTransactionCategories.md @@ -0,0 +1,12 @@ +# BankingTransactionCategories + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.BankingTransactionCategory](../../models/shared/BankingTransactionCategory.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingTransactionCategory.md b/lending/docs/models/shared/BankingTransactionCategory.md new file mode 100644 index 00000000..3a23a47a --- /dev/null +++ b/lending/docs/models/shared/BankingTransactionCategory.md @@ -0,0 +1,18 @@ +# BankingTransactionCategory + +The Banking Transaction Categories data type provides a list of hierarchical categories associated with a transaction for greater contextual meaning to transaction activity. + +Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `hasChildren` | *Optional* | :heavy_minus_sign: | A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. | | +| `id` | *String* | :heavy_check_mark: | The unique identifier of the bank transaction category. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *String* | :heavy_check_mark: | The name of the bank transaction category. | | +| `parentId` | *JsonNullable* | :heavy_minus_sign: | The unique identifier of the parent bank transaction category. | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/TransactionCategoryStatus.md) | :heavy_minus_sign: | The status of the transaction category. | | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingTransactionRef.md b/lending/docs/models/shared/BankingTransactionRef.md new file mode 100644 index 00000000..42b76f5e --- /dev/null +++ b/lending/docs/models/shared/BankingTransactionRef.md @@ -0,0 +1,14 @@ +# BankingTransactionRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountId` | *Optional* | :heavy_minus_sign: | Unique identifier of the bank transaction's account. | | +| `accountName` | *Optional* | :heavy_minus_sign: | Name given to account. | | +| `amount` | *Optional* | :heavy_minus_sign: | Bank transaction amount. | | +| `dataConnectionId` | *Optional* | :heavy_minus_sign: | Unique identifier of the bank transaction's connection. | | +| `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` | *Optional* | :heavy_minus_sign: | Description given to bank transaction. | | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the bank transaction. | | \ No newline at end of file diff --git a/lending/docs/models/shared/BankingTransactions.md b/lending/docs/models/shared/BankingTransactions.md new file mode 100644 index 00000000..cb6eee1a --- /dev/null +++ b/lending/docs/models/shared/BankingTransactions.md @@ -0,0 +1,12 @@ +# BankingTransactions + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.BankingTransaction](../../models/shared/BankingTransaction.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/BillCreditNoteLineItem.md b/lending/docs/models/shared/BillCreditNoteLineItem.md new file mode 100644 index 00000000..2614d96d --- /dev/null +++ b/lending/docs/models/shared/BillCreditNoteLineItem.md @@ -0,0 +1,20 @@ +# BillCreditNoteLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been received. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Value of any discounts applied. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `itemRef` | [Optional](../../models/shared/ItemReference.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *double* | :heavy_check_mark: | Number of units of the goods or service for which credit has been received. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateReference.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `tracking` | [Optional](../../models/shared/AccountsPayableTracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| ~~`trackingCategoryRefs`~~ | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Reference to the tracking categories to which the line item is linked. | +| `unitAmount` | *double* | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file diff --git a/lending/docs/models/shared/BillCreditNoteStatus.md b/lending/docs/models/shared/BillCreditNoteStatus.md new file mode 100644 index 00000000..045816a7 --- /dev/null +++ b/lending/docs/models/shared/BillCreditNoteStatus.md @@ -0,0 +1,15 @@ +# BillCreditNoteStatus + +Current state of the bill credit note + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `DRAFT` | Draft | +| `SUBMITTED` | Submitted | +| `PAID` | Paid | +| `VOID_` | Void | +| `PARTIALLY_PAID` | PartiallyPaid | \ No newline at end of file diff --git a/lending/docs/models/shared/BillLineItem.md b/lending/docs/models/shared/BillLineItem.md new file mode 100644 index 00000000..6b31d28e --- /dev/null +++ b/lending/docs/models/shared/BillLineItem.md @@ -0,0 +1,24 @@ +# BillLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Friendly name of the goods or services received. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Numerical value of any discounts applied.

Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Percentage rate of any discount applied to the bill. | +| `isDirectCost` | *Optional* | :heavy_minus_sign: | The bill is a direct cost if `True`. | +| `itemRef` | [Optional](../../models/shared/PropertieItemRef.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `lineNumber` | *JsonNullable* | :heavy_minus_sign: | The bill line's number. | +| `purchaseOrderLineRef` | [Optional](../../models/shared/RecordLineReference.md) | :heavy_minus_sign: | N/A | +| `quantity` | *double* | :heavy_check_mark: | Number of units of goods or services received. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | Amount of tax for the line. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateRef.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `tracking` | [Optional](../../models/shared/AccountsPayableTracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| `trackingCategoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | Collection of categories against which this item is tracked. | +| `unitAmount` | *double* | :heavy_check_mark: | Price of each unit of goods or services. | +| `unitOfMeasurement` | *JsonNullable* | :heavy_minus_sign: | The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). | \ No newline at end of file diff --git a/lending/docs/models/shared/BillLineItemDataType.md b/lending/docs/models/shared/BillLineItemDataType.md new file mode 100644 index 00000000..959aefaa --- /dev/null +++ b/lending/docs/models/shared/BillLineItemDataType.md @@ -0,0 +1,10 @@ +# BillLineItemDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `PURCHASE_ORDERS` | purchaseOrders | \ No newline at end of file diff --git a/lending/docs/models/shared/BillPaymentLine.md b/lending/docs/models/shared/BillPaymentLine.md new file mode 100644 index 00000000..5c12a87b --- /dev/null +++ b/lending/docs/models/shared/BillPaymentLine.md @@ -0,0 +1,10 @@ +# BillPaymentLine + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocatedOnDate` | *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 | +| `amount` | *double* | :heavy_check_mark: | Amount in the bill payment currency. | | +| `links` | List<[io.codat.lending.models.shared.BillPaymentLineLink](../../models/shared/BillPaymentLineLink.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/BillPaymentLineLink.md b/lending/docs/models/shared/BillPaymentLineLink.md new file mode 100644 index 00000000..0a3d80c8 --- /dev/null +++ b/lending/docs/models/shared/BillPaymentLineLink.md @@ -0,0 +1,11 @@ +# BillPaymentLineLink + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *JsonNullable* | :heavy_minus_sign: | Amount by which the balance of the linked entity is altered, in the currency of the linked entity.

- A negative link amount reduces the outstanding amount on the accounts payable account.
- A positive link amount increases the outstanding amount on the accounts payable account. | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | +| `id` | *JsonNullable* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | +| `type` | [io.codat.lending.models.shared.BillPaymentLineLinkType](../../models/shared/BillPaymentLineLinkType.md) | :heavy_check_mark: | Types of links to bill payment lines. | \ No newline at end of file diff --git a/lending/docs/models/shared/BillPaymentLineLinkType.md b/lending/docs/models/shared/BillPaymentLineLinkType.md new file mode 100644 index 00000000..2f099d0a --- /dev/null +++ b/lending/docs/models/shared/BillPaymentLineLinkType.md @@ -0,0 +1,19 @@ +# BillPaymentLineLinkType + +Types of links to bill payment lines. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `UNKNOWN` | Unknown | +| `UNLINKED` | Unlinked | +| `BILL` | Bill | +| `OTHER` | Other | +| `CREDIT_NOTE` | CreditNote | +| `BILL_PAYMENT` | BillPayment | +| `PAYMENT_ON_ACCOUNT` | PaymentOnAccount | +| `REFUND` | Refund | +| `MANUAL_JOURNAL` | ManualJournal | +| `DISCOUNT` | Discount | \ No newline at end of file diff --git a/lending/docs/models/shared/BillStatus.md b/lending/docs/models/shared/BillStatus.md new file mode 100644 index 00000000..52515041 --- /dev/null +++ b/lending/docs/models/shared/BillStatus.md @@ -0,0 +1,15 @@ +# BillStatus + +Current state of the bill. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `OPEN` | Open | +| `PARTIALLY_PAID` | PartiallyPaid | +| `PAID` | Paid | +| `VOID_` | Void | +| `DRAFT` | Draft | \ No newline at end of file diff --git a/lending/docs/models/shared/BilledToType.md b/lending/docs/models/shared/BilledToType.md new file mode 100644 index 00000000..61634e73 --- /dev/null +++ b/lending/docs/models/shared/BilledToType.md @@ -0,0 +1,13 @@ +# BilledToType + +Defines if the invoice or credit note is billed/rebilled to a project or customer. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `NOT_APPLICABLE` | NotApplicable | +| `CUSTOMER` | Customer | +| `PROJECT` | Project | \ No newline at end of file diff --git a/lending/docs/models/shared/BilledToType1.md b/lending/docs/models/shared/BilledToType1.md new file mode 100644 index 00000000..b4d4c665 --- /dev/null +++ b/lending/docs/models/shared/BilledToType1.md @@ -0,0 +1,12 @@ +# BilledToType1 + +Defines if the bill or bill credit note is billed/rebilled to a project. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `NOT_APPLICABLE` | NotApplicable | +| `PROJECT` | Project | \ No newline at end of file diff --git a/lending/docs/models/shared/CashFlowStatement.md b/lending/docs/models/shared/CashFlowStatement.md new file mode 100644 index 00000000..243165f3 --- /dev/null +++ b/lending/docs/models/shared/CashFlowStatement.md @@ -0,0 +1,11 @@ +# CashFlowStatement + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cashPayments` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `cashReceipts` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `fromDate` | *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 | +| `toDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/ClientRateLimitReachedWebhook.md b/lending/docs/models/shared/ClientRateLimitReachedWebhook.md new file mode 100644 index 00000000..ccf62887 --- /dev/null +++ b/lending/docs/models/shared/ClientRateLimitReachedWebhook.md @@ -0,0 +1,16 @@ +# ClientRateLimitReachedWebhook + +Webhook request body for a client that has reached their rate limit. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `alertId` | *Optional* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `clientId` | *Optional* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `clientName` | *Optional* | :heavy_minus_sign: | Name of your client in Codat. | +| `data` | [Optional](../../models/shared/ClientRateLimitReachedWebhookData.md) | :heavy_minus_sign: | N/A | +| `message` | *Optional* | :heavy_minus_sign: | A human readable message about the webhook. | +| `ruleId` | *Optional* | :heavy_minus_sign: | Unique identifier for the rule. | +| `ruleType` | *Optional* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/lending/docs/models/shared/ClientRateLimitReachedWebhookData.md b/lending/docs/models/shared/ClientRateLimitReachedWebhookData.md new file mode 100644 index 00000000..cb098cd9 --- /dev/null +++ b/lending/docs/models/shared/ClientRateLimitReachedWebhookData.md @@ -0,0 +1,9 @@ +# ClientRateLimitReachedWebhookData + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dailyQuota` | *Optional* | :heavy_minus_sign: | The number of available requests per day. | | +| `expiresUtc` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/ClientRateLimitResetWebhook.md b/lending/docs/models/shared/ClientRateLimitResetWebhook.md new file mode 100644 index 00000000..ed6828ad --- /dev/null +++ b/lending/docs/models/shared/ClientRateLimitResetWebhook.md @@ -0,0 +1,16 @@ +# ClientRateLimitResetWebhook + +Webhook request body for a client that has had their rate limit reset. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `alertId` | *Optional* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `clientId` | *Optional* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `clientName` | *Optional* | :heavy_minus_sign: | Name of your client in Codat. | +| `data` | [Optional](../../models/shared/ClientRateLimitResetWebhookData.md) | :heavy_minus_sign: | N/A | +| `message` | *Optional* | :heavy_minus_sign: | A human readable message about the webhook. | +| `ruleId` | *Optional* | :heavy_minus_sign: | Unique identifier for the rule. | +| `ruleType` | *Optional* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/lending/docs/models/shared/ClientRateLimitResetWebhookData.md b/lending/docs/models/shared/ClientRateLimitResetWebhookData.md new file mode 100644 index 00000000..f8c58c8f --- /dev/null +++ b/lending/docs/models/shared/ClientRateLimitResetWebhookData.md @@ -0,0 +1,11 @@ +# ClientRateLimitResetWebhookData + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dailyQuota` | *Optional* | :heavy_minus_sign: | The number of available requests per day. | | +| `expiresUtc` | *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 | +| `quotaRemaining` | *JsonNullable* | :heavy_minus_sign: | Total number of request remaining for your client. | | +| `resetReason` | *Optional* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CodatFile.md b/lending/docs/models/shared/CodatFile.md new file mode 100644 index 00000000..b0febb10 --- /dev/null +++ b/lending/docs/models/shared/CodatFile.md @@ -0,0 +1,9 @@ +# CodatFile + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `content` | *byte[]* | :heavy_check_mark: | N/A | +| `fileName` | *String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceAddress.md b/lending/docs/models/shared/CommerceAddress.md new file mode 100644 index 00000000..4cc09370 --- /dev/null +++ b/lending/docs/models/shared/CommerceAddress.md @@ -0,0 +1,14 @@ +# CommerceAddress + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `city` | *Optional* | :heavy_minus_sign: | The third line of the address, or city | +| `country` | *Optional* | :heavy_minus_sign: | The country for the address | +| `line1` | *Optional* | :heavy_minus_sign: | The first line of the address | +| `line2` | *Optional* | :heavy_minus_sign: | The second line of the address | +| `postalCode` | *Optional* | :heavy_minus_sign: | The postal (or zip) code for the address | +| `region` | *Optional* | :heavy_minus_sign: | The fourth line of the address, or region | +| `type` | [Optional](../../models/shared/CommerceAddressType.md) | :heavy_minus_sign: | The type of the address | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceAddressType.md b/lending/docs/models/shared/CommerceAddressType.md new file mode 100644 index 00000000..5cfbee62 --- /dev/null +++ b/lending/docs/models/shared/CommerceAddressType.md @@ -0,0 +1,14 @@ +# CommerceAddressType + +The type of the address + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `BILLING` | Billing | +| `DELIVERY` | Delivery | +| `ORDER` | Order | +| `INVENTORY` | Inventory | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceCompanyInfo.md b/lending/docs/models/shared/CommerceCompanyInfo.md new file mode 100644 index 00000000..ed93ba25 --- /dev/null +++ b/lending/docs/models/shared/CommerceCompanyInfo.md @@ -0,0 +1,26 @@ +# CommerceCompanyInfo + +In the Codat system, company profile includes standard commercial details about +a linked company, such as their address, phone number, and company registration. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=companyInfo) for this data type. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountBalances` | List<[io.codat.lending.models.shared.AccountBalance](../../models/shared/AccountBalance.md)> | :heavy_minus_sign: | The available and current cash balances for the company's accounts | | +| `addresses` | List<[io.codat.lending.models.shared.CommerceAddress](../../models/shared/CommerceAddress.md)> | :heavy_minus_sign: | Addresses associated with the company | | +| `baseCurrency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `commercePlatformRef` | *Optional* | :heavy_minus_sign: | Identifier or reference for the company in the commerce platform | | +| `companyLegalName` | *Optional* | :heavy_minus_sign: | The full legal name of the company | Codat Limited | +| `companyName` | *Optional* | :heavy_minus_sign: | The name of the company | Codat | +| `createdDate` | *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 | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phoneNumbers` | List<[io.codat.lending.models.shared.PhoneNumber](../../models/shared/PhoneNumber.md)> | :heavy_minus_sign: | Phone numbers associated with the company | | +| `registrationNumber` | *Optional* | :heavy_minus_sign: | The registration number of the company | 10480375 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `sourceUrls` | Map | :heavy_minus_sign: | URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system | {"url1":"https://connect.sandbox.com/v2/customers","url2":"https://connect.sandbox.com/v2/disputes"} | +| `webLinks` | List<[io.codat.lending.models.shared.WebLink](../../models/shared/WebLink.md)> | :heavy_minus_sign: | Weblinks associated with the company | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceCustomer.md b/lending/docs/models/shared/CommerceCustomer.md new file mode 100644 index 00000000..5dfff3c0 --- /dev/null +++ b/lending/docs/models/shared/CommerceCustomer.md @@ -0,0 +1,21 @@ +# CommerceCustomer + +When a customer places an order with the connected commerce store their details are added to the Customers dataset. You can use the data from the Customers endpoints to calculate key metrics, such as customer churn. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-customers) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | List<[io.codat.lending.models.shared.CommerceAddress](../../models/shared/CommerceAddress.md)> | :heavy_minus_sign: | Addresses of the customer | | +| `createdDate` | *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 | +| `customerName` | *Optional* | :heavy_minus_sign: | Name of the customer | Fred Smith | +| `defaultCurrency` | *Optional* | :heavy_minus_sign: | N/A | GBP | +| `emailAddress` | *Optional* | :heavy_minus_sign: | Email address of the customer | fred.smith@myCompany.com | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *Optional* | :heavy_minus_sign: | Any additional information about the customer | | +| `phone` | *JsonNullable* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceCustomerRef.md b/lending/docs/models/shared/CommerceCustomerRef.md new file mode 100644 index 00000000..d4666c71 --- /dev/null +++ b/lending/docs/models/shared/CommerceCustomerRef.md @@ -0,0 +1,11 @@ +# CommerceCustomerRef + +Reference to the customer that placed the order. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identitifer of the customer being referenced | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional* | :heavy_minus_sign: | Name of the customer being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceCustomers.md b/lending/docs/models/shared/CommerceCustomers.md new file mode 100644 index 00000000..60814545 --- /dev/null +++ b/lending/docs/models/shared/CommerceCustomers.md @@ -0,0 +1,12 @@ +# CommerceCustomers + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceCustomer](../../models/shared/CommerceCustomer.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceDispute.md b/lending/docs/models/shared/CommerceDispute.md new file mode 100644 index 00000000..9895b1e6 --- /dev/null +++ b/lending/docs/models/shared/CommerceDispute.md @@ -0,0 +1,26 @@ +# CommerceDispute + +A customer may file a payment dispute with their bank or other card issuer when they're unsatisfied with their purchase or believe they have been charged incorrectly. For example: +- They didn't receive an order. +- The product they received was different to the commerce store's description. +- They've been the victim of online fraud. + +You can use data from the Disputes endpoints to calculate key metrics, such as the number of chargebacks. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-disputes) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdDate` | *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 | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `disputedTransactions` | List<[io.codat.lending.models.shared.TransactionSourceRef](../../models/shared/TransactionSourceRef.md)> | :heavy_minus_sign: | Link to the source event(s) which triggered this transaction. | | +| `dueDate` | *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 | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `reason` | *Optional* | :heavy_minus_sign: | Reason for the dispute | Unhappy with product | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/DisputeStatus.md) | :heavy_minus_sign: | Current status of the dispute | EvidenceRequired | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total transaction amount that is under dispute. | 194.12 | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceDisputes.md b/lending/docs/models/shared/CommerceDisputes.md new file mode 100644 index 00000000..e79e3af5 --- /dev/null +++ b/lending/docs/models/shared/CommerceDisputes.md @@ -0,0 +1,12 @@ +# CommerceDisputes + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceDispute](../../models/shared/CommerceDispute.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceLocation.md b/lending/docs/models/shared/CommerceLocation.md new file mode 100644 index 00000000..1f357660 --- /dev/null +++ b/lending/docs/models/shared/CommerceLocation.md @@ -0,0 +1,18 @@ +# CommerceLocation + +The Location datatype holds information on the geographic location at which stocks of products may be held, as referenced in the Products data type. + +A Location also holds information on geographic locations where orders were placed, as referenced in the Orders data type. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-locations) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `address` | [Optional](../../models/shared/CommerceAddress.md) | :heavy_minus_sign: | N/A | | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *Optional* | :heavy_minus_sign: | Name of this location | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceLocations.md b/lending/docs/models/shared/CommerceLocations.md new file mode 100644 index 00000000..2e0b431f --- /dev/null +++ b/lending/docs/models/shared/CommerceLocations.md @@ -0,0 +1,12 @@ +# CommerceLocations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceLocation](../../models/shared/CommerceLocation.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceOrder.md b/lending/docs/models/shared/CommerceOrder.md new file mode 100644 index 00000000..ba3fec52 --- /dev/null +++ b/lending/docs/models/shared/CommerceOrder.md @@ -0,0 +1,31 @@ +# CommerceOrder + +Orders contain the transaction details for all products sold by the company, and include details of any payments, service charges, or refunds related to each order. You can use data from the Orders endpoints to calculate key metrics, such as gross sales values and monthly recurring revenue (MRR). + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-orders) for this data type. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `closedDate` | *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 | +| `country` | *Optional* | :heavy_minus_sign: | The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part.

Depending on the platform the value of this property will either be an ISO 3166 code (2-alpha or 3-alpha) or free-form text returned as a string name in our model.

For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. | GBR | +| `createdDate` | *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 | +| `currency` | *Optional* | :heavy_minus_sign: | N/A | GBP | +| `customerRef` | [Optional](../../models/shared/CommerceCustomerRef.md) | :heavy_minus_sign: | Reference to the customer that placed the order. | | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `locationRef` | [Optional](../../models/shared/LocationRef.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `orderLineItems` | List<[io.codat.lending.models.shared.OrderLineItem](../../models/shared/OrderLineItem.md)> | :heavy_minus_sign: | N/A | | +| `orderNumber` | *Optional* | :heavy_minus_sign: | Friendly reference for the order in the commerce or point of sale platform. | | +| `payments` | List<[io.codat.lending.models.shared.PaymentRef](../../models/shared/PaymentRef.md)> | :heavy_minus_sign: | N/A | | +| `serviceCharges` | List<[io.codat.lending.models.shared.ServiceCharge](../../models/shared/ServiceCharge.md)> | :heavy_minus_sign: | N/A | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. | | +| `totalDiscount` | *Optional* | :heavy_minus_sign: | Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). | | +| `totalGratuity` | *Optional* | :heavy_minus_sign: | Extra amount added to the order. | | +| `totalRefund` | *Optional* | :heavy_minus_sign: | Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. | | +| `totalTaxAmount` | *Optional* | :heavy_minus_sign: | Total amount of tax applied to the order. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceOrders.md b/lending/docs/models/shared/CommerceOrders.md new file mode 100644 index 00000000..6d98f306 --- /dev/null +++ b/lending/docs/models/shared/CommerceOrders.md @@ -0,0 +1,12 @@ +# CommerceOrders + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceOrder](../../models/shared/CommerceOrder.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommercePayment.md b/lending/docs/models/shared/CommercePayment.md new file mode 100644 index 00000000..5f995c9f --- /dev/null +++ b/lending/docs/models/shared/CommercePayment.md @@ -0,0 +1,26 @@ +# CommercePayment + +Payments contain details of all payments made by customers to a company, including: amounts, currency used, payment method, payment provider, and payment status. + +Refunds are recorded as separate, negative payments. Note that a refund can only occur in relation to a payment that has been completed (i.e. has a status of `Paid`). When a customer cancels an order _before_ a payment has been completed, the payment shows as `Cancelled`. + +You can use data from the Payments endpoints to calculate key metrics, such as gross sales and monthly recurring revenue (MRR). + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-payments) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | Payment Amount (including gratuity) | 194.12 | +| `createdDate` | *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 | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `dueDate` | *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 | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `paymentMethodRef` | [Optional](../../models/shared/PaymentMethodRef.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | | +| `paymentProvider` | *Optional* | :heavy_minus_sign: | Service provider of the payment, if applicable. | Amazon Pay | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/PaymentStatus.md) | :heavy_minus_sign: | Status of the payment. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommercePaymentMethod.md b/lending/docs/models/shared/CommercePaymentMethod.md new file mode 100644 index 00000000..a83ac79f --- /dev/null +++ b/lending/docs/models/shared/CommercePaymentMethod.md @@ -0,0 +1,16 @@ +# CommercePaymentMethod + +A Payment Method represents the payment method(s) used to make payments. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-paymentMethods) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *Optional* | :heavy_minus_sign: | The name of the PaymentMethod | Alipay | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/CommercePaymentMethodStatus.md) | :heavy_minus_sign: | Status of the Payment Method. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommercePaymentMethodStatus.md b/lending/docs/models/shared/CommercePaymentMethodStatus.md new file mode 100644 index 00000000..7ec7c78b --- /dev/null +++ b/lending/docs/models/shared/CommercePaymentMethodStatus.md @@ -0,0 +1,12 @@ +# CommercePaymentMethodStatus + +Status of the Payment Method. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/lending/docs/models/shared/CommercePaymentMethods.md b/lending/docs/models/shared/CommercePaymentMethods.md new file mode 100644 index 00000000..672f7ae5 --- /dev/null +++ b/lending/docs/models/shared/CommercePaymentMethods.md @@ -0,0 +1,12 @@ +# CommercePaymentMethods + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommercePaymentMethod](../../models/shared/CommercePaymentMethod.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommercePayments.md b/lending/docs/models/shared/CommercePayments.md new file mode 100644 index 00000000..c66ef6d7 --- /dev/null +++ b/lending/docs/models/shared/CommercePayments.md @@ -0,0 +1,12 @@ +# CommercePayments + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommercePayment](../../models/shared/CommercePayment.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceProduct.md b/lending/docs/models/shared/CommerceProduct.md new file mode 100644 index 00000000..43ec089f --- /dev/null +++ b/lending/docs/models/shared/CommerceProduct.md @@ -0,0 +1,19 @@ +# CommerceProduct + +A Product is an item in the company's inventory, and includes information about the price and quantity of all products, and variants thereof, available for sale. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-products) for this data type. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `categorization` | *Optional* | :heavy_minus_sign: | Retail category that the product is assigned to e.g. `Hardware`. | Hardware | +| `description` | *Optional* | :heavy_minus_sign: | Description of the product recorded in the commerce or point of sale platform. | 1tb Western Digital Hard Drive | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `isGiftCard` | *Optional* | :heavy_minus_sign: | Whether the product represents a gift card or voucher that
can be redeemed in the commerce or POS platform.
| | +| `name` | *Optional* | :heavy_minus_sign: | Name of the product in the commerce or POS system | Hard Drive | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `variants` | List<[io.codat.lending.models.shared.ProductVariant](../../models/shared/ProductVariant.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceProductCategories.md b/lending/docs/models/shared/CommerceProductCategories.md new file mode 100644 index 00000000..25deb35f --- /dev/null +++ b/lending/docs/models/shared/CommerceProductCategories.md @@ -0,0 +1,12 @@ +# CommerceProductCategories + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceProductCategory](../../models/shared/CommerceProductCategory.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceProductCategory.md b/lending/docs/models/shared/CommerceProductCategory.md new file mode 100644 index 00000000..10a8bf45 --- /dev/null +++ b/lending/docs/models/shared/CommerceProductCategory.md @@ -0,0 +1,17 @@ +# CommerceProductCategory + +Product categories are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-productCategories) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `ancestorRefs` | List<[io.codat.lending.models.shared.CommerceRecordRef](../../models/shared/CommerceRecordRef.md)> | :heavy_minus_sign: | A collection of parent product categories implicitly ordered with the immediate parent last in the list. | | +| `hasChildren` | *Optional* | :heavy_minus_sign: | A boolean indicating whether there are other product categories beneath this one in the hierarchy. | | +| `id` | *Optional* | :heavy_minus_sign: | The unique identifier of the product category | "102" | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *Optional* | :heavy_minus_sign: | The name of the product category | Entertainment | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceProducts.md b/lending/docs/models/shared/CommerceProducts.md new file mode 100644 index 00000000..8613f22a --- /dev/null +++ b/lending/docs/models/shared/CommerceProducts.md @@ -0,0 +1,12 @@ +# CommerceProducts + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceProduct](../../models/shared/CommerceProduct.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceRecordRef.md b/lending/docs/models/shared/CommerceRecordRef.md new file mode 100644 index 00000000..2d6b04d5 --- /dev/null +++ b/lending/docs/models/shared/CommerceRecordRef.md @@ -0,0 +1,9 @@ +# CommerceRecordRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identitifer of the record being referenced | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `type` | *String* | :heavy_check_mark: | The type of record being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReport.md b/lending/docs/models/shared/CommerceReport.md new file mode 100644 index 00000000..34d13190 --- /dev/null +++ b/lending/docs/models/shared/CommerceReport.md @@ -0,0 +1,54 @@ +# CommerceReport + +## Structure + +Assess reports follow a consistent structure. Reports contain four sections of information: + +### 1. Report definition + +Information such as: + + 1. The report info (e.g. enhanced_profit_and_loss). + 2. The display name of the report (e.g. Enhanced Profit and Loss). + +### 2. Dimension info + +Information about the dimension contained in the reports such as: + + 1. The type of dimension (e.g. datetime, recordRef). + 2. The display name of the dimension (e.g. Period, Category type, Category sub type). + 3. The details about each item within the dimension (e.g. displayName:"Jan 2022", start:"...", end:"...", id:"...", name:"..."). + +### 3. Measure info + +Information about the measures contained in the report such as: + + 1. The display name of the measure (e.g. value of account, percentage change). + 2. The type of the measure (e.g. currency, percentage). + 3. The unit of the measure (e.g. %, GBP). + +### 4. The data for the report + +When the *includeDisplayName* parameter is set to *true*, it shows the *dimensionDisplayName* and *itemDisplayName* to make the data human-readable. The default setting for *includeDisplayName* is *false*. + + +## Displaying the report + +Reports can be rendered as follows (ordering is implicit rather than explicit): + +![A table showing an example of how a report can be rendered](https://files.readme.io/1fa20ca-Report1.png) + +# Data model + +## Dimensions + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `dimensions` | List<[io.codat.lending.models.shared.CommerceReportDimension](../../models/shared/CommerceReportDimension.md)> | :heavy_minus_sign: | N/A | +| `errors` | List<[io.codat.lending.models.shared.CommerceReportError](../../models/shared/CommerceReportError.md)> | :heavy_minus_sign: | N/A | +| `measures` | List<[io.codat.lending.models.shared.CommerceReportMeasure](../../models/shared/CommerceReportMeasure.md)> | :heavy_minus_sign: | N/A | +| `reportData` | List<[io.codat.lending.models.shared.CommerceReportComponent](../../models/shared/CommerceReportComponent.md)> | :heavy_minus_sign: | N/A | +| `reportInfo` | Map | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReportComponent.md b/lending/docs/models/shared/CommerceReportComponent.md new file mode 100644 index 00000000..36264811 --- /dev/null +++ b/lending/docs/models/shared/CommerceReportComponent.md @@ -0,0 +1,13 @@ +# CommerceReportComponent + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `components` | List<[io.codat.lending.models.shared.CommerceReportComponent](../../models/shared/CommerceReportComponent.md)> | :heavy_minus_sign: | N/A | +| `dimension` | *Optional* | :heavy_minus_sign: | The component's dimension. | +| `dimensionDisplayName` | *Optional* | :heavy_minus_sign: | The component's display name. | +| `item` | *Optional* | :heavy_minus_sign: | The component's item number. | +| `itemDisplayName` | *Optional* | :heavy_minus_sign: | The component's item display name. | +| `measures` | List<[io.codat.lending.models.shared.ReportComponentMeasure](../../models/shared/ReportComponentMeasure.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReportDimension.md b/lending/docs/models/shared/CommerceReportDimension.md new file mode 100644 index 00000000..63252884 --- /dev/null +++ b/lending/docs/models/shared/CommerceReportDimension.md @@ -0,0 +1,11 @@ +# CommerceReportDimension + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `displayName` | *Optional* | :heavy_minus_sign: | The dimension's display name. | +| `index` | *Optional* | :heavy_minus_sign: | The dimension's index. | +| `items` | List<[io.codat.lending.models.shared.CommerceReportDimensionItems](../../models/shared/CommerceReportDimensionItems.md)> | :heavy_minus_sign: | N/A | +| `type` | *Optional* | :heavy_minus_sign: | The dimension's type. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReportDimensionItems.md b/lending/docs/models/shared/CommerceReportDimensionItems.md new file mode 100644 index 00000000..b3212111 --- /dev/null +++ b/lending/docs/models/shared/CommerceReportDimensionItems.md @@ -0,0 +1,8 @@ +# CommerceReportDimensionItems + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `index` | *Optional* | :heavy_minus_sign: | The dimension's items index. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReportError.md b/lending/docs/models/shared/CommerceReportError.md new file mode 100644 index 00000000..7afe2fc7 --- /dev/null +++ b/lending/docs/models/shared/CommerceReportError.md @@ -0,0 +1,10 @@ +# CommerceReportError + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `details` | Map> | :heavy_minus_sign: | Additional details on the error. | +| `message` | *Optional* | :heavy_minus_sign: | Message returned by error. | +| `type` | *Optional* | :heavy_minus_sign: | The type of error. | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceReportMeasure.md b/lending/docs/models/shared/CommerceReportMeasure.md new file mode 100644 index 00000000..e76ec163 --- /dev/null +++ b/lending/docs/models/shared/CommerceReportMeasure.md @@ -0,0 +1,11 @@ +# CommerceReportMeasure + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `displayName` | *Optional* | :heavy_minus_sign: | The measure's display name. | +| `index` | *Optional* | :heavy_minus_sign: | The measure's index. | +| `type` | *Optional* | :heavy_minus_sign: | The measure's type. | +| `units` | *Optional* | :heavy_minus_sign: | The measure's units e.g. percentage (%). | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceTransaction.md b/lending/docs/models/shared/CommerceTransaction.md new file mode 100644 index 00000000..21b8b451 --- /dev/null +++ b/lending/docs/models/shared/CommerceTransaction.md @@ -0,0 +1,29 @@ +# CommerceTransaction + +Details of all financial transactions recorded in the commerce or point of sale system are added to the Transactions data type. For example, payments, service charges, and fees. + +You can use data from the Transactions endpoints to calculate key metrics, such as: +- Transaction volumes +- Average transaction volume +- Average transaction value +- Returns +- Payouts + +Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-transactions) for this data type. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdDate` | *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 | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `sourceCreatedDate` | *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 | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `subType` | *Optional* | :heavy_minus_sign: | Non-standardised transaction type data from the commerce platform | CardPayment | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | The total transaction amount | 194.12 | +| `transactionSourceRef` | [Optional](../../models/shared/TransactionSourceRef.md) | :heavy_minus_sign: | Link to the source event which triggered this transaction | | +| `type` | [Optional](../../models/shared/TransactionType.md) | :heavy_minus_sign: | The type of the platform transaction:
- `Unknown`
- `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account.
- `Payment` — Credit and debit card payments.
- `PaymentFee` — Payment provider's fee on each card payment.
- `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller.
- `Payout` — Transfer of funds from the seller's merchant account to their bank account.
- `Refund` — Refunds to a customer's credit or debit card.
- `Transfer` — Secure transfer of funds to the seller's bank account. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CommerceTransactions.md b/lending/docs/models/shared/CommerceTransactions.md new file mode 100644 index 00000000..8fdcfa04 --- /dev/null +++ b/lending/docs/models/shared/CommerceTransactions.md @@ -0,0 +1,12 @@ +# CommerceTransactions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.CommerceTransaction](../../models/shared/CommerceTransaction.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/Companies.md b/lending/docs/models/shared/Companies.md new file mode 100644 index 00000000..21580c16 --- /dev/null +++ b/lending/docs/models/shared/Companies.md @@ -0,0 +1,12 @@ +# Companies + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.Company](../../models/shared/Company.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/Company.md b/lending/docs/models/shared/Company.md new file mode 100644 index 00000000..d257f32a --- /dev/null +++ b/lending/docs/models/shared/Company.md @@ -0,0 +1,23 @@ +# Company + +In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + +Typically each company is one of your customers. + +When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created` | *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 | +| `createdByUserName` | *Optional* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `dataConnections` | List<[io.codat.lending.models.shared.Connection](../../models/shared/Connection.md)> | :heavy_minus_sign: | N/A | | +| `description` | *Optional* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `groups` | List<[io.codat.lending.models.shared.GroupReference](../../models/shared/GroupReference.md)> | :heavy_minus_sign: | An array of groups the company has been assigned to. | | +| `id` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `lastSync` | *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 | +| `name` | *String* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| ~~`platform`~~ | *Optional* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`platformKeys` name used when creating the company. | Xero | +| `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 | \ No newline at end of file diff --git a/lending/docs/models/shared/CompanyRequestBody.md b/lending/docs/models/shared/CompanyRequestBody.md new file mode 100644 index 00000000..b3dfc4cd --- /dev/null +++ b/lending/docs/models/shared/CompanyRequestBody.md @@ -0,0 +1,10 @@ +# CompanyRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `description` | *Optional* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `groups` | List<[io.codat.lending.models.shared.Items](../../models/shared/Items.md)> | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | +| `name` | *String* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | \ No newline at end of file diff --git a/lending/docs/models/shared/Connection.md b/lending/docs/models/shared/Connection.md new file mode 100644 index 00000000..3af2e124 --- /dev/null +++ b/lending/docs/models/shared/Connection.md @@ -0,0 +1,31 @@ +# Connection + +A connection represents a [company's](https://docs.codat.io/lending-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + +A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + +- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. +- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. +- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. +Any combination of accounting, banking, and commerce data connections is allowed. + +Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalProperties` | *Optional* | :heavy_minus_sign: | N/A | | +| `connectionInfo` | Map | :heavy_minus_sign: | N/A | | +| `created` | *String* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `dataConnectionErrors` | List<[io.codat.lending.models.shared.DataConnectionError](../../models/shared/DataConnectionError.md)> | :heavy_minus_sign: | N/A | | +| `id` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integrationId` | *String* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integrationKey` | *String* | :heavy_check_mark: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | +| `lastSync` | *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 | +| `linkUrl` | *String* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `platformName` | *String* | :heavy_check_mark: | Name of integration connected to company. | | +| `sourceId` | *String* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | +| `sourceType` | [io.codat.lending.models.shared.SourceType](../../models/shared/SourceType.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `status` | [io.codat.lending.models.shared.DataConnectionStatus](../../models/shared/DataConnectionStatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | \ No newline at end of file diff --git a/lending/docs/models/shared/Connections.md b/lending/docs/models/shared/Connections.md new file mode 100644 index 00000000..933fe264 --- /dev/null +++ b/lending/docs/models/shared/Connections.md @@ -0,0 +1,12 @@ +# Connections + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.Connection](../../models/shared/Connection.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/Contact.md b/lending/docs/models/shared/Contact.md new file mode 100644 index 00000000..8614ea1f --- /dev/null +++ b/lending/docs/models/shared/Contact.md @@ -0,0 +1,13 @@ +# Contact + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `address` | [Optional](../../models/shared/AccountingAddress.md) | :heavy_minus_sign: | N/A | | +| `email` | *JsonNullable* | :heavy_minus_sign: | Email of a contact for a customer. | | +| `modifiedDate` | *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 | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of a contact for a customer. | | +| `phone` | List<[io.codat.lending.models.shared.PhoneNumber](../../models/shared/PhoneNumber.md)> | :heavy_minus_sign: | An array of Phone numbers. | | +| `status` | [io.codat.lending.models.shared.CustomerStatus](../../models/shared/CustomerStatus.md) | :heavy_check_mark: | Status of customer. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ContactRef.md b/lending/docs/models/shared/ContactRef.md new file mode 100644 index 00000000..75c560b9 --- /dev/null +++ b/lending/docs/models/shared/ContactRef.md @@ -0,0 +1,11 @@ +# ContactRef + +A customer or supplier associated with the direct cost. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [JsonNullable](../../models/shared/ContactRefDataType.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *String* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/models/shared/ContactRefDataType.md b/lending/docs/models/shared/ContactRefDataType.md new file mode 100644 index 00000000..8bc98302 --- /dev/null +++ b/lending/docs/models/shared/ContactRefDataType.md @@ -0,0 +1,11 @@ +# ContactRefDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/lending/docs/models/shared/ContactReference.md b/lending/docs/models/shared/ContactReference.md new file mode 100644 index 00000000..34ed79d6 --- /dev/null +++ b/lending/docs/models/shared/ContactReference.md @@ -0,0 +1,11 @@ +# ContactReference + +A customer or supplier associated with the direct cost. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [JsonNullable](../../models/shared/DirectCostPrototypeDataType.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *String* | :heavy_check_mark: | Unique identifier for a customer or supplier. | \ No newline at end of file diff --git a/lending/docs/models/shared/CreateBankAccountTransaction.md b/lending/docs/models/shared/CreateBankAccountTransaction.md new file mode 100644 index 00000000..0808ab1f --- /dev/null +++ b/lending/docs/models/shared/CreateBankAccountTransaction.md @@ -0,0 +1,12 @@ +# CreateBankAccountTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The amount transacted in the bank transaction. | | +| `balance` | *Optional* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. | | +| `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` | *Optional* | :heavy_minus_sign: | Description of the bank transaction. | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting platform. | | \ No newline at end of file diff --git a/lending/docs/models/shared/CreditNoteLineItem.md b/lending/docs/models/shared/CreditNoteLineItem.md new file mode 100644 index 00000000..a14a5a99 --- /dev/null +++ b/lending/docs/models/shared/CreditNoteLineItem.md @@ -0,0 +1,21 @@ +# CreditNoteLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been issued. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Value of any discounts applied. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `isDirectIncome` | *Optional* | :heavy_minus_sign: | The credit note is a direct income if `True`. | +| `itemRef` | [Optional](../../models/shared/PropertieItemRef.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *double* | :heavy_check_mark: | Number of units of the goods or service for which credit has been issued. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateRef.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `tracking` | [Optional](../../models/shared/AccountsReceivableTracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| ~~`trackingCategoryRefs`~~ | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Reference to the tracking categories to which the line item is linked. | +| `unitAmount` | *double* | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file diff --git a/lending/docs/models/shared/CreditNoteStatus.md b/lending/docs/models/shared/CreditNoteStatus.md new file mode 100644 index 00000000..33a92c7c --- /dev/null +++ b/lending/docs/models/shared/CreditNoteStatus.md @@ -0,0 +1,15 @@ +# CreditNoteStatus + +Current state of the credit note. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `DRAFT` | Draft | +| `SUBMITTED` | Submitted | +| `PAID` | Paid | +| `VOID_` | Void | +| `PARTIALLY_PAID` | PartiallyPaid | \ No newline at end of file diff --git a/lending/docs/models/shared/CustomerStatus.md b/lending/docs/models/shared/CustomerStatus.md new file mode 100644 index 00000000..0c72447c --- /dev/null +++ b/lending/docs/models/shared/CustomerStatus.md @@ -0,0 +1,12 @@ +# CustomerStatus + +Status of customer. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/lending/docs/models/shared/DataConnectionError.md b/lending/docs/models/shared/DataConnectionError.md new file mode 100644 index 00000000..fce6d144 --- /dev/null +++ b/lending/docs/models/shared/DataConnectionError.md @@ -0,0 +1,11 @@ +# DataConnectionError + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `errorMessage` | *Optional* | :heavy_minus_sign: | A brief message about the error. | | +| `erroredOnUtc` | *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 | +| `statusCode` | *Optional* | :heavy_minus_sign: | The HTTP status code returned by the error. | | +| `statusText` | *Optional* | :heavy_minus_sign: | A non-numeric status code/text. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataConnectionStatus.md b/lending/docs/models/shared/DataConnectionStatus.md new file mode 100644 index 00000000..4e79f5d5 --- /dev/null +++ b/lending/docs/models/shared/DataConnectionStatus.md @@ -0,0 +1,13 @@ +# DataConnectionStatus + +The current authorization status of the data connection. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `PENDING_AUTH` | PendingAuth | +| `LINKED` | Linked | +| `UNLINKED` | Unlinked | +| `DEAUTHORIZED` | Deauthorized | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityAmounts.md b/lending/docs/models/shared/DataIntegrityAmounts.md new file mode 100644 index 00000000..11f963a8 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityAmounts.md @@ -0,0 +1,12 @@ +# DataIntegrityAmounts + +Only returned for transactions. For accounts, there is nothing returned. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `max` | *Optional* | :heavy_minus_sign: | Highest value of transaction set. | | +| `min` | *Optional* | :heavy_minus_sign: | Lowest value of transaction set. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityByAmount.md b/lending/docs/models/shared/DataIntegrityByAmount.md new file mode 100644 index 00000000..dc890b10 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityByAmount.md @@ -0,0 +1,12 @@ +# DataIntegrityByAmount + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `matchPercentage` | *Optional* | :heavy_minus_sign: | The percentage of the absolute value of transactions of the type specified in the route which have a match. | | +| `matched` | *Optional* | :heavy_minus_sign: | The sum of the absolute value of transactions of the type specified in the route which have a match. | | +| `total` | *Optional* | :heavy_minus_sign: | The total of unmatched and matched. | | +| `unmatched` | *Optional* | :heavy_minus_sign: | The sum of the absolute value of transactions of the type specified in the route which don't have a match. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityByCount.md b/lending/docs/models/shared/DataIntegrityByCount.md new file mode 100644 index 00000000..4264885a --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityByCount.md @@ -0,0 +1,11 @@ +# DataIntegrityByCount + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `matchPercentage` | *Optional* | :heavy_minus_sign: | The percentage of records of the type specified in the route which have a match. | +| `matched` | *Optional* | :heavy_minus_sign: | The number of records of the type specified in the route which do have a match. | +| `total` | *Optional* | :heavy_minus_sign: | The total of unmatched and matched. | +| `unmatched` | *Optional* | :heavy_minus_sign: | The number of records of the type specified in the route which don't have a match. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityConnectionId.md b/lending/docs/models/shared/DataIntegrityConnectionId.md new file mode 100644 index 00000000..1589ede3 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityConnectionId.md @@ -0,0 +1,9 @@ +# DataIntegrityConnectionId + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `source` | List<*String*> | :heavy_minus_sign: | An array of strings. The connection IDs for the type specified in the url. | +| `target` | List<*String*> | :heavy_minus_sign: | An array of strings. The connection IDs for the type being matched to. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityDataType.md b/lending/docs/models/shared/DataIntegrityDataType.md new file mode 100644 index 00000000..973bafc1 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityDataType.md @@ -0,0 +1,11 @@ +# DataIntegrityDataType + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `BANK_ACCOUNTS` | bankAccounts | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityDates.md b/lending/docs/models/shared/DataIntegrityDates.md new file mode 100644 index 00000000..0aac47f2 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityDates.md @@ -0,0 +1,13 @@ +# DataIntegrityDates + +Only returned for transactions. For accounts, there is nothing returned. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `maxDate` | *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 | +| `maxOverlappingDate` | *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 | +| `minDate` | *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 | +| `minOverlappingDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityDetail.md b/lending/docs/models/shared/DataIntegrityDetail.md new file mode 100644 index 00000000..1f744d6d --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityDetail.md @@ -0,0 +1,15 @@ +# DataIntegrityDetail + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The transaction value. | | +| `connectionId` | *Optional* | :heavy_minus_sign: | ID GUID representing the connection of the accounting or banking platform. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `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` | *Optional* | :heavy_minus_sign: | The transaction description. | | +| `id` | *Optional* | :heavy_minus_sign: | ID GUID of the transaction. | | +| `matches` | List<[io.codat.lending.models.shared.DataIntegrityMatch](../../models/shared/DataIntegrityMatch.md)> | :heavy_minus_sign: | N/A | | +| `type` | *Optional* | :heavy_minus_sign: | The data type of the record. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityDetails.md b/lending/docs/models/shared/DataIntegrityDetails.md new file mode 100644 index 00000000..dcf211ed --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityDetails.md @@ -0,0 +1,12 @@ +# DataIntegrityDetails + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.DataIntegrityDetail](../../models/shared/DataIntegrityDetail.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityMatch.md b/lending/docs/models/shared/DataIntegrityMatch.md new file mode 100644 index 00000000..4d22c970 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityMatch.md @@ -0,0 +1,14 @@ +# DataIntegrityMatch + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The transaction value. | | +| `connectionId` | *Optional* | :heavy_minus_sign: | ID GUID representing the connection of the accounting or banking platform. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `date` | *Optional* | :heavy_minus_sign: | The date of the transaction. | | +| `description` | *Optional* | :heavy_minus_sign: | The transaction description. | | +| `id` | *Optional* | :heavy_minus_sign: | ID GUID of the transaction. | | +| `type` | *Optional* | :heavy_minus_sign: | The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityStatus.md b/lending/docs/models/shared/DataIntegrityStatus.md new file mode 100644 index 00000000..0271242d --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityStatus.md @@ -0,0 +1,12 @@ +# DataIntegrityStatus + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amounts` | [Optional](../../models/shared/DataIntegrityAmounts.md) | :heavy_minus_sign: | Only returned for transactions. For accounts, there is nothing returned. | +| `connectionIds` | [Optional](../../models/shared/DataIntegrityConnectionId.md) | :heavy_minus_sign: | N/A | +| `dates` | [Optional](../../models/shared/DataIntegrityDates.md) | :heavy_minus_sign: | Only returned for transactions. For accounts, there is nothing returned. | +| `statusInfo` | [Optional](../../models/shared/DataIntegrityStatusInfo.md) | :heavy_minus_sign: | N/A | +| `type` | *Optional* | :heavy_minus_sign: | The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityStatusInfo.md b/lending/docs/models/shared/DataIntegrityStatusInfo.md new file mode 100644 index 00000000..b12506b5 --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityStatusInfo.md @@ -0,0 +1,10 @@ +# DataIntegrityStatusInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currentStatus` | [Optional](../../models/shared/IntegrityStatus.md) | :heavy_minus_sign: | The current status of the most recently run matching algorithm. | | +| `lastMatched` | *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 | +| `statusMessage` | *Optional* | :heavy_minus_sign: | Detailed explanation supporting the status value. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegrityStatuses.md b/lending/docs/models/shared/DataIntegrityStatuses.md new file mode 100644 index 00000000..cffb58ce --- /dev/null +++ b/lending/docs/models/shared/DataIntegrityStatuses.md @@ -0,0 +1,8 @@ +# DataIntegrityStatuses + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `metadata` | List<[io.codat.lending.models.shared.DataIntegrityStatus](../../models/shared/DataIntegrityStatus.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegritySummaries.md b/lending/docs/models/shared/DataIntegritySummaries.md new file mode 100644 index 00000000..7c22a7cc --- /dev/null +++ b/lending/docs/models/shared/DataIntegritySummaries.md @@ -0,0 +1,8 @@ +# DataIntegritySummaries + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `summaries` | List<[io.codat.lending.models.shared.DataIntegritySummary](../../models/shared/DataIntegritySummary.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/DataIntegritySummary.md b/lending/docs/models/shared/DataIntegritySummary.md new file mode 100644 index 00000000..8c8752f8 --- /dev/null +++ b/lending/docs/models/shared/DataIntegritySummary.md @@ -0,0 +1,10 @@ +# DataIntegritySummary + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `byAmount` | [Optional](../../models/shared/DataIntegrityByAmount.md) | :heavy_minus_sign: | N/A | +| `byCount` | [Optional](../../models/shared/DataIntegrityByCount.md) | :heavy_minus_sign: | N/A | +| `type` | *Optional* | :heavy_minus_sign: | The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataSource.md b/lending/docs/models/shared/DataSource.md new file mode 100644 index 00000000..f9cb9bb3 --- /dev/null +++ b/lending/docs/models/shared/DataSource.md @@ -0,0 +1,8 @@ +# DataSource + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accounts` | List<[io.codat.lending.models.shared.Accounts](../../models/shared/Accounts.md)> | :heavy_minus_sign: | An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. | \ No newline at end of file diff --git a/lending/docs/models/shared/DataStatus.md b/lending/docs/models/shared/DataStatus.md new file mode 100644 index 00000000..7c20f03b --- /dev/null +++ b/lending/docs/models/shared/DataStatus.md @@ -0,0 +1,14 @@ +# DataStatus + +Describes the state of data in the Codat cache for a company and data type + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currentStatus` | *String* | :heavy_check_mark: | The current status of the dataset in Codat's cache. | | +| `dataType` | [io.codat.lending.models.shared.DataTypes](../../models/shared/DataTypes.md) | :heavy_check_mark: | Available Data types | invoices | +| `lastSuccessfulSync` | *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 | +| `latestSuccessfulSyncId` | *Optional* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | +| `latestSyncId` | *Optional* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | \ No newline at end of file diff --git a/lending/docs/models/shared/DataType.md b/lending/docs/models/shared/DataType.md new file mode 100644 index 00000000..7a5f1617 --- /dev/null +++ b/lending/docs/models/shared/DataType.md @@ -0,0 +1,52 @@ +# DataType + +Available Data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/lending/docs/models/shared/DataTypes.md b/lending/docs/models/shared/DataTypes.md new file mode 100644 index 00000000..ddabcb78 --- /dev/null +++ b/lending/docs/models/shared/DataTypes.md @@ -0,0 +1,52 @@ +# DataTypes + +Available Data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/lending/docs/models/shared/DirectCostLineItem.md b/lending/docs/models/shared/DirectCostLineItem.md new file mode 100644 index 00000000..f245ae7b --- /dev/null +++ b/lending/docs/models/shared/DirectCostLineItem.md @@ -0,0 +1,20 @@ +# DirectCostLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Friendly name of the goods or services. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Discount amount for the line before tax. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Discount percentage for the line before tax. | +| `itemRef` | [Optional](../../models/shared/PropertieItemRef.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *double* | :heavy_check_mark: | Number of units of goods or services received.

Note: If the platform does not provide this information, the quantity will be mapped as 1. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | Amount of tax for the line. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateRef.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `tracking` | [Optional](../../models/shared/Tracking.md) | :heavy_minus_sign: | N/A | +| ~~`trackingCategoryRefs`~~ | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Collection of categories against which this direct cost is tracked. | +| `unitAmount` | *double* | :heavy_check_mark: | Price of each unit of goods or services.
Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. | \ No newline at end of file diff --git a/lending/docs/models/shared/DirectCostPrototype.md b/lending/docs/models/shared/DirectCostPrototype.md new file mode 100644 index 00000000..e493e76b --- /dev/null +++ b/lending/docs/models/shared/DirectCostPrototype.md @@ -0,0 +1,19 @@ +# DirectCostPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contactRef` | [Optional](../../models/shared/ContactReference.md) | :heavy_minus_sign: | A customer or supplier associated with the direct cost. | | +| `currency` | *String* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `issueDate` | *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 | +| `lineItems` | List<[io.codat.lending.models.shared.DirectCostLineItem](../../models/shared/DirectCostLineItem.md)> | :heavy_check_mark: | An array of line items. | | +| `note` | *JsonNullable* | :heavy_minus_sign: | A note attached to the direct cost. | | +| `paymentAllocations` | List<[io.codat.lending.models.shared.AccountingPaymentAllocation](../../models/shared/AccountingPaymentAllocation.md)> | :heavy_check_mark: | An array of payment allocations. | | +| `reference` | *JsonNullable* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | +| `subTotal` | *double* | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `supplementalData` | [Optional](../../models/shared/SupplementalData.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `taxAmount` | *double* | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `totalAmount` | *double* | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file diff --git a/lending/docs/models/shared/DirectCostPrototypeDataType.md b/lending/docs/models/shared/DirectCostPrototypeDataType.md new file mode 100644 index 00000000..535f6ba9 --- /dev/null +++ b/lending/docs/models/shared/DirectCostPrototypeDataType.md @@ -0,0 +1,11 @@ +# DirectCostPrototypeDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/lending/docs/models/shared/DirectIncomeLineItem.md b/lending/docs/models/shared/DirectIncomeLineItem.md new file mode 100644 index 00000000..56bcdc67 --- /dev/null +++ b/lending/docs/models/shared/DirectIncomeLineItem.md @@ -0,0 +1,19 @@ +# DirectIncomeLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | A user-friendly name of the goods or services. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Discount amount for the line before tax. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Discount percentage for the line before tax. | +| `itemRef` | [Optional](../../models/shared/PropertieItemRef.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *double* | :heavy_check_mark: | The number of units of goods or services received.

Note: If the platform does not provide this information, the quantity will be mapped as 1. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | The amount of the line, inclusive of discounts, but exclusive of tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | The amount of tax for the line.
Note: If the platform does not provide this information, the quantity will be mapped as 0.00. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateRef.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | The total amount of the line, including tax. | +| `trackingCategoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | An array of categories against which this direct cost is tracked. | +| `unitAmount` | *double* | :heavy_check_mark: | The price of each unit of goods or services.
Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. | \ No newline at end of file diff --git a/lending/docs/models/shared/DisputeStatus.md b/lending/docs/models/shared/DisputeStatus.md new file mode 100644 index 00000000..ab25fc76 --- /dev/null +++ b/lending/docs/models/shared/DisputeStatus.md @@ -0,0 +1,20 @@ +# DisputeStatus + +Current status of the dispute + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `WON` | Won | +| `LOST` | Lost | +| `ACCEPTED` | Accepted | +| `PROCESSING` | Processing | +| `CHARGE_REFUNDED` | ChargeRefunded | +| `EVIDENCE_REQUIRED` | EvidenceRequired | +| `INQUIRY_EVIDENCE_REQUIRED` | InquiryEvidenceRequired | +| `INQUIRY_PROCESSING` | InquiryProcessing | +| `INQUIRY_CLOSED` | InquiryClosed | +| `WAITING_THIRD_PARTY` | WaitingThirdParty | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedCashFlowItem.md b/lending/docs/models/shared/EnhancedCashFlowItem.md new file mode 100644 index 00000000..ac04b201 --- /dev/null +++ b/lending/docs/models/shared/EnhancedCashFlowItem.md @@ -0,0 +1,8 @@ +# EnhancedCashFlowItem + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `transactions` | List<[io.codat.lending.models.shared.EnhancedCashFlowTransaction](../../models/shared/EnhancedCashFlowTransaction.md)> | :heavy_minus_sign: | An array of transaction data. | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedCashFlowTransaction.md b/lending/docs/models/shared/EnhancedCashFlowTransaction.md new file mode 100644 index 00000000..ff97e82d --- /dev/null +++ b/lending/docs/models/shared/EnhancedCashFlowTransaction.md @@ -0,0 +1,16 @@ +# EnhancedCashFlowTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | An account reference containing the account id and name. | | +| `amount` | *Optional* | :heavy_minus_sign: | The bank transaction amount. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `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` | *Optional* | :heavy_minus_sign: | The description of the bank transaction. | | +| `id` | *Optional* | :heavy_minus_sign: | The unique identifier of the bank transaction. | | +| `platformName` | *Optional* | :heavy_minus_sign: | Returns the payment processor responsible for the transaction. | | +| `sourceRef` | [Optional](../../models/shared/SourceRef.md) | :heavy_minus_sign: | A source reference containing the `sourceType` object "Banking". | | +| `transactionCategory` | [Optional](../../models/shared/TransactionCategory.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedCashFlowTransactions.md b/lending/docs/models/shared/EnhancedCashFlowTransactions.md new file mode 100644 index 00000000..1ffc877b --- /dev/null +++ b/lending/docs/models/shared/EnhancedCashFlowTransactions.md @@ -0,0 +1,16 @@ +# EnhancedCashFlowTransactions + +> **Categorization engine** +> +> The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source. + +The Enhanced Cash Flow Transactions endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `dataSources` | List<[io.codat.lending.models.shared.DataSource](../../models/shared/DataSource.md)> | :heavy_minus_sign: | N/A | +| `reportInfo` | [Optional](../../models/shared/ReportInfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | +| `reportItems` | List<[io.codat.lending.models.shared.EnhancedCashFlowItem](../../models/shared/EnhancedCashFlowItem.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedFinancialReport.md b/lending/docs/models/shared/EnhancedFinancialReport.md new file mode 100644 index 00000000..223b5135 --- /dev/null +++ b/lending/docs/models/shared/EnhancedFinancialReport.md @@ -0,0 +1,9 @@ +# EnhancedFinancialReport + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `reportInfo` | [Optional](../../models/shared/EnhancedReportInfo.md) | :heavy_minus_sign: | N/A | +| `reportItems` | List<[io.codat.lending.models.shared.ReportItem](../../models/shared/ReportItem.md)> | :heavy_minus_sign: | An array of report items. | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedInvoiceReportItem.md b/lending/docs/models/shared/EnhancedInvoiceReportItem.md new file mode 100644 index 00000000..a891a150 --- /dev/null +++ b/lending/docs/models/shared/EnhancedInvoiceReportItem.md @@ -0,0 +1,20 @@ +# EnhancedInvoiceReportItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amountDue` | *Optional* | :heavy_minus_sign: | Invoice's total amount due. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `customerRef` | [Optional](../../models/shared/LendingCustomerRef.md) | :heavy_minus_sign: | N/A | | +| `dueDate` | *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 | +| `id` | *Optional* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. | | +| `invoiceNumber` | *Optional* | :heavy_minus_sign: | Invoice number. | | +| `issueDate` | *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 | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `paidOnDate` | *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 | +| `payments` | List<[io.codat.lending.models.shared.Payment](../../models/shared/Payment.md)> | :heavy_minus_sign: | N/A | | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/InvoiceStatus.md) | :heavy_minus_sign: | Current state of the invoice:

- `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email.
- `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount).
- `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount).
- `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0).
- `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Invoice's total amount. | | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedInvoicesReport.md b/lending/docs/models/shared/EnhancedInvoicesReport.md new file mode 100644 index 00000000..a4a64997 --- /dev/null +++ b/lending/docs/models/shared/EnhancedInvoicesReport.md @@ -0,0 +1,11 @@ +# EnhancedInvoicesReport + +The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting platform have actually been paid by matching with the bank statement. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `reportInfo` | [Optional](../../models/shared/ReportInfo.md) | :heavy_minus_sign: | Report additional information, which is specific to Lending API reports. | +| `reportItems` | List<[io.codat.lending.models.shared.EnhancedInvoiceReportItem](../../models/shared/EnhancedInvoiceReportItem.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedReportAccountCategory.md b/lending/docs/models/shared/EnhancedReportAccountCategory.md new file mode 100644 index 00000000..4be166a0 --- /dev/null +++ b/lending/docs/models/shared/EnhancedReportAccountCategory.md @@ -0,0 +1,9 @@ +# EnhancedReportAccountCategory + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `levels` | List<[io.codat.lending.models.shared.AccountCategoryLevel](../../models/shared/AccountCategoryLevel.md)> | :heavy_minus_sign: | N/A | +| `status` | *Optional* | :heavy_minus_sign: | Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. | \ No newline at end of file diff --git a/lending/docs/models/shared/EnhancedReportInfo.md b/lending/docs/models/shared/EnhancedReportInfo.md new file mode 100644 index 00000000..2f01d4ab --- /dev/null +++ b/lending/docs/models/shared/EnhancedReportInfo.md @@ -0,0 +1,11 @@ +# EnhancedReportInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyName` | *Optional* | :heavy_minus_sign: | Name of the company queried. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `generatedDate` | *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 | +| `reportName` | *Optional* | :heavy_minus_sign: | The name of the report. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ErrorMessage.md b/lending/docs/models/shared/ErrorMessage.md new file mode 100644 index 00000000..d0d2e688 --- /dev/null +++ b/lending/docs/models/shared/ErrorMessage.md @@ -0,0 +1,13 @@ +# ErrorMessage + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `canBeRetried` | *Optional* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +| `correlationId` | *Optional* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `detailedErrorCode` | *Optional* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | +| `error` | *Optional* | :heavy_minus_sign: | A brief description of the error. | +| `service` | *Optional* | :heavy_minus_sign: | Codat's service the returned the error. | +| `statusCode` | *Optional* | :heavy_minus_sign: | The HTTP status code returned by the error. | \ No newline at end of file diff --git a/lending/docs/models/shared/ExcelReportTypes.md b/lending/docs/models/shared/ExcelReportTypes.md new file mode 100644 index 00000000..a837f126 --- /dev/null +++ b/lending/docs/models/shared/ExcelReportTypes.md @@ -0,0 +1,13 @@ +# ExcelReportTypes + +The type of the report requested in the query string. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `AUDIT` | audit | +| `ENHANCED_FINANCIALS` | enhancedFinancials | +| `ENHANCED_INVOICES` | enhancedInvoices | +| `ENHANCED_CASH_FLOW` | enhancedCashFlow | \ No newline at end of file diff --git a/lending/docs/models/shared/ExcelStatus.md b/lending/docs/models/shared/ExcelStatus.md new file mode 100644 index 00000000..4369946b --- /dev/null +++ b/lending/docs/models/shared/ExcelStatus.md @@ -0,0 +1,15 @@ +# ExcelStatus + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `errorMessage` | *Optional* | :heavy_minus_sign: | Error details in case the report generation request was unsuccessful. | | +| `fileSize` | *JsonNullable* | :heavy_minus_sign: | The file size in Bytes is populated upon successful generation of the report. | | +| `inProgress` | *Optional* | :heavy_minus_sign: | When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. | | +| `lastGenerated` | *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 | +| `lastInvocationId` | *Optional* | :heavy_minus_sign: | A unique ID generated for this request. | | +| `queued` | *Optional* | :heavy_minus_sign: | The date and time of when a successful request was queued for the most recent report. | | +| `reportType` | [Optional](../../models/shared/ExcelReportTypes.md) | :heavy_minus_sign: | The type of the report requested in the query string. | | +| `success` | *Optional* | :heavy_minus_sign: | True if the requested report was successfully queued and false if the requested report was not able to be queued. | | \ No newline at end of file diff --git a/lending/docs/models/shared/File.md b/lending/docs/models/shared/File.md new file mode 100644 index 00000000..13d6554e --- /dev/null +++ b/lending/docs/models/shared/File.md @@ -0,0 +1,11 @@ +# File + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `displayName` | *JsonNullable* | :heavy_minus_sign: | An optional display name for the file. | | +| `fileName` | *JsonNullable* | :heavy_minus_sign: | The file's name. | | +| `sourceType` | *JsonNullable* | :heavy_minus_sign: | The source of the file uploaded. | | +| `uploaded` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/FileUpload.md b/lending/docs/models/shared/FileUpload.md new file mode 100644 index 00000000..a0ab1ca3 --- /dev/null +++ b/lending/docs/models/shared/FileUpload.md @@ -0,0 +1,8 @@ +# FileUpload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `file` | [io.codat.lending.models.shared.CodatFile](../../models/shared/CodatFile.md) | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file diff --git a/lending/docs/models/shared/GroupReference.md b/lending/docs/models/shared/GroupReference.md new file mode 100644 index 00000000..4a6f28d5 --- /dev/null +++ b/lending/docs/models/shared/GroupReference.md @@ -0,0 +1,8 @@ +# GroupReference + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/shared/HalRef.md b/lending/docs/models/shared/HalRef.md new file mode 100644 index 00000000..1e00ce17 --- /dev/null +++ b/lending/docs/models/shared/HalRef.md @@ -0,0 +1,8 @@ +# HalRef + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `href` | *Optional* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/lending/docs/models/shared/IntegrityStatus.md b/lending/docs/models/shared/IntegrityStatus.md new file mode 100644 index 00000000..e2e94744 --- /dev/null +++ b/lending/docs/models/shared/IntegrityStatus.md @@ -0,0 +1,13 @@ +# IntegrityStatus + +The current status of the most recently run matching algorithm. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `DOES_NOT_EXIST` | DoesNotExist | +| `ERROR` | Error | +| `COMPLETE` | Complete | \ No newline at end of file diff --git a/lending/docs/models/shared/InvoiceLineItem.md b/lending/docs/models/shared/InvoiceLineItem.md new file mode 100644 index 00000000..1018907e --- /dev/null +++ b/lending/docs/models/shared/InvoiceLineItem.md @@ -0,0 +1,21 @@ +# InvoiceLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Friendly name of the goods or services provided. | +| `discountAmount` | *JsonNullable* | :heavy_minus_sign: | Numerical value of any discounts applied. | +| `discountPercentage` | *JsonNullable* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any discounts applied to the unit amount. | +| `isDirectIncome` | *Optional* | :heavy_minus_sign: | The invoice is a direct income if `True`. | +| `itemRef` | [Optional](../../models/shared/PropertieItemRef.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *double* | :heavy_check_mark: | Number of units of goods or services provided. | +| `subTotal` | *JsonNullable* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `taxAmount` | *JsonNullable* | :heavy_minus_sign: | Amount of tax for the line. | +| `taxRateRef` | [Optional](../../models/shared/TaxRateRef.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `totalAmount` | *JsonNullable* | :heavy_minus_sign: | Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. | +| `tracking` | [Optional](../../models/shared/AccountsReceivableTracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| `trackingCategoryRefs` | List<[io.codat.lending.models.shared.TrackingCategoryRef](../../models/shared/TrackingCategoryRef.md)> | :heavy_minus_sign: | Reference to the tracking categories to which the line item is linked. | +| `unitAmount` | *double* | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file diff --git a/lending/docs/models/shared/InvoiceStatus.md b/lending/docs/models/shared/InvoiceStatus.md new file mode 100644 index 00000000..7037aef9 --- /dev/null +++ b/lending/docs/models/shared/InvoiceStatus.md @@ -0,0 +1,21 @@ +# InvoiceStatus + +Current state of the invoice: + +- `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. +- `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). +- `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). +- `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). +- `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `DRAFT` | Draft | +| `SUBMITTED` | Submitted | +| `PARTIALLY_PAID` | PartiallyPaid | +| `PAID` | Paid | +| `VOID_` | Void | \ No newline at end of file diff --git a/lending/docs/models/shared/ItemRef.md b/lending/docs/models/shared/ItemRef.md new file mode 100644 index 00000000..3f92506d --- /dev/null +++ b/lending/docs/models/shared/ItemRef.md @@ -0,0 +1,10 @@ +# ItemRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `dataConnectionId` | *Optional* | :heavy_minus_sign: | The data connection id being referenced. | +| `id` | *Optional* | :heavy_minus_sign: | The id of the object, e.g. the Journal entry. | +| `type` | *Optional* | :heavy_minus_sign: | The data type the loan transaction entry was extracted from. | \ No newline at end of file diff --git a/lending/docs/models/shared/ItemReference.md b/lending/docs/models/shared/ItemReference.md new file mode 100644 index 00000000..f9d1fb92 --- /dev/null +++ b/lending/docs/models/shared/ItemReference.md @@ -0,0 +1,11 @@ +# ItemReference + +Reference to the item the line is linked to. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Unique identifier for the item in the accounting platform. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/Items.md b/lending/docs/models/shared/Items.md new file mode 100644 index 00000000..78eb847e --- /dev/null +++ b/lending/docs/models/shared/Items.md @@ -0,0 +1,8 @@ +# Items + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalEntryRecordRef.md b/lending/docs/models/shared/JournalEntryRecordRef.md new file mode 100644 index 00000000..0c06fd2c --- /dev/null +++ b/lending/docs/models/shared/JournalEntryRecordRef.md @@ -0,0 +1,11 @@ +# JournalEntryRecordRef + +Links a journal entry to the underlying record that created it. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [Optional](../../models/shared/JournalEntryRecordRefDataType.md) | :heavy_minus_sign: | Name of underlying data type. | transfers | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalEntryRecordRefDataType.md b/lending/docs/models/shared/JournalEntryRecordRefDataType.md new file mode 100644 index 00000000..2fc37230 --- /dev/null +++ b/lending/docs/models/shared/JournalEntryRecordRefDataType.md @@ -0,0 +1,20 @@ +# JournalEntryRecordRefDataType + +Name of underlying data type. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CREDIT_NOTES` | creditNotes | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `JOURNAL_ENTRIES` | journalEntries | +| `PAYMENTS` | payments | +| `TRANSFERS` | transfers | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalLine.md b/lending/docs/models/shared/JournalLine.md new file mode 100644 index 00000000..260dc1c9 --- /dev/null +++ b/lending/docs/models/shared/JournalLine.md @@ -0,0 +1,12 @@ +# JournalLine + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `currency` | *JsonNullable* | :heavy_minus_sign: | Currency for the journal line item. | +| `description` | *JsonNullable* | :heavy_minus_sign: | Description of the journal line item. | +| `netAmount` | *double* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | +| `tracking` | [Optional](../../models/shared/JournalLineTracking.md) | :heavy_minus_sign: | List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalLineTracking.md b/lending/docs/models/shared/JournalLineTracking.md new file mode 100644 index 00000000..08f52581 --- /dev/null +++ b/lending/docs/models/shared/JournalLineTracking.md @@ -0,0 +1,10 @@ +# JournalLineTracking + +List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `recordRefs` | List<[io.codat.lending.models.shared.TrackingRecordRef](../../models/shared/TrackingRecordRef.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalRef.md b/lending/docs/models/shared/JournalRef.md new file mode 100644 index 00000000..18974b50 --- /dev/null +++ b/lending/docs/models/shared/JournalRef.md @@ -0,0 +1,11 @@ +# JournalRef + +Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *String* | :heavy_check_mark: | GUID of the underlying journal. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of journal | \ No newline at end of file diff --git a/lending/docs/models/shared/JournalStatus.md b/lending/docs/models/shared/JournalStatus.md new file mode 100644 index 00000000..c1ebc383 --- /dev/null +++ b/lending/docs/models/shared/JournalStatus.md @@ -0,0 +1,12 @@ +# JournalStatus + +Current journal status. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/lending/docs/models/shared/LendingCustomerRef.md b/lending/docs/models/shared/LendingCustomerRef.md new file mode 100644 index 00000000..020aa269 --- /dev/null +++ b/lending/docs/models/shared/LendingCustomerRef.md @@ -0,0 +1,9 @@ +# LendingCustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `customerName` | *JsonNullable* | :heavy_minus_sign: | `customerName` from the Customer data type. | +| `id` | *Optional* | :heavy_minus_sign: | `id` from the Customers data type. | \ No newline at end of file diff --git a/lending/docs/models/shared/Links.md b/lending/docs/models/shared/Links.md new file mode 100644 index 00000000..47c218e2 --- /dev/null +++ b/lending/docs/models/shared/Links.md @@ -0,0 +1,11 @@ +# Links + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `current` | [io.codat.lending.models.shared.HalRef](../../models/shared/HalRef.md) | :heavy_check_mark: | N/A | +| `next` | [Optional](../../models/shared/HalRef.md) | :heavy_minus_sign: | N/A | +| `previous` | [Optional](../../models/shared/HalRef.md) | :heavy_minus_sign: | N/A | +| `self` | [io.codat.lending.models.shared.HalRef](../../models/shared/HalRef.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanRef.md b/lending/docs/models/shared/LoanRef.md new file mode 100644 index 00000000..15c83581 --- /dev/null +++ b/lending/docs/models/shared/LoanRef.md @@ -0,0 +1,10 @@ +# LoanRef + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `dataConnectionId` | *Optional* | :heavy_minus_sign: | The dataConnectionId the object being referred to is associated with. | +| `id` | *Optional* | :heavy_minus_sign: | The id of the object being referred to. | +| `type` | *Optional* | :heavy_minus_sign: | The object type data is referring to, e.g. Account. | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummary.md b/lending/docs/models/shared/LoanSummary.md new file mode 100644 index 00000000..acd87989 --- /dev/null +++ b/lending/docs/models/shared/LoanSummary.md @@ -0,0 +1,9 @@ +# LoanSummary + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `reportInfo` | [Optional](../../models/shared/LoanSummaryReportInfo.md) | :heavy_minus_sign: | N/A | +| `reportItems` | List<[io.codat.lending.models.shared.LoanSummaryReportItem](../../models/shared/LoanSummaryReportItem.md)> | :heavy_minus_sign: | Returns a summary of all loan activity for that integration type | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummaryIntegrationType.md b/lending/docs/models/shared/LoanSummaryIntegrationType.md new file mode 100644 index 00000000..9aeee4be --- /dev/null +++ b/lending/docs/models/shared/LoanSummaryIntegrationType.md @@ -0,0 +1,12 @@ +# LoanSummaryIntegrationType + +The integration type begin referred to. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACCOUNTING` | Accounting | +| `BANKING` | Banking | +| `COMMERCE` | Commerce | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummaryRecordRef.md b/lending/docs/models/shared/LoanSummaryRecordRef.md new file mode 100644 index 00000000..6723aef7 --- /dev/null +++ b/lending/docs/models/shared/LoanSummaryRecordRef.md @@ -0,0 +1,11 @@ +# LoanSummaryRecordRef + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `dataConnectionId` | *Optional* | :heavy_minus_sign: | The dataConnectionId the object being referred to is associated with. | +| `id` | *Optional* | :heavy_minus_sign: | The id of the object being referred to. | +| `integrationType` | [Optional](../../models/shared/LoanSummaryIntegrationType.md) | :heavy_minus_sign: | The integration type begin referred to. | +| `recordRefType` | [Optional](../../models/shared/LoanSummaryRecordRefType.md) | :heavy_minus_sign: | The datatype being referred to. | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummaryRecordRefType.md b/lending/docs/models/shared/LoanSummaryRecordRefType.md new file mode 100644 index 00000000..22111945 --- /dev/null +++ b/lending/docs/models/shared/LoanSummaryRecordRefType.md @@ -0,0 +1,12 @@ +# LoanSummaryRecordRefType + +The datatype being referred to. + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `ACCOUNTS` | accounts | +| `BANKING_ACCOUNTS` | banking-accounts | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummaryReportInfo.md b/lending/docs/models/shared/LoanSummaryReportInfo.md new file mode 100644 index 00000000..cf3ab520 --- /dev/null +++ b/lending/docs/models/shared/LoanSummaryReportInfo.md @@ -0,0 +1,10 @@ +# LoanSummaryReportInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyName` | *Optional* | :heavy_minus_sign: | Name of the company queried. | | +| `generatedDate` | *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 | +| `reportName` | *Optional* | :heavy_minus_sign: | The name of the report. | | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanSummaryReportItem.md b/lending/docs/models/shared/LoanSummaryReportItem.md new file mode 100644 index 00000000..8473f53a --- /dev/null +++ b/lending/docs/models/shared/LoanSummaryReportItem.md @@ -0,0 +1,14 @@ +# LoanSummaryReportItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `balance` | *Optional* | :heavy_minus_sign: | The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. | | +| `description` | *Optional* | :heavy_minus_sign: | The description of the object being referred to. E.g. the account. | | +| `lenderName` | *Optional* | :heavy_minus_sign: | The name of lender providing the loan. | | +| `recordRef` | [Optional](../../models/shared/LoanSummaryRecordRef.md) | :heavy_minus_sign: | N/A | | +| `startDate` | *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 | +| `totalDrawdowns` | *Optional* | :heavy_minus_sign: | The total loan drawdowns. | | +| `totalRepayments` | *Optional* | :heavy_minus_sign: | The total loan repayments which includes capital plus any interest. | | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanTransactionType.md b/lending/docs/models/shared/LoanTransactionType.md new file mode 100644 index 00000000..ed339ded --- /dev/null +++ b/lending/docs/models/shared/LoanTransactionType.md @@ -0,0 +1,13 @@ +# LoanTransactionType + +The type of loan transaction. + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `INVESTMENT` | Investment | +| `REPAYMENT` | Repayment | +| `INTEREST` | Interest | +| `ACCURED_INTEREST` | AccuredInterest | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanTransactions.md b/lending/docs/models/shared/LoanTransactions.md new file mode 100644 index 00000000..339893de --- /dev/null +++ b/lending/docs/models/shared/LoanTransactions.md @@ -0,0 +1,10 @@ +# LoanTransactions + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `errors` | List<*java.lang.Object*> | :heavy_minus_sign: | If there are no errors, an empty array is returned. | +| `reportInfo` | [Optional](../../models/shared/LoanTransactionsReportInfo.md) | :heavy_minus_sign: | N/A | +| `reportItems` | List<[io.codat.lending.models.shared.ReportItems](../../models/shared/ReportItems.md)> | :heavy_minus_sign: | Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. | \ No newline at end of file diff --git a/lending/docs/models/shared/LoanTransactionsReportInfo.md b/lending/docs/models/shared/LoanTransactionsReportInfo.md new file mode 100644 index 00000000..40728f02 --- /dev/null +++ b/lending/docs/models/shared/LoanTransactionsReportInfo.md @@ -0,0 +1,13 @@ +# LoanTransactionsReportInfo + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyName` | *Optional* | :heavy_minus_sign: | Name of the company queried. | | +| `generatedDate` | *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 | +| `pageNumber` | *Optional* | :heavy_minus_sign: | The page number. | | +| `pageSize` | *Optional* | :heavy_minus_sign: | Queried page size. | | +| `reportName` | *Optional* | :heavy_minus_sign: | The name of the report. | | +| `totalResults` | *Optional* | :heavy_minus_sign: | The total number of transactions returned. | | \ No newline at end of file diff --git a/lending/docs/models/shared/LocationRef.md b/lending/docs/models/shared/LocationRef.md new file mode 100644 index 00000000..f93cf3d7 --- /dev/null +++ b/lending/docs/models/shared/LocationRef.md @@ -0,0 +1,11 @@ +# LocationRef + +Reference to the geographic location where the order was placed. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identitifer of the location being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional* | :heavy_minus_sign: | Name of the location being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/Metadata.md b/lending/docs/models/shared/Metadata.md new file mode 100644 index 00000000..e5a24b7d --- /dev/null +++ b/lending/docs/models/shared/Metadata.md @@ -0,0 +1,8 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `isDeleted` | *JsonNullable* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/lending/docs/models/shared/OrderDiscountAllocation.md b/lending/docs/models/shared/OrderDiscountAllocation.md new file mode 100644 index 00000000..434836f4 --- /dev/null +++ b/lending/docs/models/shared/OrderDiscountAllocation.md @@ -0,0 +1,9 @@ +# OrderDiscountAllocation + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *Optional* | :heavy_minus_sign: | Name of the discount in the commerce or point of sale platform. | Promotional Discount | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). | 15.25 | \ No newline at end of file diff --git a/lending/docs/models/shared/OrderLineItem.md b/lending/docs/models/shared/OrderLineItem.md new file mode 100644 index 00000000..6ab355d0 --- /dev/null +++ b/lending/docs/models/shared/OrderLineItem.md @@ -0,0 +1,17 @@ +# OrderLineItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `discountAllocations` | List<[io.codat.lending.models.shared.OrderDiscountAllocation](../../models/shared/OrderDiscountAllocation.md)> | :heavy_minus_sign: | N/A | | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `productRef` | [Optional](../../models/shared/ProductRef.md) | :heavy_minus_sign: | Reference that links the line item to the correct product details. | | +| `productVariantRef` | [Optional](../../models/shared/ProductVariantRef.md) | :heavy_minus_sign: | Reference that links the line item to the specific version of product that has been ordered. | | +| `quantity` | *Optional* | :heavy_minus_sign: | Number of units of the product sold.
For refunds, quantity is negative.
| | +| `taxPercentage` | *Optional* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any sales tax applied to the unit price. | 0 | +| `taxes` | List<[io.codat.lending.models.shared.TaxComponentAllocation](../../models/shared/TaxComponentAllocation.md)> | :heavy_minus_sign: | Taxes breakdown as applied to order lines. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | | +| `totalTaxAmount` | *Optional* | :heavy_minus_sign: | Total amount of tax applied to the line item, factoring in any discounts. | | +| `unitPrice` | *Optional* | :heavy_minus_sign: | Price per unit of goods or services, excluding discounts and tax. | | \ No newline at end of file diff --git a/lending/docs/models/shared/Payment.md b/lending/docs/models/shared/Payment.md new file mode 100644 index 00000000..9c04fe53 --- /dev/null +++ b/lending/docs/models/shared/Payment.md @@ -0,0 +1,14 @@ +# Payment + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | Payment amount. | | +| `bankingTransactionRefs` | List<[io.codat.lending.models.shared.BankingTransactionRef](../../models/shared/BankingTransactionRef.md)> | :heavy_minus_sign: | N/A | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `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 | +| `id` | *Optional* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. | | +| `paymentType` | *Optional* | :heavy_minus_sign: | The type of payment. | | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentAllocationPayment.md b/lending/docs/models/shared/PaymentAllocationPayment.md new file mode 100644 index 00000000..554afaa9 --- /dev/null +++ b/lending/docs/models/shared/PaymentAllocationPayment.md @@ -0,0 +1,15 @@ +# PaymentAllocationPayment + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | | +| `id` | *Optional* | :heavy_minus_sign: | Identifier of the allocated payment. | | +| `note` | *JsonNullable* | :heavy_minus_sign: | Notes attached to the allocated payment. | | +| `paidOnDate` | *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 | +| `reference` | *JsonNullable* | :heavy_minus_sign: | Reference to the allocated payment. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentLine.md b/lending/docs/models/shared/PaymentLine.md new file mode 100644 index 00000000..2ef00f36 --- /dev/null +++ b/lending/docs/models/shared/PaymentLine.md @@ -0,0 +1,10 @@ +# PaymentLine + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocatedOnDate` | *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 | +| `amount` | *double* | :heavy_check_mark: | Amount in the payment currency. | | +| `links` | List<[io.codat.lending.models.shared.PaymentLineLink](../../models/shared/PaymentLineLink.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentLineLink.md b/lending/docs/models/shared/PaymentLineLink.md new file mode 100644 index 00000000..25fcd87e --- /dev/null +++ b/lending/docs/models/shared/PaymentLineLink.md @@ -0,0 +1,11 @@ +# PaymentLineLink + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *JsonNullable* | :heavy_minus_sign: | Amount by which the balance of the linked entity is altered, in the currency of the linked entity.
A negative link amount _reduces_ the outstanding amount on the accounts receivable account.
A positive link amount _increases_ the outstanding amount on the accounts receivable account. | +| `currencyRate` | *JsonNullable* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | +| `type` | [io.codat.lending.models.shared.PaymentLinkType](../../models/shared/PaymentLinkType.md) | :heavy_check_mark: | Types of payment line links, either:
`Unknown`
`Unlinked` - Not used
`Invoice` - ID refers to the invoice
`CreditNote` - ID refers to the credit note
`Refund` - ID refers to the sibling payment
`Payment` - ID refers to the sibling payment
`PaymentOnAccount` - ID refers to the customer
`Other` - ID refers to the customer
`Manual Journal`
`Discount` - ID refers to the payment | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentLinkType.md b/lending/docs/models/shared/PaymentLinkType.md new file mode 100644 index 00000000..1c7405e5 --- /dev/null +++ b/lending/docs/models/shared/PaymentLinkType.md @@ -0,0 +1,29 @@ +# PaymentLinkType + +Types of payment line links, either: +`Unknown` +`Unlinked` - Not used +`Invoice` - ID refers to the invoice +`CreditNote` - ID refers to the credit note +`Refund` - ID refers to the sibling payment +`Payment` - ID refers to the sibling payment +`PaymentOnAccount` - ID refers to the customer +`Other` - ID refers to the customer +`Manual Journal` +`Discount` - ID refers to the payment + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `UNKNOWN` | Unknown | +| `UNLINKED` | Unlinked | +| `INVOICE` | Invoice | +| `CREDIT_NOTE` | CreditNote | +| `OTHER` | Other | +| `REFUND` | Refund | +| `PAYMENT` | Payment | +| `PAYMENT_ON_ACCOUNT` | PaymentOnAccount | +| `MANUAL_JOURNAL` | ManualJournal | +| `DISCOUNT` | Discount | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentMethodRef.md b/lending/docs/models/shared/PaymentMethodRef.md new file mode 100644 index 00000000..3ca31c45 --- /dev/null +++ b/lending/docs/models/shared/PaymentMethodRef.md @@ -0,0 +1,11 @@ +# PaymentMethodRef + +The payment method the record is linked to in the accounting or commerce platform. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identifier of the location being referenced. | +| `name` | *Optional* | :heavy_minus_sign: | Name of the location being referenced. | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentRef.md b/lending/docs/models/shared/PaymentRef.md new file mode 100644 index 00000000..2cb596a2 --- /dev/null +++ b/lending/docs/models/shared/PaymentRef.md @@ -0,0 +1,17 @@ +# PaymentRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *JsonNullable* | :heavy_minus_sign: | Payment Amount (including gratuity). | 194.12 | +| `createdDate` | *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 | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `dueDate` | *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 | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `paymentProvider` | *Optional* | :heavy_minus_sign: | Service provider of the payment, if applicable. | Amazon Pay | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/PaymentStatus.md) | :heavy_minus_sign: | Status of the payment. | | +| `type` | [JsonNullable](../../models/shared/PaymentType.md) | :heavy_minus_sign: | Type of payment. | Cash | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentStatus.md b/lending/docs/models/shared/PaymentStatus.md new file mode 100644 index 00000000..9a74e931 --- /dev/null +++ b/lending/docs/models/shared/PaymentStatus.md @@ -0,0 +1,15 @@ +# PaymentStatus + +Status of the payment. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `PENDING` | Pending | +| `AUTHORIZED` | Authorized | +| `PAID` | Paid | +| `FAILED` | Failed | +| `CANCELLED` | Cancelled | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/PaymentType.md b/lending/docs/models/shared/PaymentType.md new file mode 100644 index 00000000..a72ccf82 --- /dev/null +++ b/lending/docs/models/shared/PaymentType.md @@ -0,0 +1,21 @@ +# PaymentType + +Type of payment. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `CASH` | Cash | +| `CARD` | Card | +| `INVOICE` | Invoice | +| `ONLINE_CARD` | OnlineCard | +| `SWISH` | Swish | +| `VIPPS` | Vipps | +| `MOBILE` | Mobile | +| `STORE_CREDIT` | StoreCredit | +| `PAYPAL` | Paypal | +| `CUSTOM` | Custom | +| `PREPAID` | Prepaid | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/PeriodUnit.md b/lending/docs/models/shared/PeriodUnit.md new file mode 100644 index 00000000..16c4ad09 --- /dev/null +++ b/lending/docs/models/shared/PeriodUnit.md @@ -0,0 +1,11 @@ +# PeriodUnit + + +## Values + +| Name | Value | +| ------- | ------- | +| `DAY` | Day | +| `WEEK` | Week | +| `MONTH` | Month | +| `YEAR` | Year | \ No newline at end of file diff --git a/lending/docs/models/shared/PhoneNumber.md b/lending/docs/models/shared/PhoneNumber.md new file mode 100644 index 00000000..60ca3492 --- /dev/null +++ b/lending/docs/models/shared/PhoneNumber.md @@ -0,0 +1,9 @@ +# PhoneNumber + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `number` | *Optional* | :heavy_check_mark: | A phone number. | +44 25691 154789 | +| `type` | [io.codat.lending.models.shared.PhoneNumberType](../../models/shared/PhoneNumberType.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file diff --git a/lending/docs/models/shared/PhoneNumberType.md b/lending/docs/models/shared/PhoneNumberType.md new file mode 100644 index 00000000..4702d4b7 --- /dev/null +++ b/lending/docs/models/shared/PhoneNumberType.md @@ -0,0 +1,14 @@ +# PhoneNumberType + +The type of phone number + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PRIMARY` | Primary | +| `LANDLINE` | Landline | +| `MOBILE` | Mobile | +| `FAX` | Fax | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductInventory.md b/lending/docs/models/shared/ProductInventory.md new file mode 100644 index 00000000..6cbe9ec2 --- /dev/null +++ b/lending/docs/models/shared/ProductInventory.md @@ -0,0 +1,11 @@ +# ProductInventory + +Information about the total inventory as well as the locations inventory is in. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `locations` | List<[io.codat.lending.models.shared.ProductInventoryLocation](../../models/shared/ProductInventoryLocation.md)> | :heavy_minus_sign: | N/A | +| `totalQuantity` | *JsonNullable* | :heavy_minus_sign: | The total quantity of stock remaining across locations. | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductInventoryLocation.md b/lending/docs/models/shared/ProductInventoryLocation.md new file mode 100644 index 00000000..fb3473d4 --- /dev/null +++ b/lending/docs/models/shared/ProductInventoryLocation.md @@ -0,0 +1,9 @@ +# ProductInventoryLocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `locationRef` | [Optional](../../models/shared/LocationRef.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | +| `quantity` | *Optional* | :heavy_minus_sign: | The quantity of stock remaining at location. | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductPrice.md b/lending/docs/models/shared/ProductPrice.md new file mode 100644 index 00000000..424ba67e --- /dev/null +++ b/lending/docs/models/shared/ProductPrice.md @@ -0,0 +1,9 @@ +# ProductPrice + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `unitPrice` | *Optional* | :heavy_minus_sign: | The product variant's unit price. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductRef.md b/lending/docs/models/shared/ProductRef.md new file mode 100644 index 00000000..04a988bc --- /dev/null +++ b/lending/docs/models/shared/ProductRef.md @@ -0,0 +1,11 @@ +# ProductRef + +Reference that links the line item to the correct product details. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `id` | *String* | :heavy_check_mark: | The unique identifier of the product being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional* | :heavy_minus_sign: | Name of the product being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductVariant.md b/lending/docs/models/shared/ProductVariant.md new file mode 100644 index 00000000..eaf5b912 --- /dev/null +++ b/lending/docs/models/shared/ProductVariant.md @@ -0,0 +1,24 @@ +# ProductVariant + +Represents a variation of a product available for sale, for example an item of clothing that may be available for sale in multiple sizes and colors. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `barcode` | *Optional* | :heavy_minus_sign: | Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. | 564158468416486458646886484 | +| `createdDate` | *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 | +| `id` | *String* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `inventory` | [Optional](../../models/shared/ProductInventory.md) | :heavy_minus_sign: | Information about the total inventory as well as the locations inventory is in. | | +| `isTaxEnabled` | *Optional* | :heavy_minus_sign: | Whether sales taxes are enabled for this product variant. | | +| `modifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *Optional* | :heavy_minus_sign: | Name of the product recorded in the commerce or point of sale platform. | Red Coat | +| `prices` | List<[io.codat.lending.models.shared.ProductPrice](../../models/shared/ProductPrice.md)> | :heavy_minus_sign: | Prices for the product variants in different currencies. | | +| `shippingRequired` | *Optional* | :heavy_minus_sign: | Indicates whether or not the product requires physical delivery. | | +| `sku` | *Optional* | :heavy_minus_sign: | SKU (stock keeping unit) of the variant, as defined by the merchant. | Coat-Red-Lrg | +| `sourceModifiedDate` | *Optional* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional](../../models/shared/ProductVariantStatus.md) | :heavy_minus_sign: | The status of the product variant. | | +| `unitOfMeasure` | *Optional* | :heavy_minus_sign: | Unit of measure for the variant, such as `kg` or `meters`. | kg | +| `vatPercentage` | *Optional* | :heavy_minus_sign: | VAT rate for the product variant if sales taxes are enabled. | 12.5 | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductVariantRef.md b/lending/docs/models/shared/ProductVariantRef.md new file mode 100644 index 00000000..4884a36a --- /dev/null +++ b/lending/docs/models/shared/ProductVariantRef.md @@ -0,0 +1,11 @@ +# ProductVariantRef + +Reference that links the line item to the specific version of product that has been ordered. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identifier of the product variant being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional* | :heavy_minus_sign: | Name of the product variant being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ProductVariantStatus.md b/lending/docs/models/shared/ProductVariantStatus.md new file mode 100644 index 00000000..cac82c98 --- /dev/null +++ b/lending/docs/models/shared/ProductVariantStatus.md @@ -0,0 +1,12 @@ +# ProductVariantStatus + +The status of the product variant. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `UNKNOWN` | Unknown | +| `PUBLISHED` | Published | +| `UNPUBLISHED` | Unpublished | \ No newline at end of file diff --git a/lending/docs/models/shared/ProfitAndLossReport.md b/lending/docs/models/shared/ProfitAndLossReport.md new file mode 100644 index 00000000..0da24e6a --- /dev/null +++ b/lending/docs/models/shared/ProfitAndLossReport.md @@ -0,0 +1,18 @@ +# ProfitAndLossReport + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `costOfSales` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `expenses` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `fromDate` | *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 | +| `grossProfit` | *double* | :heavy_check_mark: | Gross profit of the company in the given date range. | | +| `income` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `netOperatingProfit` | *double* | :heavy_check_mark: | Net operating profit of the company in the given date range. | | +| `netOtherIncome` | *double* | :heavy_check_mark: | Net other income of the company in the given date range. | | +| `netProfit` | *double* | :heavy_check_mark: | Net profit of the company in the given date range. | | +| `otherExpenses` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `otherIncome` | [Optional](../../models/shared/ReportLineInput.md) | :heavy_minus_sign: | N/A | | +| `toDate` | *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 | \ No newline at end of file diff --git a/lending/docs/models/shared/ProjectRef.md b/lending/docs/models/shared/ProjectRef.md new file mode 100644 index 00000000..fdcc7b18 --- /dev/null +++ b/lending/docs/models/shared/ProjectRef.md @@ -0,0 +1,9 @@ +# ProjectRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Unique identifier to the project reference. | +| `name` | *JsonNullable* | :heavy_minus_sign: | The project's name. | \ No newline at end of file diff --git a/lending/docs/models/shared/PropertieItemRef.md b/lending/docs/models/shared/PropertieItemRef.md new file mode 100644 index 00000000..ec7ac4af --- /dev/null +++ b/lending/docs/models/shared/PropertieItemRef.md @@ -0,0 +1,11 @@ +# PropertieItemRef + +Reference to the item the line is linked to. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Unique identifier for the item in the accounting platform. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/PullOperation.md b/lending/docs/models/shared/PullOperation.md new file mode 100644 index 00000000..5d7ab728 --- /dev/null +++ b/lending/docs/models/shared/PullOperation.md @@ -0,0 +1,22 @@ +# PullOperation + +Information about a queued, in progress or completed pull operation. +*Formally called `dataset`* + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | +| `completed` | *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 | +| `connectionId` | *String* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | +| `dataType` | *String* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about a transient or persistent error. | | +| `id` | *String* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | +| `isCompleted` | *boolean* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | +| `isErrored` | *boolean* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | +| `progress` | *long* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | +| `requested` | *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 | +| `status` | [io.codat.lending.models.shared.PullOperationStatus](../../models/shared/PullOperationStatus.md) | :heavy_check_mark: | The current status of the pull operation. | Complete | +| `statusDescription` | *JsonNullable* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/lending/docs/models/shared/PullOperationStatus.md b/lending/docs/models/shared/PullOperationStatus.md new file mode 100644 index 00000000..8f1bae91 --- /dev/null +++ b/lending/docs/models/shared/PullOperationStatus.md @@ -0,0 +1,32 @@ +# PullOperationStatus + +The current status of the pull operation. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `INITIAL` | Initial | +| `QUEUED` | Queued | +| `FETCHING` | Fetching | +| `MAP_QUEUED` | MapQueued | +| `MAPPING` | Mapping | +| `COMPLETE` | Complete | +| `FETCH_ERROR` | FetchError | +| `MAP_ERROR` | MapError | +| `INTERNAL_ERROR` | InternalError | +| `PROCESSING_QUEUED` | ProcessingQueued | +| `PROCESSING` | Processing | +| `PROCESSING_ERROR` | ProcessingError | +| `VALIDATION_QUEUED` | ValidationQueued | +| `VALIDATING` | Validating | +| `VALIDATION_ERROR` | ValidationError | +| `AUTH_ERROR` | AuthError | +| `CANCELLED` | Cancelled | +| `ROUTING` | Routing | +| `ROUTING_ERROR` | RoutingError | +| `NOT_SUPPORTED` | NotSupported | +| `RATE_LIMIT_ERROR` | RateLimitError | +| `PERMISSIONS_ERROR` | PermissionsError | +| `PREREQUISITE_NOT_MET` | PrerequisiteNotMet | \ No newline at end of file diff --git a/lending/docs/models/shared/PullOperations.md b/lending/docs/models/shared/PullOperations.md new file mode 100644 index 00000000..e30fe1cb --- /dev/null +++ b/lending/docs/models/shared/PullOperations.md @@ -0,0 +1,12 @@ +# PullOperations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.PullOperation](../../models/shared/PullOperation.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/PurchaseOrderReference.md b/lending/docs/models/shared/PurchaseOrderReference.md new file mode 100644 index 00000000..cb95e12a --- /dev/null +++ b/lending/docs/models/shared/PurchaseOrderReference.md @@ -0,0 +1,9 @@ +# PurchaseOrderReference + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *Optional* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting platform. | +| `purchaseOrderNumber` | *JsonNullable* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/PushChangeType.md b/lending/docs/models/shared/PushChangeType.md new file mode 100644 index 00000000..33a957e7 --- /dev/null +++ b/lending/docs/models/shared/PushChangeType.md @@ -0,0 +1,14 @@ +# PushChangeType + +Type of change being applied to record in third party platform. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `UNKNOWN` | Unknown | +| `CREATED` | Created | +| `MODIFIED` | Modified | +| `DELETED` | Deleted | +| `ATTACHMENT_UPLOADED` | AttachmentUploaded | \ No newline at end of file diff --git a/lending/docs/models/shared/PushFieldValidation.md b/lending/docs/models/shared/PushFieldValidation.md new file mode 100644 index 00000000..c6e37d97 --- /dev/null +++ b/lending/docs/models/shared/PushFieldValidation.md @@ -0,0 +1,10 @@ +# PushFieldValidation + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `details` | *String* | :heavy_check_mark: | Details on the validation issue. | +| `field` | *Optional* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `ref` | *JsonNullable* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOperation.md b/lending/docs/models/shared/PushOperation.md new file mode 100644 index 00000000..df842b75 --- /dev/null +++ b/lending/docs/models/shared/PushOperation.md @@ -0,0 +1,20 @@ +# PushOperation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | List<[io.codat.lending.models.shared.PushOperationChange](../../models/shared/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `companyId` | *String* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `completedOnUtc` | *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 | +| `dataConnectionKey` | *String* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `errorMessage` | *JsonNullable* | :heavy_minus_sign: | A message about the error. | | +| `pushOperationKey` | *String* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requestedOnUtc` | *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 | +| `status` | [io.codat.lending.models.shared.PushOperationStatus](../../models/shared/PushOperationStatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `statusCode` | *long* | :heavy_check_mark: | Push status code. | | +| `timeoutInMinutes` | *JsonNullable* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *JsonNullable* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional](../../models/shared/Validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOperationChange.md b/lending/docs/models/shared/PushOperationChange.md new file mode 100644 index 00000000..d9dbbca6 --- /dev/null +++ b/lending/docs/models/shared/PushOperationChange.md @@ -0,0 +1,10 @@ +# PushOperationChange + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `attachmentId` | *JsonNullable* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | +| `recordRef` | [Optional](../../models/shared/PushOperationRef.md) | :heavy_minus_sign: | N/A | +| `type` | [Optional](../../models/shared/PushChangeType.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOperationRef.md b/lending/docs/models/shared/PushOperationRef.md new file mode 100644 index 00000000..04368ace --- /dev/null +++ b/lending/docs/models/shared/PushOperationRef.md @@ -0,0 +1,9 @@ +# PushOperationRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `dataType` | [Optional](../../models/shared/DataType.md) | :heavy_minus_sign: | Available Data types | invoices | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for a push operation. | | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOperationStatus.md b/lending/docs/models/shared/PushOperationStatus.md new file mode 100644 index 00000000..721aaa76 --- /dev/null +++ b/lending/docs/models/shared/PushOperationStatus.md @@ -0,0 +1,13 @@ +# PushOperationStatus + +The current status of the push operation. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `PENDING` | Pending | +| `FAILED` | Failed | +| `SUCCESS` | Success | +| `TIMED_OUT` | TimedOut | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOperations.md b/lending/docs/models/shared/PushOperations.md new file mode 100644 index 00000000..5ce62c9f --- /dev/null +++ b/lending/docs/models/shared/PushOperations.md @@ -0,0 +1,12 @@ +# PushOperations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `links` | [io.codat.lending.models.shared.Links](../../models/shared/Links.md) | :heavy_check_mark: | N/A | +| `pageNumber` | *long* | :heavy_check_mark: | Current page number. | +| `pageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List<[io.codat.lending.models.shared.PushOperation](../../models/shared/PushOperation.md)> | :heavy_minus_sign: | N/A | +| `totalResults` | *long* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOption.md b/lending/docs/models/shared/PushOption.md new file mode 100644 index 00000000..ea67bac7 --- /dev/null +++ b/lending/docs/models/shared/PushOption.md @@ -0,0 +1,14 @@ +# PushOption + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `description` | *Optional* | :heavy_minus_sign: | A description of the property. | +| `displayName` | *String* | :heavy_check_mark: | The property's display name. | +| `options` | List<[io.codat.lending.models.shared.PushOptionChoice](../../models/shared/PushOptionChoice.md)> | :heavy_minus_sign: | N/A | +| `properties` | Map | :heavy_minus_sign: | N/A | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [io.codat.lending.models.shared.PushOptionType](../../models/shared/PushOptionType.md) | :heavy_check_mark: | The option type. | +| `validation` | [Optional](../../models/shared/PushValidationInfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOptionChoice.md b/lending/docs/models/shared/PushOptionChoice.md new file mode 100644 index 00000000..21d4fb4f --- /dev/null +++ b/lending/docs/models/shared/PushOptionChoice.md @@ -0,0 +1,12 @@ +# PushOptionChoice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `description` | *Optional* | :heavy_minus_sign: | A description of the property. | +| `displayName` | *Optional* | :heavy_minus_sign: | The property's display name. | +| `required` | *Optional* | :heavy_minus_sign: | The property is required if `True`. | +| `type` | [Optional](../../models/shared/PushOptionType.md) | :heavy_minus_sign: | The option type. | +| `value` | *Optional* | :heavy_minus_sign: | Allowed value for field. | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOptionProperty.md b/lending/docs/models/shared/PushOptionProperty.md new file mode 100644 index 00000000..07a1b3aa --- /dev/null +++ b/lending/docs/models/shared/PushOptionProperty.md @@ -0,0 +1,14 @@ +# PushOptionProperty + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `description` | *String* | :heavy_check_mark: | A description of the property. | +| `displayName` | *String* | :heavy_check_mark: | The property's display name. | +| `options` | List<[io.codat.lending.models.shared.PushOptionChoice](../../models/shared/PushOptionChoice.md)> | :heavy_minus_sign: | N/A | +| `properties` | Map | :heavy_minus_sign: | N/A | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [io.codat.lending.models.shared.PushOptionType](../../models/shared/PushOptionType.md) | :heavy_check_mark: | The option type. | +| `validation` | [Optional](../../models/shared/PushValidationInfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/PushOptionType.md b/lending/docs/models/shared/PushOptionType.md new file mode 100644 index 00000000..cf571db7 --- /dev/null +++ b/lending/docs/models/shared/PushOptionType.md @@ -0,0 +1,17 @@ +# PushOptionType + +The option type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ARRAY` | Array | +| `OBJECT` | Object | +| `STRING` | String | +| `NUMBER` | Number | +| `BOOLEAN_` | Boolean | +| `DATE_TIME` | DateTime | +| `FILE` | File | +| `MULTI_PART` | MultiPart | \ No newline at end of file diff --git a/lending/docs/models/shared/PushValidationInfo.md b/lending/docs/models/shared/PushValidationInfo.md new file mode 100644 index 00000000..1f69aaff --- /dev/null +++ b/lending/docs/models/shared/PushValidationInfo.md @@ -0,0 +1,9 @@ +# PushValidationInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `information` | List<[io.codat.lending.models.shared.PushFieldValidation](../../models/shared/PushFieldValidation.md)> | :heavy_minus_sign: | N/A | +| `warnings` | List<[io.codat.lending.models.shared.PushFieldValidation](../../models/shared/PushFieldValidation.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/RecordLineReference.md b/lending/docs/models/shared/RecordLineReference.md new file mode 100644 index 00000000..6f7f5322 --- /dev/null +++ b/lending/docs/models/shared/RecordLineReference.md @@ -0,0 +1,12 @@ +# RecordLineReference + +Reference to the purchase order line this line was generated from. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [Optional](../../models/shared/BillLineItemDataType.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record. | +| `lineNumber` | *Optional* | :heavy_minus_sign: | Line number of the underlying record. | \ No newline at end of file diff --git a/lending/docs/models/shared/RecordRef.md b/lending/docs/models/shared/RecordRef.md new file mode 100644 index 00000000..9f70e886 --- /dev/null +++ b/lending/docs/models/shared/RecordRef.md @@ -0,0 +1,13 @@ +# RecordRef + +Links the current record to the underlying record or data type that created it. + +For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `dataType` | *Optional* | :heavy_minus_sign: | Allowed name of the 'dataType'. | journalEntry | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/lending/docs/models/shared/RecordReference.md b/lending/docs/models/shared/RecordReference.md new file mode 100644 index 00000000..e3b24389 --- /dev/null +++ b/lending/docs/models/shared/RecordReference.md @@ -0,0 +1,13 @@ +# RecordReference + +Links the current record to the underlying record or data type that created it. + +For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `dataType` | *Optional* | :heavy_minus_sign: | Allowed name of the 'dataType'. | journalEntry | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportBasis.md b/lending/docs/models/shared/ReportBasis.md new file mode 100644 index 00000000..c4fedada --- /dev/null +++ b/lending/docs/models/shared/ReportBasis.md @@ -0,0 +1,12 @@ +# ReportBasis + +Accounting method used when aggregating the report data. In this case, `Cash`. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `ACCRUAL` | Accrual | +| `CASH` | Cash | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportComponentMeasure.md b/lending/docs/models/shared/ReportComponentMeasure.md new file mode 100644 index 00000000..5b433989 --- /dev/null +++ b/lending/docs/models/shared/ReportComponentMeasure.md @@ -0,0 +1,10 @@ +# ReportComponentMeasure + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `index` | *Optional* | :heavy_minus_sign: | The measure's index. | +| `measureDisplayName` | *Optional* | :heavy_minus_sign: | The measure's display name. | +| `value` | *Optional* | :heavy_minus_sign: | The measure's value. | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportInfo.md b/lending/docs/models/shared/ReportInfo.md new file mode 100644 index 00000000..f8ed545d --- /dev/null +++ b/lending/docs/models/shared/ReportInfo.md @@ -0,0 +1,15 @@ +# ReportInfo + +Report additional information, which is specific to Lending API reports. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `companyName` | *Optional* | :heavy_minus_sign: | The name of the company being queried. | +| `generatedDate` | *Optional* | :heavy_minus_sign: | Date the report was generated. | +| `pageNumber` | *Optional* | :heavy_minus_sign: | The number of the page queried. | +| `pageSize` | *Optional* | :heavy_minus_sign: | The number of transactions returned per page. | +| `reportName` | *Optional* | :heavy_minus_sign: | Name of the report. | +| `totalResults` | *Optional* | :heavy_minus_sign: | The total number of transactions available for a company for the period specified in the query string. | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportInput.md b/lending/docs/models/shared/ReportInput.md new file mode 100644 index 00000000..dc91681e --- /dev/null +++ b/lending/docs/models/shared/ReportInput.md @@ -0,0 +1,12 @@ +# ReportInput + +Accounting method used to prepare the cash flow statement. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `INDIRECT` | Indirect | +| `DIRECT` | Direct | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportItem.md b/lending/docs/models/shared/ReportItem.md new file mode 100644 index 00000000..7c3e48a1 --- /dev/null +++ b/lending/docs/models/shared/ReportItem.md @@ -0,0 +1,12 @@ +# ReportItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountCategory` | [Optional](../../models/shared/EnhancedReportAccountCategory.md) | :heavy_minus_sign: | N/A | | +| `accountId` | *Optional* | :heavy_minus_sign: | The unique account ID. | | +| `accountName` | *Optional* | :heavy_minus_sign: | Name of the account. | | +| `balance` | *Optional* | :heavy_minus_sign: | Balance of the account as reported on the profit and loss or Balance sheet. | | +| `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 | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportItems.md b/lending/docs/models/shared/ReportItems.md new file mode 100644 index 00000000..0d756e5e --- /dev/null +++ b/lending/docs/models/shared/ReportItems.md @@ -0,0 +1,13 @@ +# ReportItems + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional* | :heavy_minus_sign: | The loan transaction amount. | | +| `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 | +| `itemRef` | [Optional](../../models/shared/ItemRef.md) | :heavy_minus_sign: | N/A | | +| `lenderName` | *Optional* | :heavy_minus_sign: | The name of lender providing the loan. | | +| `loanRef` | [Optional](../../models/shared/LoanRef.md) | :heavy_minus_sign: | N/A | | +| `loanTransactionType` | [Optional](../../models/shared/LoanTransactionType.md) | :heavy_minus_sign: | The type of loan transaction. | | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportLine.md b/lending/docs/models/shared/ReportLine.md new file mode 100644 index 00000000..1fbdb403 --- /dev/null +++ b/lending/docs/models/shared/ReportLine.md @@ -0,0 +1,11 @@ +# ReportLine + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `accountId` | *JsonNullable* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | +| `items` | List<[io.codat.lending.models.shared.ReportLine](../../models/shared/ReportLine.md)> | :heavy_minus_sign: | An array of ReportLine items. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the report line item. | +| `value` | *double* | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file diff --git a/lending/docs/models/shared/ReportLineInput.md b/lending/docs/models/shared/ReportLineInput.md new file mode 100644 index 00000000..11678f1c --- /dev/null +++ b/lending/docs/models/shared/ReportLineInput.md @@ -0,0 +1,11 @@ +# ReportLineInput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `accountId` | *JsonNullable* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | +| `items` | List<[io.codat.lending.models.shared.ReportLine](../../models/shared/ReportLine.md)> | :heavy_minus_sign: | An array of ReportLine items. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of the report line item. | +| `value` | *double* | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file diff --git a/lending/docs/models/shared/SalesOrderReference.md b/lending/docs/models/shared/SalesOrderReference.md new file mode 100644 index 00000000..ac385ffd --- /dev/null +++ b/lending/docs/models/shared/SalesOrderReference.md @@ -0,0 +1,9 @@ +# SalesOrderReference + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [Optional](../../models/shared/AccountingInvoiceDataType.md) | :heavy_minus_sign: | The underlying data type associated to the reference `id`. | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier to a record in `dataType`. | \ No newline at end of file diff --git a/lending/docs/models/shared/SchemaDataType.md b/lending/docs/models/shared/SchemaDataType.md new file mode 100644 index 00000000..6f6f50a0 --- /dev/null +++ b/lending/docs/models/shared/SchemaDataType.md @@ -0,0 +1,52 @@ +# SchemaDataType + +Available Data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/lending/docs/models/shared/Security.md b/lending/docs/models/shared/Security.md new file mode 100644 index 00000000..2c63ba5d --- /dev/null +++ b/lending/docs/models/shared/Security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `authHeader` | *String* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file diff --git a/lending/docs/models/shared/ServiceCharge.md b/lending/docs/models/shared/ServiceCharge.md new file mode 100644 index 00000000..02421c02 --- /dev/null +++ b/lending/docs/models/shared/ServiceCharge.md @@ -0,0 +1,14 @@ +# ServiceCharge + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `description` | *Optional* | :heavy_minus_sign: | Service charges for this order. | A service charge | +| `quantity` | *Optional* | :heavy_minus_sign: | The number of times the charge is charged. | 1 | +| `taxAmount` | *Optional* | :heavy_minus_sign: | Amount of the service charge that is tax. | 0 | +| `taxPercentage` | *Optional* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any tax applied to the service charge. | 0 | +| `taxes` | List<[io.codat.lending.models.shared.TaxComponentAllocation](../../models/shared/TaxComponentAllocation.md)> | :heavy_minus_sign: | Taxes breakdown as applied to service charges. | | +| `totalAmount` | *Optional* | :heavy_minus_sign: | Total amount of the service charge, including tax. | 0 | +| `type` | [Optional](../../models/shared/ServiceChargeType.md) | :heavy_minus_sign: | The type of the service charge. | Overpayment | \ No newline at end of file diff --git a/lending/docs/models/shared/ServiceChargeType.md b/lending/docs/models/shared/ServiceChargeType.md new file mode 100644 index 00000000..e189429c --- /dev/null +++ b/lending/docs/models/shared/ServiceChargeType.md @@ -0,0 +1,13 @@ +# ServiceChargeType + +The type of the service charge. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `GENERIC` | Generic | +| `SHIPPING` | Shipping | +| `OVERPAYMENT` | Overpayment | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/SourceRef.md b/lending/docs/models/shared/SourceRef.md new file mode 100644 index 00000000..11e75c53 --- /dev/null +++ b/lending/docs/models/shared/SourceRef.md @@ -0,0 +1,10 @@ +# SourceRef + +A source reference containing the `sourceType` object "Banking". + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `sourceType` | *Optional* | :heavy_minus_sign: | The data source type. | \ No newline at end of file diff --git a/lending/docs/models/shared/SourceType.md b/lending/docs/models/shared/SourceType.md new file mode 100644 index 00000000..2daec8ef --- /dev/null +++ b/lending/docs/models/shared/SourceType.md @@ -0,0 +1,16 @@ +# SourceType + +The type of platform of the connection. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACCOUNTING` | Accounting | +| `BANKING` | Banking | +| `BANK_FEED` | BankFeed | +| `COMMERCE` | Commerce | +| `EXPENSE` | Expense | +| `OTHER` | Other | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/Status.md b/lending/docs/models/shared/Status.md new file mode 100644 index 00000000..ef3574c7 --- /dev/null +++ b/lending/docs/models/shared/Status.md @@ -0,0 +1,13 @@ +# Status + +The status of the account transaction. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `UNKNOWN` | Unknown | +| `UNRECONCILED` | Unreconciled | +| `RECONCILED` | Reconciled | +| `VOID_` | Void | \ No newline at end of file diff --git a/lending/docs/models/shared/SupplementalData.md b/lending/docs/models/shared/SupplementalData.md new file mode 100644 index 00000000..e7ca4b49 --- /dev/null +++ b/lending/docs/models/shared/SupplementalData.md @@ -0,0 +1,12 @@ +# SupplementalData + +Supplemental data is additional data you can include in our standard data types. + +It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `content` | Map> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/SupplierRef.md b/lending/docs/models/shared/SupplierRef.md new file mode 100644 index 00000000..1337bcb5 --- /dev/null +++ b/lending/docs/models/shared/SupplierRef.md @@ -0,0 +1,11 @@ +# SupplierRef + +Reference to the supplier the record relates to. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *String* | :heavy_check_mark: | The supplier's unique ID | +| `supplierName` | *JsonNullable* | :heavy_minus_sign: | The supplier's name | \ No newline at end of file diff --git a/lending/docs/models/shared/SupplierStatus.md b/lending/docs/models/shared/SupplierStatus.md new file mode 100644 index 00000000..0374ea9e --- /dev/null +++ b/lending/docs/models/shared/SupplierStatus.md @@ -0,0 +1,12 @@ +# SupplierStatus + +Status of the supplier. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/lending/docs/models/shared/TaxComponentAllocation.md b/lending/docs/models/shared/TaxComponentAllocation.md new file mode 100644 index 00000000..430a339c --- /dev/null +++ b/lending/docs/models/shared/TaxComponentAllocation.md @@ -0,0 +1,9 @@ +# TaxComponentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `rate` | *JsonNullable* | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | +| `taxComponentRef` | [Optional](../../models/shared/TaxComponentRef.md) | :heavy_minus_sign: | Taxes rates reference object depending on the rates being available on source commerce package. | \ No newline at end of file diff --git a/lending/docs/models/shared/TaxComponentRef.md b/lending/docs/models/shared/TaxComponentRef.md new file mode 100644 index 00000000..0f035b48 --- /dev/null +++ b/lending/docs/models/shared/TaxComponentRef.md @@ -0,0 +1,11 @@ +# TaxComponentRef + +Taxes rates reference object depending on the rates being available on source commerce package. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identitifer of the tax component being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *String* | :heavy_check_mark: | Name of the tax component being referenced. | | \ No newline at end of file diff --git a/lending/docs/models/shared/TaxRateRef.md b/lending/docs/models/shared/TaxRateRef.md new file mode 100644 index 00000000..ce85cbcc --- /dev/null +++ b/lending/docs/models/shared/TaxRateRef.md @@ -0,0 +1,21 @@ +# TaxRateRef + +Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + +Found on: + +- Bill line items +- Bill Credit Note line items +- Credit Note line items +- Direct incomes line items +- Invoice line items +- Items + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `effectiveTaxRate` | *Optional* | :heavy_minus_sign: | Applicable tax rate. | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | +| `name` | *Optional* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/TaxRateReference.md b/lending/docs/models/shared/TaxRateReference.md new file mode 100644 index 00000000..e89bcebe --- /dev/null +++ b/lending/docs/models/shared/TaxRateReference.md @@ -0,0 +1,21 @@ +# TaxRateReference + +Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + +Found on: + +- Bill line items +- Bill Credit Note line items +- Credit Note line items +- Direct incomes line items +- Invoice line items +- Items + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `effectiveTaxRate` | *Optional* | :heavy_minus_sign: | Applicable tax rate. | +| `id` | *Optional* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | +| `name` | *Optional* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file diff --git a/lending/docs/models/shared/Tracking.md b/lending/docs/models/shared/Tracking.md new file mode 100644 index 00000000..e5621719 --- /dev/null +++ b/lending/docs/models/shared/Tracking.md @@ -0,0 +1,9 @@ +# Tracking + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `invoiceTo` | [Optional](../../models/shared/RecordRef.md) | :heavy_minus_sign: | Links the current record to the underlying record or data type that created it.

For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. | +| `recordRefs` | List<[io.codat.lending.models.shared.TrackingRecordRef](../../models/shared/TrackingRecordRef.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/TrackingCategoryRef.md b/lending/docs/models/shared/TrackingCategoryRef.md new file mode 100644 index 00000000..cdb2e3b6 --- /dev/null +++ b/lending/docs/models/shared/TrackingCategoryRef.md @@ -0,0 +1,13 @@ +# ~~TrackingCategoryRef~~ + +References a category against which the item is tracked. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | Unique identifier to the tracking category. | +| `name` | *JsonNullable* | :heavy_minus_sign: | Name of tracking category. | \ No newline at end of file diff --git a/lending/docs/models/shared/TrackingRecordRef.md b/lending/docs/models/shared/TrackingRecordRef.md new file mode 100644 index 00000000..a299e022 --- /dev/null +++ b/lending/docs/models/shared/TrackingRecordRef.md @@ -0,0 +1,11 @@ +# TrackingRecordRef + +Links to the customer or tracking category. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `dataType` | [Optional](../../models/shared/TrackingRecordRefDataType.md) | :heavy_minus_sign: | Name of underlying data type. | trackingCategories | +| `id` | *Optional* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/lending/docs/models/shared/TrackingRecordRefDataType.md b/lending/docs/models/shared/TrackingRecordRefDataType.md new file mode 100644 index 00000000..0336475e --- /dev/null +++ b/lending/docs/models/shared/TrackingRecordRefDataType.md @@ -0,0 +1,12 @@ +# TrackingRecordRefDataType + +Name of underlying data type. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | +| `TRACKING_CATEGORIES` | trackingCategories | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionCategory.md b/lending/docs/models/shared/TransactionCategory.md new file mode 100644 index 00000000..229ed3b1 --- /dev/null +++ b/lending/docs/models/shared/TransactionCategory.md @@ -0,0 +1,9 @@ +# TransactionCategory + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `confidence` | *Optional* | :heavy_minus_sign: | Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. | +| `levels` | List<*String*> | :heavy_minus_sign: | The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionCategoryRef.md b/lending/docs/models/shared/TransactionCategoryRef.md new file mode 100644 index 00000000..87654514 --- /dev/null +++ b/lending/docs/models/shared/TransactionCategoryRef.md @@ -0,0 +1,11 @@ +# TransactionCategoryRef + +An object of bank transaction category reference data. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique category reference id for the bank transaction. | +| `name` | *JsonNullable* | :heavy_minus_sign: | The category name reference for the bank transaction. | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionCategoryStatus.md b/lending/docs/models/shared/TransactionCategoryStatus.md new file mode 100644 index 00000000..7b1e187e --- /dev/null +++ b/lending/docs/models/shared/TransactionCategoryStatus.md @@ -0,0 +1,12 @@ +# TransactionCategoryStatus + +The status of the transaction category. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionCode.md b/lending/docs/models/shared/TransactionCode.md new file mode 100644 index 00000000..3aeaf026 --- /dev/null +++ b/lending/docs/models/shared/TransactionCode.md @@ -0,0 +1,24 @@ +# TransactionCode + +Code to identify the underlying transaction. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `FEE` | Fee | +| `PAYMENT` | Payment | +| `CASH` | Cash | +| `TRANSFER` | Transfer | +| `INTEREST` | Interest | +| `CASHBACK` | Cashback | +| `CHEQUE` | Cheque | +| `DIRECT_DEBIT` | DirectDebit | +| `PURCHASE` | Purchase | +| `STANDING_ORDER` | StandingOrder | +| `ADJUSTMENT` | Adjustment | +| `CREDIT` | Credit | +| `OTHER` | Other | +| `NOT_SUPPORTED` | NotSupported | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionSourceRef.md b/lending/docs/models/shared/TransactionSourceRef.md new file mode 100644 index 00000000..921d74e1 --- /dev/null +++ b/lending/docs/models/shared/TransactionSourceRef.md @@ -0,0 +1,9 @@ +# TransactionSourceRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | The unique identitifer of the record being referenced | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `type` | [io.codat.lending.models.shared.TransactionSourceType](../../models/shared/TransactionSourceType.md) | :heavy_check_mark: | The type of source the transaction arose. | | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionSourceType.md b/lending/docs/models/shared/TransactionSourceType.md new file mode 100644 index 00000000..1c0f0983 --- /dev/null +++ b/lending/docs/models/shared/TransactionSourceType.md @@ -0,0 +1,14 @@ +# TransactionSourceType + +The type of source the transaction arose. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `FEE` | Fee | +| `ORDER` | Order | +| `PAYMENT` | Payment | +| `SERVICE_CHARGE` | ServiceCharge | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/TransactionType.md b/lending/docs/models/shared/TransactionType.md new file mode 100644 index 00000000..198a80be --- /dev/null +++ b/lending/docs/models/shared/TransactionType.md @@ -0,0 +1,25 @@ +# TransactionType + +The type of the platform transaction: +- `Unknown` +- `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. +- `Payment` — Credit and debit card payments. +- `PaymentFee` — Payment provider's fee on each card payment. +- `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. +- `Payout` — Transfer of funds from the seller's merchant account to their bank account. +- `Refund` — Refunds to a customer's credit or debit card. +- `Transfer` — Secure transfer of funds to the seller's bank account. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `PAYMENT` | Payment | +| `REFUND` | Refund | +| `PAYOUT` | Payout | +| `FAILED_PAYOUT` | FailedPayout | +| `TRANSFER` | Transfer | +| `PAYMENT_FEE` | PaymentFee | +| `PAYMENT_FEE_REFUND` | PaymentFeeRefund | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/TransferAccount.md b/lending/docs/models/shared/TransferAccount.md new file mode 100644 index 00000000..95f6b28e --- /dev/null +++ b/lending/docs/models/shared/TransferAccount.md @@ -0,0 +1,12 @@ +# TransferAccount + +Account details of the account sending or receiving the transfer. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountRef` | [Optional](../../models/shared/AccountRef.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `amount` | *Optional* | :heavy_minus_sign: | The amount transferred between accounts. | | +| `currency` | *Optional* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | \ No newline at end of file diff --git a/lending/docs/models/shared/Type.md b/lending/docs/models/shared/Type.md new file mode 100644 index 00000000..595fc09c --- /dev/null +++ b/lending/docs/models/shared/Type.md @@ -0,0 +1,12 @@ +# Type + +The type of the weblink. + + +## Values + +| Name | Value | +| --------- | --------- | +| `WEBSITE` | Website | +| `SOCIAL` | Social | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/lending/docs/models/shared/ValidDataTypeLinks.md b/lending/docs/models/shared/ValidDataTypeLinks.md new file mode 100644 index 00000000..e845b93e --- /dev/null +++ b/lending/docs/models/shared/ValidDataTypeLinks.md @@ -0,0 +1,50 @@ +# ValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List<*String*> | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *JsonNullable* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/lending/docs/models/shared/Validation.md b/lending/docs/models/shared/Validation.md new file mode 100644 index 00000000..72a030fb --- /dev/null +++ b/lending/docs/models/shared/Validation.md @@ -0,0 +1,11 @@ +# Validation + +A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `errors` | List<[io.codat.lending.models.shared.ValidationItem](../../models/shared/ValidationItem.md)> | :heavy_minus_sign: | N/A | +| `warnings` | List<[io.codat.lending.models.shared.ValidationItem](../../models/shared/ValidationItem.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/ValidationItem.md b/lending/docs/models/shared/ValidationItem.md new file mode 100644 index 00000000..2f357dee --- /dev/null +++ b/lending/docs/models/shared/ValidationItem.md @@ -0,0 +1,10 @@ +# ValidationItem + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *JsonNullable* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *JsonNullable* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validatorName` | *JsonNullable* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/lending/docs/models/shared/WebLink.md b/lending/docs/models/shared/WebLink.md new file mode 100644 index 00000000..83486b9b --- /dev/null +++ b/lending/docs/models/shared/WebLink.md @@ -0,0 +1,11 @@ +# WebLink + +Weblink associated with the company. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `type` | [Optional](../../models/shared/Type.md) | :heavy_minus_sign: | The type of the weblink. | +| `url` | *Optional* | :heavy_minus_sign: | The full URL for the weblink. | \ No newline at end of file diff --git a/lending/docs/models/shared/WithholdingTax.md b/lending/docs/models/shared/WithholdingTax.md new file mode 100644 index 00000000..e8baa37c --- /dev/null +++ b/lending/docs/models/shared/WithholdingTax.md @@ -0,0 +1,9 @@ +# WithholdingTax + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *double* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *String* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/lending/docs/models/shared/WithholdingTaxItems.md b/lending/docs/models/shared/WithholdingTaxItems.md new file mode 100644 index 00000000..628baaf9 --- /dev/null +++ b/lending/docs/models/shared/WithholdingTaxItems.md @@ -0,0 +1,9 @@ +# WithholdingTaxItems + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *double* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *String* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/lending/docs/models/webhooks/AccountCategoriesUpdatedResponse.md b/lending/docs/models/webhooks/AccountCategoriesUpdatedResponse.md new file mode 100644 index 00000000..9899e353 --- /dev/null +++ b/lending/docs/models/webhooks/AccountCategoriesUpdatedResponse.md @@ -0,0 +1,10 @@ +# AccountCategoriesUpdatedResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [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/lending/docs/models/webhooks/ClientRateLimitReachedResponse.md b/lending/docs/models/webhooks/ClientRateLimitReachedResponse.md new file mode 100644 index 00000000..8d81865c --- /dev/null +++ b/lending/docs/models/webhooks/ClientRateLimitReachedResponse.md @@ -0,0 +1,10 @@ +# ClientRateLimitReachedResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [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/lending/docs/models/webhooks/ClientRateLimitResetResponse.md b/lending/docs/models/webhooks/ClientRateLimitResetResponse.md new file mode 100644 index 00000000..ae5b2046 --- /dev/null +++ b/lending/docs/models/webhooks/ClientRateLimitResetResponse.md @@ -0,0 +1,10 @@ +# ClientRateLimitResetResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [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/lending/docs/sdks/accountbalances/README.md b/lending/docs/sdks/accountbalances/README.md new file mode 100644 index 00000000..0579f0d5 --- /dev/null +++ b/lending/docs/sdks/accountbalances/README.md @@ -0,0 +1,82 @@ +# AccountBalances +(*banking().accountBalances()*) + +### Available Operations + +* [list](#list) - List account balances + +## list + +The *List account balances* endpoint returns a list of [account balances](https://docs.codat.io/lending-api#/schemas/AccountBalance) for a given company's connection. + +[Account balances](https://docs.codat.io/lending-api#/schemas/AccountBalance) are balances for a bank account, including end-of-day batch balance or running balances per transaction. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListBankingAccountBalancesRequest; +import io.codat.lending.models.operations.ListBankingAccountBalancesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListBankingAccountBalancesRequest req = ListBankingAccountBalancesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListBankingAccountBalancesResponse res = sdk.banking().accountBalances().list() + .request(req) + .call(); + + if (res.bankingAccountBalances().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListBankingAccountBalancesRequest](../../models/operations/ListBankingAccountBalancesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListBankingAccountBalancesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/accounts/README.md b/lending/docs/sdks/accounts/README.md new file mode 100644 index 00000000..25254888 --- /dev/null +++ b/lending/docs/sdks/accounts/README.md @@ -0,0 +1,158 @@ +# Accounts +(*accountingBankData().accounts()*) + +### Available Operations + +* [get](#get) - Get bank account +* [list](#list) - List bank accounts + +## get + +The *Get bank account* endpoint returns a single account for a given accountId. + +[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support getting a specific bank account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBankAccountRequest; +import io.codat.lending.models.operations.GetAccountingBankAccountResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBankAccountRequest req = GetAccountingBankAccountRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetAccountingBankAccountResponse res = sdk.accountingBankData().accounts().get() + .request(req) + .call(); + + if (res.accountingBankAccount().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingBankAccountRequest](../../models/operations/GetAccountingBankAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBankAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBankAccountsRequest; +import io.codat.lending.models.operations.ListAccountingBankAccountsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBankAccountsRequest req = ListAccountingBankAccountsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingBankAccountsResponse res = sdk.accountingBankData().accounts().list() + .request(req) + .call(); + + if (res.accountingBankAccounts().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingBankAccountsRequest](../../models/operations/ListAccountingBankAccountsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBankAccountsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/accountspayable/README.md b/lending/docs/sdks/accountspayable/README.md new file mode 100644 index 00000000..19f59aa3 --- /dev/null +++ b/lending/docs/sdks/accountspayable/README.md @@ -0,0 +1,5 @@ +# AccountsPayable +(*accountsPayable()*) + +### Available Operations + diff --git a/lending/docs/sdks/accountsreceivable/README.md b/lending/docs/sdks/accountsreceivable/README.md new file mode 100644 index 00000000..1a720447 --- /dev/null +++ b/lending/docs/sdks/accountsreceivable/README.md @@ -0,0 +1,5 @@ +# AccountsReceivable +(*accountsReceivable()*) + +### Available Operations + diff --git a/lending/docs/sdks/accounttransactions/README.md b/lending/docs/sdks/accounttransactions/README.md new file mode 100644 index 00000000..8eafce19 --- /dev/null +++ b/lending/docs/sdks/accounttransactions/README.md @@ -0,0 +1,158 @@ +# AccountTransactions +(*transactions().accountTransactions()*) + +### Available Operations + +* [get](#get) - Get account transaction +* [list](#list) - List account transactions + +## get + +The *Get account transaction* endpoint returns a single account transaction for a given accountTransactionId. + +[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions) for integrations that support getting a specific account transaction. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingAccountTransactionRequest; +import io.codat.lending.models.operations.GetAccountingAccountTransactionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingAccountTransactionRequest req = GetAccountingAccountTransactionRequest.builder() + .accountTransactionId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetAccountingAccountTransactionResponse res = sdk.transactions().accountTransactions().get() + .request(req) + .call(); + + if (res.accountingAccountTransaction().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingAccountTransactionRequest](../../models/operations/GetAccountingAccountTransactionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingAccountTransactionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List account transactions* endpoint returns a list of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) for a given company's connection. + +[Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest; +import io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingAccountTransactionsRequest req = ListAccountingAccountTransactionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingAccountTransactionsResponse res = sdk.transactions().accountTransactions().list() + .request(req) + .call(); + + if (res.accountingAccountTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest](../../models/operations/ListAccountingAccountTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingAccountTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/balancesheet/README.md b/lending/docs/sdks/balancesheet/README.md new file mode 100644 index 00000000..ecbc1069 --- /dev/null +++ b/lending/docs/sdks/balancesheet/README.md @@ -0,0 +1,146 @@ +# BalanceSheet +(*financialStatements().balanceSheet()*) + +### Available Operations + +* [get](#get) - Get balance sheet +* [getCategorizedAccounts](#getcategorizedaccounts) - Get categorized balance sheet statement + +## get + +Gets the latest balance sheet for a company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBalanceSheetRequest; +import io.codat.lending.models.operations.GetAccountingBalanceSheetResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBalanceSheetRequest req = GetAccountingBalanceSheetRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .periodLength(4) + .periodsToCompare(20) + .startMonth("2022-10-23T00:00:00Z") + .build(); + + GetAccountingBalanceSheetResponse res = sdk.financialStatements().balanceSheet().get() + .request(req) + .call(); + + if (res.accountingBalanceSheet().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingBalanceSheetRequest](../../models/operations/GetAccountingBalanceSheetRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBalanceSheetResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCategorizedAccounts + +The *Get categorized balance sheet statement* endpoint returns a list of categorized accounts that appear on a company’s Balance Sheet along with a balance per financial statement date. + +Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest; +import io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCategorizedBalanceSheetStatementRequest req = GetCategorizedBalanceSheetStatementRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .reportDate("29-09-2020") + .numberOfPeriods(258121L) + .build(); + + GetCategorizedBalanceSheetStatementResponse res = sdk.financialStatements().balanceSheet().getCategorizedAccounts() + .request(req) + .call(); + + if (res.enhancedFinancialReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest](../../models/operations/GetCategorizedBalanceSheetStatementRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCategorizedBalanceSheetStatementResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/bankaccounts/README.md b/lending/docs/sdks/bankaccounts/README.md new file mode 100644 index 00000000..335992fc --- /dev/null +++ b/lending/docs/sdks/bankaccounts/README.md @@ -0,0 +1,188 @@ +# BankAccounts +(*loanWriteback().bankAccounts()*) + +### Available Operations + +* [create](#create) - Create bank account +* [getCreateUpdateModel](#getcreateupdatemodel) - Get create/update bank account model + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/lending-api#/operations/get-create-update-bankAccounts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateBankAccountRequest; +import io.codat.lending.models.operations.CreateBankAccountResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountingBankAccount; +import io.codat.lending.models.shared.AccountingBankAccountType; +import io.codat.lending.models.shared.Metadata; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateBankAccountRequest req = CreateBankAccountRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountingBankAccount(AccountingBankAccount.builder() + .accountName("string") + .accountNumber("string") + .accountType(AccountingBankAccountType.CREDIT) + .availableBalance(4893.82d) + .balance(6384.24d) + .currency("EUR") + .iBan("IE8210U901078857930905") + .id("") + .institution("string") + .metadata(Metadata.builder() + .isDeleted(false) + .build()) + .modifiedDate("2022-10-23T00:00:00Z") + .nominalCode("string") + .overdraftLimit(2075.65d) + .sortCode("string") + .sourceModifiedDate("2022-10-23T00:00:00Z") + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(714115) + .build(); + + CreateBankAccountResponse res = sdk.loanWriteback().bankAccounts().create() + .request(req) + .call(); + + if (res.accountingCreateBankAccountResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.CreateBankAccountRequest](../../models/operations/CreateBankAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateBankAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateUpdateModel + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequest; +import io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateUpdateBankAccountsModelRequest req = GetCreateUpdateBankAccountsModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateUpdateBankAccountsModelResponse res = sdk.loanWriteback().bankAccounts().getCreateUpdateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequest](../../models/operations/GetCreateUpdateBankAccountsModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateUpdateBankAccountsModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/banking/README.md b/lending/docs/sdks/banking/README.md new file mode 100644 index 00000000..4ffbb628 --- /dev/null +++ b/lending/docs/sdks/banking/README.md @@ -0,0 +1,5 @@ +# Banking +(*banking()*) + +### Available Operations + diff --git a/lending/docs/sdks/banktransactions/README.md b/lending/docs/sdks/banktransactions/README.md new file mode 100644 index 00000000..2fed0007 --- /dev/null +++ b/lending/docs/sdks/banktransactions/README.md @@ -0,0 +1,172 @@ +# BankTransactions +(*loanWriteback().bankTransactions()*) + +### Available Operations + +* [create](#create) - Create bank account transactions +* [getCreateModel](#getcreatemodel) - Get create bank account transactions model + +## create + +The *Create bank account transactions* endpoint creates new [bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) for a given company's connection. + +[Bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + +**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/lending-api#/operations/get-create-bankTransactions-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating a bank account transactions. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateBankTransactionsRequest; +import io.codat.lending.models.operations.CreateBankTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountingCreateBankTransactions; +import io.codat.lending.models.shared.CreateBankAccountTransaction; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateBankTransactionsRequest req = CreateBankTransactionsRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountingCreateBankTransactions(AccountingCreateBankTransactions.builder() + .accountId("7110701885") + .transactions(java.util.List.of( + CreateBankAccountTransaction.builder() + .date("2022-10-23T00:00:00Z") + .build())) + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(638424) + .build(); + + CreateBankTransactionsResponse res = sdk.loanWriteback().bankTransactions().create() + .request(req) + .call(); + + if (res.accountingCreateBankTransactionsResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.CreateBankTransactionsRequest](../../models/operations/CreateBankTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateBankTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 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/lending-api#/schemas/BankTransactions) for a given company and integration. + +[Bank account transactions](https://docs.codat.io/lending-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. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating an bank transaction. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateBankTransactionsModelRequest; +import io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateBankTransactionsModelRequest req = GetCreateBankTransactionsModelRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateBankTransactionsModelResponse res = sdk.loanWriteback().bankTransactions().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCreateBankTransactionsModelRequest](../../models/operations/GetCreateBankTransactionsModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateBankTransactionsModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/billcreditnotes/README.md b/lending/docs/sdks/billcreditnotes/README.md new file mode 100644 index 00000000..871cc9c1 --- /dev/null +++ b/lending/docs/sdks/billcreditnotes/README.md @@ -0,0 +1,156 @@ +# BillCreditNotes +(*accountsPayable().billCreditNotes()*) + +### Available Operations + +* [get](#get) - Get bill credit note +* [list](#list) - List bill credit notes + +## get + +The *Get bill credit note* endpoint returns a single bill credit note for a given billCreditNoteId. + +[Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support getting a specific bill credit note. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBillCreditNoteRequest; +import io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBillCreditNoteRequest req = GetAccountingBillCreditNoteRequest.builder() + .billCreditNoteId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetAccountingBillCreditNoteResponse res = sdk.accountsPayable().billCreditNotes().get() + .request(req) + .call(); + + if (res.accountingBillCreditNote().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingBillCreditNoteRequest](../../models/operations/GetAccountingBillCreditNoteRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBillCreditNoteResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) for a given company's connection. + +[Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest; +import io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBillCreditNotesRequest req = ListAccountingBillCreditNotesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingBillCreditNotesResponse res = sdk.accountsPayable().billCreditNotes().list() + .request(req) + .call(); + + if (res.accountingBillCreditNotes().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest](../../models/operations/ListAccountingBillCreditNotesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBillCreditNotesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/billpayments/README.md b/lending/docs/sdks/billpayments/README.md new file mode 100644 index 00000000..8186e433 --- /dev/null +++ b/lending/docs/sdks/billpayments/README.md @@ -0,0 +1,156 @@ +# BillPayments +(*accountsPayable().billPayments()*) + +### Available Operations + +* [get](#get) - Get bill payment +* [list](#list) - List bill payments + +## get + +The *Get bill payment* endpoint returns a single bill payment for a given billPaymentId. + +[Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support getting a specific bill payment. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBillPaymentRequest; +import io.codat.lending.models.operations.GetAccountingBillPaymentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBillPaymentRequest req = GetAccountingBillPaymentRequest.builder() + .billPaymentId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetAccountingBillPaymentResponse res = sdk.accountsPayable().billPayments().get() + .request(req) + .call(); + + if (res.accountingBillPayment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingBillPaymentRequest](../../models/operations/GetAccountingBillPaymentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBillPaymentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) for a given company's connection. + +[Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBillPaymentsRequest; +import io.codat.lending.models.operations.ListAccountingBillPaymentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBillPaymentsRequest req = ListAccountingBillPaymentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingBillPaymentsResponse res = sdk.accountsPayable().billPayments().list() + .request(req) + .call(); + + if (res.accountingBillPayments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingBillPaymentsRequest](../../models/operations/ListAccountingBillPaymentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBillPaymentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/bills/README.md b/lending/docs/sdks/bills/README.md new file mode 100644 index 00000000..cde2dbd5 --- /dev/null +++ b/lending/docs/sdks/bills/README.md @@ -0,0 +1,380 @@ +# Bills +(*accountsPayable().bills()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download bill attachment +* [get](#get) - Get bill +* [getAttachment](#getattachment) - Get bill attachment +* [list](#list) - List bills +* [listAttachments](#listattachments) - List bill attachments + +## downloadAttachment + +The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + +[Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingBillAttachmentRequest req = DownloadAccountingBillAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .billId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + DownloadAccountingBillAttachmentResponse res = sdk.accountsPayable().bills().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequest](../../models/operations/DownloadAccountingBillAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingBillAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get bill* endpoint returns a single bill for a given billId. + +[Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBillRequest; +import io.codat.lending.models.operations.GetAccountingBillResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBillRequest req = GetAccountingBillRequest.builder() + .billId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetAccountingBillResponse res = sdk.accountsPayable().bills().get() + .request(req) + .call(); + + if (res.accountingBill().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingBillRequest](../../models/operations/GetAccountingBillRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBillResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. + +[Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingBillAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingBillAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingBillAttachmentRequest req = GetAccountingBillAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .billId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetAccountingBillAttachmentResponse res = sdk.accountsPayable().bills().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingBillAttachmentRequest](../../models/operations/GetAccountingBillAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingBillAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List bills* endpoint returns a list of [bills](https://docs.codat.io/lending-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBillsRequest; +import io.codat.lending.models.operations.ListAccountingBillsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBillsRequest req = ListAccountingBillsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingBillsResponse res = sdk.accountsPayable().bills().list() + .request(req) + .call(); + + if (res.accountingBills().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingBillsRequest](../../models/operations/ListAccountingBillsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBillsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + +[Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support listing bill attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBillAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBillAttachmentsRequest req = ListAccountingBillAttachmentsRequest.builder() + .billId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + ListAccountingBillAttachmentsResponse res = sdk.accountsPayable().bills().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingBillAttachmentsRequest](../../models/operations/ListAccountingBillAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBillAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/cashflow/README.md b/lending/docs/sdks/cashflow/README.md new file mode 100644 index 00000000..6ac1e0db --- /dev/null +++ b/lending/docs/sdks/cashflow/README.md @@ -0,0 +1,75 @@ +# CashFlow +(*financialStatements().cashFlow()*) + +### Available Operations + +* [get](#get) - Get cash flow statement + +## get + +Gets the latest cash flow statement for a company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest; +import io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingCashFlowStatementRequest req = GetAccountingCashFlowStatementRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .periodLength(4) + .periodsToCompare(20) + .startMonth("2022-10-23T00:00:00Z") + .build(); + + GetAccountingCashFlowStatementResponse res = sdk.financialStatements().cashFlow().get() + .request(req) + .call(); + + if (res.accountingCashFlowStatement().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest](../../models/operations/GetAccountingCashFlowStatementRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingCashFlowStatementResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/categorizedstatement/README.md b/lending/docs/sdks/categorizedstatement/README.md new file mode 100644 index 00000000..4fe07881 --- /dev/null +++ b/lending/docs/sdks/categorizedstatement/README.md @@ -0,0 +1,79 @@ +# CategorizedStatement +(*banking().categorizedStatement()*) + +### Available Operations + +* [get](#get) - Get categorized bank statement + +## get + +> **Categorization engine** +> +> The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source. + +The _Get categorized bank statement_ endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCategorizedBankStatementRequest; +import io.codat.lending.models.operations.GetCategorizedBankStatementResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCategorizedBankStatementRequest req = GetCategorizedBankStatementRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .page(1) + .pageSize(100) + .query("string") + .build(); + + GetCategorizedBankStatementResponse res = sdk.banking().categorizedStatement().get() + .request(req) + .call(); + + if (res.enhancedCashFlowTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCategorizedBankStatementRequest](../../models/operations/GetCategorizedBankStatementRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCategorizedBankStatementResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlending/README.md b/lending/docs/sdks/codatlending/README.md new file mode 100644 index 00000000..e3012d97 --- /dev/null +++ b/lending/docs/sdks/codatlending/README.md @@ -0,0 +1,35 @@ +# CodatLending SDK + + +## Overview + +Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce platforms they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. + +The Lending API is built on top of the latest accounting, commerce, and banking data, providing you with the most important data points you need to get a full picture of SMB creditworthiness and make a comprehensive assessment of your customers. + +[Explore product](https://docs.codat.io/lending/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + +--- + +## Endpoints + +| Endpoints | Description | +|:---------------------|:-----------------------------------------------------------------------------------------------------------| +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Bank statements | Retrieve banking data from linked bank accounts. | +| Sales | Retrieve standardized sales data from a linked commerce platform. | +| Financial statements | Financial data and reports from a linked accounting platform. | +| Liabilities | Debt and other liabilities. | +| Accounts payable | Data from a linked accounting platform representing money the business owes money to its suppliers. | +| Accounts receivable | Data from a linked accounting platform representing money owed to the business for sold goods or services. | +| Transactions | Data from a linked accounting platform representing transactions. | +| Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | +| Company info | View company profile from the source platform. | +| Excel reports | Download reports in Excel format. | +| Categories | Manage Codat's automatic account categorization functionality. | +| Manage data | Control how data is retrieved from an integration. | +| File upload | Endpoints to manage uploaded files. | + +### Available Operations + diff --git a/lending/docs/sdks/codatlendingaccountingbankdata/README.md b/lending/docs/sdks/codatlendingaccountingbankdata/README.md new file mode 100644 index 00000000..30d54b73 --- /dev/null +++ b/lending/docs/sdks/codatlendingaccountingbankdata/README.md @@ -0,0 +1,89 @@ +# CodatLendingAccountingBankData +(*accountingBankData()*) + +## Overview + +Access bank transactions from an accounting platform. + +### Available Operations + +* [listTransactions](#listtransactions) - List bank account transactions + +## listTransactions + +The *List account bank transactions* endpoint returns a list of [bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) for a given company's connection. + +[Bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support listing bank transactions. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest; +import io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingBankAccountTransactionsRequest req = ListAccountingBankAccountTransactionsRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingBankAccountTransactionsResponse res = sdk.accountingBankData().listTransactions() + .request(req) + .call(); + + if (res.accountingBankTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest](../../models/operations/ListAccountingBankAccountTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingBankAccountTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingaccounts/README.md b/lending/docs/sdks/codatlendingaccounts/README.md new file mode 100644 index 00000000..486e4685 --- /dev/null +++ b/lending/docs/sdks/codatlendingaccounts/README.md @@ -0,0 +1,158 @@ +# CodatLendingAccounts +(*banking().accounts()*) + +### Available Operations + +* [get](#get) - Get account +* [list](#list) - List accounts + +## get + +The *Get account* endpoint returns a single account for a given accountId. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are financial accounts maintained by a bank or other financial institution. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-accounts) for integrations that support getting a specific account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetBankingAccountRequest; +import io.codat.lending.models.operations.GetBankingAccountResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetBankingAccountRequest req = GetBankingAccountRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetBankingAccountResponse res = sdk.banking().accounts().get() + .request(req) + .call(); + + if (res.bankingAccount().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetBankingAccountRequest](../../models/operations/GetBankingAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetBankingAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are financial accounts maintained by a bank or other financial institution. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListBankingAccountsRequest; +import io.codat.lending.models.operations.ListBankingAccountsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListBankingAccountsRequest req = ListBankingAccountsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListBankingAccountsResponse res = sdk.banking().accounts().list() + .request(req) + .call(); + + if (res.bankingAccounts().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListBankingAccountsRequest](../../models/operations/ListBankingAccountsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListBankingAccountsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingbankingtransactions/README.md b/lending/docs/sdks/codatlendingbankingtransactions/README.md new file mode 100644 index 00000000..fdc48fe9 --- /dev/null +++ b/lending/docs/sdks/codatlendingbankingtransactions/README.md @@ -0,0 +1,158 @@ +# CodatLendingBankingTransactions +(*banking().transactions()*) + +### Available Operations + +* [get](#get) - Get bank transaction +* [list](#list) - List transactions + +## get + +The *Get transaction* endpoint returns a single transaction for a given transactionId. + +[Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactions) for integrations that support getting a specific transaction. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetBankingTransactionRequest; +import io.codat.lending.models.operations.GetBankingTransactionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetBankingTransactionRequest req = GetBankingTransactionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .transactionId("string") + .build(); + + GetBankingTransactionResponse res = sdk.banking().transactions().get() + .request(req) + .call(); + + if (res.bankingTransaction().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetBankingTransactionRequest](../../models/operations/GetBankingTransactionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetBankingTransactionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. + +[Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListBankingTransactionsRequest; +import io.codat.lending.models.operations.ListBankingTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListBankingTransactionsRequest req = ListBankingTransactionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListBankingTransactionsResponse res = sdk.banking().transactions().list() + .request(req) + .call(); + + if (res.bankingTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListBankingTransactionsRequest](../../models/operations/ListBankingTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListBankingTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingcustomers/README.md b/lending/docs/sdks/codatlendingcustomers/README.md new file mode 100644 index 00000000..7a3b45f5 --- /dev/null +++ b/lending/docs/sdks/codatlendingcustomers/README.md @@ -0,0 +1,158 @@ +# CodatLendingCustomers +(*sales().customers()*) + +### Available Operations + +* [get](#get) - Get customer +* [list](#list) - List customers + +## get + +The *Get customer* endpoint returns a single customer for a given customerId. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that place orders, make payments and receive goods and/or services from the SMB. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-customers) for integrations that support getting a specific customer. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceCustomerRequest; +import io.codat.lending.models.operations.GetCommerceCustomerResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceCustomerRequest req = GetCommerceCustomerRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .customerId("string") + .build(); + + GetCommerceCustomerResponse res = sdk.sales().customers().get() + .request(req) + .call(); + + if (res.commerceCustomer().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceCustomerRequest](../../models/operations/GetCommerceCustomerRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceCustomerResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that place orders, make payments and recieve goods and/or services from the SMB. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceCustomersRequest; +import io.codat.lending.models.operations.ListCommerceCustomersResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceCustomersRequest req = ListCommerceCustomersRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceCustomersResponse res = sdk.sales().customers().list() + .request(req) + .call(); + + if (res.commerceCustomers().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListCommerceCustomersRequest](../../models/operations/ListCommerceCustomersRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceCustomersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingdirectcosts/README.md b/lending/docs/sdks/codatlendingdirectcosts/README.md new file mode 100644 index 00000000..ab89ec57 --- /dev/null +++ b/lending/docs/sdks/codatlendingdirectcosts/README.md @@ -0,0 +1,382 @@ +# CodatLendingDirectCosts +(*transactions().directCosts()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download direct cost attachment +* [get](#get) - Get direct cost +* [getAttachment](#getattachment) - Get direct cost attachment +* [list](#list) - List direct costs +* [listAttachments](#listattachments) - List direct cost attachments + +## downloadAttachment + +The *Download direct cost attachment* endpoint downloads a specific attachment for a given `directCostId` and `attachmentId`. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support downloading a direct cost attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingDirectCostAttachmentRequest req = DownloadAccountingDirectCostAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directCostId("string") + .build(); + + DownloadAccountingDirectCostAttachmentResponse res = sdk.transactions().directCosts().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequest](../../models/operations/DownloadAccountingDirectCostAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingDirectCostAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get direct cost* endpoint returns a single direct cost for a given directCostId. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a specific direct cost. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingDirectCostRequest; +import io.codat.lending.models.operations.GetAccountingDirectCostResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingDirectCostRequest req = GetAccountingDirectCostRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directCostId("string") + .build(); + + GetAccountingDirectCostResponse res = sdk.transactions().directCosts().get() + .request(req) + .call(); + + if (res.accountingDirectCost().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingDirectCostRequest](../../models/operations/GetAccountingDirectCostRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingDirectCostResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get direct cost attachment* endpoint returns a specific attachment for a given `directCostId` and `attachmentId`. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a direct cost attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingDirectCostAttachmentRequest req = GetAccountingDirectCostAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directCostId("string") + .build(); + + GetAccountingDirectCostAttachmentResponse res = sdk.transactions().directCosts().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequest](../../models/operations/GetAccountingDirectCostAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingDirectCostAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List direct costs* endpoint returns a list of [direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company's connection. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingDirectCostsRequest; +import io.codat.lending.models.operations.ListAccountingDirectCostsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingDirectCostsRequest req = ListAccountingDirectCostsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingDirectCostsResponse res = sdk.transactions().directCosts().list() + .request(req) + .call(); + + if (res.accountingDirectCosts().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingDirectCostsRequest](../../models/operations/ListAccountingDirectCostsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingDirectCostsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List direct cost attachments* endpoint returns a list of attachments available to download for given `directCostId`. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support listing direct cost attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingDirectCostAttachmentsRequest req = ListAccountingDirectCostAttachmentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directCostId("string") + .build(); + + ListAccountingDirectCostAttachmentsResponse res = sdk.transactions().directCosts().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequest](../../models/operations/ListAccountingDirectCostAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingDirectCostAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md b/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md new file mode 100644 index 00000000..78058398 --- /dev/null +++ b/lending/docs/sdks/codatlendingfinancialstatementsaccounts/README.md @@ -0,0 +1,155 @@ +# CodatLendingFinancialStatementsAccounts +(*financialStatements().accounts()*) + +### Available Operations + +* [get](#get) - Get account +* [list](#list) - List accounts + +## get + +The *Get account* endpoint returns a single account for a given accountId. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support getting a specific account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingAccountRequest; +import io.codat.lending.models.operations.GetAccountingAccountResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingAccountRequest req = GetAccountingAccountRequest.builder() + .accountId("string") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetAccountingAccountResponse res = sdk.financialStatements().accounts().get() + .request(req) + .call(); + + if (res.accountingAccount().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingAccountRequest](../../models/operations/GetAccountingAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingAccountsRequest; +import io.codat.lending.models.operations.ListAccountingAccountsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingAccountsRequest req = ListAccountingAccountsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingAccountsResponse res = sdk.financialStatements().accounts().list() + .request(req) + .call(); + + if (res.accountingAccounts().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingAccountsRequest](../../models/operations/ListAccountingAccountsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingAccountsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md b/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md new file mode 100644 index 00000000..45755e2a --- /dev/null +++ b/lending/docs/sdks/codatlendingloanwritebackaccounts/README.md @@ -0,0 +1,188 @@ +# CodatLendingLoanWritebackAccounts +(*loanWriteback().accounts()*) + +### Available Operations + +* [create](#create) - Create account +* [getCreateModel](#getcreatemodel) - Get create account model + +## create + +The *Create account* endpoint creates a new [account](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateAccountRequest; +import io.codat.lending.models.operations.CreateAccountResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountPrototype; +import io.codat.lending.models.shared.AccountStatus; +import io.codat.lending.models.shared.AccountType; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import io.codat.lending.models.shared.ValidDataTypeLinks; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateAccountRequest req = CreateAccountRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountPrototype(AccountPrototype.builder() + .currency("USD") + .currentBalance(0d) + .description("Invoices the business has issued but has not yet collected payment on.") + .fullyQualifiedCategory("Asset.Current") + .fullyQualifiedName("Cash On Hand") + .isBankAccount(false) + .name("Accounts Receivable") + .nominalCode("610") + .status(AccountStatus.ACTIVE) + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .type(AccountType.ASSET) + .validDatatypeLinks(java.util.List.of( + ValidDataTypeLinks.builder() + .links(java.util.List.of( + "string")) + .build())) + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(638424) + .build(); + + CreateAccountResponse res = sdk.loanWriteback().accounts().create() + .request(req) + .call(); + + if (res.accountingCreateAccountResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.CreateAccountRequest](../../models/operations/CreateAccountRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateAccountResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateModel + +The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/lending-api#/schemas/Account) for a given company and integration. + +[Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequest; +import io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateChartOfAccountsModelRequest req = GetCreateChartOfAccountsModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateChartOfAccountsModelResponse res = sdk.loanWriteback().accounts().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequest](../../models/operations/GetCreateChartOfAccountsModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateChartOfAccountsModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingpayments/README.md b/lending/docs/sdks/codatlendingpayments/README.md new file mode 100644 index 00000000..79b87e14 --- /dev/null +++ b/lending/docs/sdks/codatlendingpayments/README.md @@ -0,0 +1,210 @@ +# CodatLendingPayments +(*loanWriteback().payments()*) + +### Available Operations + +* [create](#create) - Create payment +* [getCreateModel](#getcreatemodel) - Get create payment model + +## create + +The *Create payment* endpoint creates a new [payment](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create payment model](https://docs.codat.io/lending-api#/operations/get-create-payments-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreatePaymentRequest; +import io.codat.lending.models.operations.CreatePaymentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountRef; +import io.codat.lending.models.shared.AccountingCustomerRef; +import io.codat.lending.models.shared.AccountingPayment; +import io.codat.lending.models.shared.Metadata; +import io.codat.lending.models.shared.PaymentLine; +import io.codat.lending.models.shared.PaymentLineLink; +import io.codat.lending.models.shared.PaymentLinkType; +import io.codat.lending.models.shared.PaymentMethodRef; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreatePaymentRequest req = CreatePaymentRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountingPayment(AccountingPayment.builder() + .date("2022-10-23T00:00:00Z") + .accountRef(AccountRef.builder() + .id("") + .name("string") + .build()) + .currency("USD") + .currencyRate(6384.24d) + .customerRef(AccountingCustomerRef.builder() + .id("string") + .companyName("Johnson, Green and Collier") + .build()) + .id("") + .lines(java.util.List.of( + PaymentLine.builder() + .amount(3768.44d) + .allocatedOnDate("2022-10-23T00:00:00Z") + .links(java.util.List.of( + PaymentLineLink.builder() + .type(PaymentLinkType.PAYMENT_ON_ACCOUNT) + .build())) + .build())) + .metadata(Metadata.builder() + .isDeleted(false) + .build()) + .modifiedDate("2022-10-23T00:00:00Z") + .note("string") + .paymentMethodRef(PaymentMethodRef.builder() + .id("string") + .name("string") + .build()) + .reference("string") + .sourceModifiedDate("2022-10-23T00:00:00Z") + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .totalAmount(0.86d) + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(455222) + .build(); + + CreatePaymentResponse res = sdk.loanWriteback().payments().create() + .request(req) + .call(); + + if (res.accountingCreatePaymentResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.CreatePaymentRequest](../../models/operations/CreatePaymentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreatePaymentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateModel + +The *Get create payment model* endpoint returns the expected data for the request payload when creating a [payment](https://docs.codat.io/lending-api#/schemas/Payment) for a given company and integration. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating a payment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreatePaymentModelRequest; +import io.codat.lending.models.operations.GetCreatePaymentModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreatePaymentModelRequest req = GetCreatePaymentModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreatePaymentModelResponse res = sdk.loanWriteback().payments().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCreatePaymentModelRequest](../../models/operations/GetCreatePaymentModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreatePaymentModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingreports/README.md b/lending/docs/sdks/codatlendingreports/README.md new file mode 100644 index 00000000..0b05fe80 --- /dev/null +++ b/lending/docs/sdks/codatlendingreports/README.md @@ -0,0 +1,200 @@ +# CodatLendingReports +(*sales().reports()*) + +### Available Operations + +* [getOrders](#getorders) - Get orders report +* [getRefunds](#getrefunds) - Get refunds report + +## getOrders + +The *Get orders report* endpoint returns the number of orders, total value, and average order value for a specific company's commerce connection over one or more periods of time. + +This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + +Learn more about the formulas used to calculate the order metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + +Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + +#### Response structure + +The Orders report's dimensions and measures are: + +| Index | Dimensions | +|---------------|----------------| +| `index` = 0 | Period | +| `index` = 1 | Order metrics | + +| Index | Measures | +|---------------|------------| +| `index` = 0 | Count | +| `index` = 1 | Value | + +The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceOrdersReportRequest; +import io.codat.lending.models.operations.GetCommerceOrdersReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.PeriodUnit; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceOrdersReportRequest req = GetCommerceOrdersReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .numberOfPeriods(491586L) + .periodLength(776309L) + .periodUnit(PeriodUnit.WEEK) + .reportDate("29-09-2020") + .includeDisplayNames(false) + .build(); + + GetCommerceOrdersReportResponse res = sdk.sales().reports().getOrders() + .request(req) + .call(); + + if (res.commerceReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCommerceOrdersReportRequest](../../models/operations/GetCommerceOrdersReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceOrdersReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getRefunds + +The *Get refunds report* endpoint returns the number and total value of refunds and the refund rate for a specific company's commerce connection over one or more periods of time. + +This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + +Learn more about the formulas used to calculate the refunds metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + +Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + +#### Response structure + +The Refunds report's dimensions and measures are: + +| Index | Dimensions | +|----------------|----------------| +| `index` = 0 | Period | +| `index` = 1 | Refund metrics | + +| Index | Measures | +|----------------|------------| +| `index` = 0 | Count | +| `index` = 1 | Value | +| `index` = 2 | Percentage | + +The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceRefundsReportRequest; +import io.codat.lending.models.operations.GetCommerceRefundsReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.PeriodUnit; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceRefundsReportRequest req = GetCommerceRefundsReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .numberOfPeriods(277786L) + .periodLength(876670L) + .periodUnit(PeriodUnit.YEAR) + .reportDate("29-09-2020") + .includeDisplayNames(false) + .build(); + + GetCommerceRefundsReportResponse res = sdk.sales().reports().getRefunds() + .request(req) + .call(); + + if (res.commerceReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceRefundsReportRequest](../../models/operations/GetCommerceRefundsReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceRefundsReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingsalespayments/README.md b/lending/docs/sdks/codatlendingsalespayments/README.md new file mode 100644 index 00000000..63eb1ce2 --- /dev/null +++ b/lending/docs/sdks/codatlendingsalespayments/README.md @@ -0,0 +1,158 @@ +# CodatLendingSalesPayments +(*sales().payments()*) + +### Available Operations + +* [get](#get) - Get payment +* [list](#list) - List payments + +## get + +The *Get payment* endpoint returns a single payment for a given paymentId. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) contain details of all payments made by customers to the company. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-payments) for integrations that support getting a specific payment. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommercePaymentRequest; +import io.codat.lending.models.operations.GetCommercePaymentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommercePaymentRequest req = GetCommercePaymentRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .paymentId("string") + .build(); + + GetCommercePaymentResponse res = sdk.sales().payments().get() + .request(req) + .call(); + + if (res.commercePayment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommercePaymentRequest](../../models/operations/GetCommercePaymentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommercePaymentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) contain details of all payments made by customers to the company. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommercePaymentsRequest; +import io.codat.lending.models.operations.ListCommercePaymentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommercePaymentsRequest req = ListCommercePaymentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommercePaymentsResponse res = sdk.sales().payments().list() + .request(req) + .call(); + + if (res.commercePayments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCommercePaymentsRequest](../../models/operations/ListCommercePaymentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommercePaymentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingsuppliers/README.md b/lending/docs/sdks/codatlendingsuppliers/README.md new file mode 100644 index 00000000..71c9a860 --- /dev/null +++ b/lending/docs/sdks/codatlendingsuppliers/README.md @@ -0,0 +1,192 @@ +# CodatLendingSuppliers +(*loanWriteback().suppliers()*) + +### Available Operations + +* [create](#create) - Create supplier +* [getCreateUpdateModel](#getcreateupdatemodel) - Get create/update supplier model + +## create + +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/lending-api#/operations/get-create-update-suppliers-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateSupplierRequest; +import io.codat.lending.models.operations.CreateSupplierResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountingAddress; +import io.codat.lending.models.shared.AccountingAddressType; +import io.codat.lending.models.shared.AccountingSupplier; +import io.codat.lending.models.shared.Metadata; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import io.codat.lending.models.shared.SupplierStatus; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateSupplierRequest req = CreateSupplierRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountingSupplier(AccountingSupplier.builder() + .status(SupplierStatus.ACTIVE) + .addresses(java.util.List.of( + AccountingAddress.builder() + .type(AccountingAddressType.BILLING) + .build())) + .contactName("string") + .defaultCurrency("string") + .emailAddress("Haylie78@hotmail.com") + .id("") + .metadata(Metadata.builder() + .isDeleted(false) + .build()) + .modifiedDate("2022-10-23T00:00:00Z") + .phone("01224 658 999") + .registrationNumber("string") + .sourceModifiedDate("2022-10-23T00:00:00Z") + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .supplierName("string") + .taxNumber("string") + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(376844) + .build(); + + CreateSupplierResponse res = sdk.loanWriteback().suppliers().create() + .request(req) + .call(); + + if (res.accountingCreateSupplierResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.CreateSupplierRequest](../../models/operations/CreateSupplierRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateSupplierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateUpdateModel + +The *Get create/update supplier model* endpoint returns the expected data for the request payload when creating and updating a [supplier](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company and integration. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating and updating a supplier. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequest; +import io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateUpdateSuppliersModelRequest req = GetCreateUpdateSuppliersModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateUpdateSuppliersModelResponse res = sdk.loanWriteback().suppliers().getCreateUpdateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequest](../../models/operations/GetCreateUpdateSuppliersModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateUpdateSuppliersModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingtransactions/README.md b/lending/docs/sdks/codatlendingtransactions/README.md new file mode 100644 index 00000000..8a120174 --- /dev/null +++ b/lending/docs/sdks/codatlendingtransactions/README.md @@ -0,0 +1,158 @@ +# CodatLendingTransactions +(*sales().transactions()*) + +### Available Operations + +* [get](#get) - Get transaction +* [list](#list) - List transactions + +## get + +The *Get transaction* endpoint returns a single transaction for a given transactionId. + +[Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) detail all financial affairs recorded in the commerce or point of sale system. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-transactions) for integrations that support getting a specific transaction. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceTransactionRequest; +import io.codat.lending.models.operations.GetCommerceTransactionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceTransactionRequest req = GetCommerceTransactionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .transactionId("string") + .build(); + + GetCommerceTransactionResponse res = sdk.sales().transactions().get() + .request(req) + .call(); + + if (res.commerceTransaction().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceTransactionRequest](../../models/operations/GetCommerceTransactionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceTransactionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. + +[Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) detail all financial affairs recorded in the commerce or point of sale system. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceTransactionsRequest; +import io.codat.lending.models.operations.ListCommerceTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceTransactionsRequest req = ListCommerceTransactionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceTransactionsResponse res = sdk.sales().transactions().list() + .request(req) + .call(); + + if (res.commerceTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListCommerceTransactionsRequest](../../models/operations/ListCommerceTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/codatlendingtransfers/README.md b/lending/docs/sdks/codatlendingtransfers/README.md new file mode 100644 index 00000000..a17fd876 --- /dev/null +++ b/lending/docs/sdks/codatlendingtransfers/README.md @@ -0,0 +1,158 @@ +# CodatLendingTransfers +(*transactions().transfers()*) + +### Available Operations + +* [get](#get) - Get transfer +* [list](#list) - List transfers + +## get + +The *Get transfer* endpoint returns a single transfer for a given transferId. + +[Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support getting a specific transfer. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingTransferRequest; +import io.codat.lending.models.operations.GetAccountingTransferResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingTransferRequest req = GetAccountingTransferRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .transferId("string") + .build(); + + GetAccountingTransferResponse res = sdk.transactions().transfers().get() + .request(req) + .call(); + + if (res.accountingTransfer().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingTransferRequest](../../models/operations/GetAccountingTransferRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingTransferResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List transfers* endpoint returns a list of [transfers](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company's connection. + +[Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingTransfersRequest; +import io.codat.lending.models.operations.ListAccountingTransfersResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingTransfersRequest req = ListAccountingTransfersRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingTransfersResponse res = sdk.transactions().transfers().list() + .request(req) + .call(); + + if (res.accountingTransfers().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingTransfersRequest](../../models/operations/ListAccountingTransfersRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingTransfersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/companies/README.md b/lending/docs/sdks/companies/README.md new file mode 100644 index 00000000..63da90f9 --- /dev/null +++ b/lending/docs/sdks/companies/README.md @@ -0,0 +1,381 @@ +# Companies +(*companies()*) + +## Overview + +Create and manage your Codat companies. + +### Available Operations + +* [create](#create) - Create company +* [delete](#delete) - Delete a company +* [get](#get) - Get company +* [list](#list) - List companies +* [update](#update) - Update company + +## create + +Use the *Create company* endpoint to create a new [company](https://docs.codat.io/lending-api#/schemas/Company) that represents your customer in Codat. + +A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CompanyRequestBody req = CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build(); + + CreateCompanyResponse res = sdk.companies().create() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.shared.CompanyRequestBody](../../models/shared/CompanyRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateCompanyResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## delete + +The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/lending-api#/schemas/Company), its [connections](https://docs.codat.io/lending-api#/schemas/Connection) and any cached data. This operation is irreversible. + +A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DeleteCompanyRequest; +import io.codat.lending.models.operations.DeleteCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DeleteCompanyRequest req = DeleteCompanyRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + DeleteCompanyResponse res = sdk.companies().delete() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DeleteCompanyRequest](../../models/operations/DeleteCompanyRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DeleteCompanyResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get company* endpoint returns a single company for a given `companyId`. + +A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCompanyRequest; +import io.codat.lending.models.operations.GetCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCompanyRequest req = GetCompanyRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetCompanyResponse res = sdk.companies().get() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCompanyRequest](../../models/operations/GetCompanyRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCompanyResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List companies* endpoint returns a list of [companies] associated to your instances. + +A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCompaniesRequest; +import io.codat.lending.models.operations.ListCompaniesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCompaniesRequest req = ListCompaniesRequest.builder() + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCompaniesResponse res = sdk.companies().list() + .request(req) + .call(); + + if (res.companies().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListCompaniesRequest](../../models/operations/ListCompaniesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCompaniesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## update + +Use the *Update company* endpoint to update both the name and description of the company. +If you use [groups](https://docs.codat.io/lending-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/lending-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/lending-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. + +A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.UpdateCompanyRequest; +import io.codat.lending.models.operations.UpdateCompanyResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CompanyRequestBody; +import io.codat.lending.models.shared.Items; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + UpdateCompanyRequest req = UpdateCompanyRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyRequestBody(CompanyRequestBody.builder() + .name("Bank of Dave") + .description("Requested early access to the new financing scheme.") + .groups(java.util.List.of( + Items.builder() + .id("60d2fa12-8a04-11ee-b9d1-0242ac120002") + .build())) + .build()) + .build(); + + UpdateCompanyResponse res = sdk.companies().update() + .request(req) + .call(); + + if (res.company().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.UpdateCompanyRequest](../../models/operations/UpdateCompanyRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UpdateCompanyResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/companyinfo/README.md b/lending/docs/sdks/companyinfo/README.md new file mode 100644 index 00000000..fcb954c9 --- /dev/null +++ b/lending/docs/sdks/companyinfo/README.md @@ -0,0 +1,148 @@ +# CompanyInfo +(*companyInfo()*) + +## Overview + +View company information fetched from the source platform. + +### Available Operations + +* [getAccountingProfile](#getaccountingprofile) - Get company accounting profile +* [getCommerceProfile](#getcommerceprofile) - Get company commerce profile + +## getAccountingProfile + +Gets the latest basic info for a company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingProfileRequest; +import io.codat.lending.models.operations.GetAccountingProfileResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingProfileRequest req = GetAccountingProfileRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetAccountingProfileResponse res = sdk.companyInfo().getAccountingProfile() + .request(req) + .call(); + + if (res.accountingCompanyInfo().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingProfileRequest](../../models/operations/GetAccountingProfileRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingProfileResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCommerceProfile + +Retrieve information about the company, as seen in the commerce +platform. + +This may include information like addresses, tax registration details and +social media or website information." + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceProfileRequest; +import io.codat.lending.models.operations.GetCommerceProfileResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceProfileRequest req = GetCommerceProfileRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCommerceProfileResponse res = sdk.companyInfo().getCommerceProfile() + .request(req) + .call(); + + if (res.commerceCompanyInfo().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceProfileRequest](../../models/operations/GetCommerceProfileRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceProfileResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/connections/README.md b/lending/docs/sdks/connections/README.md new file mode 100644 index 00000000..8cc7b249 --- /dev/null +++ b/lending/docs/sdks/connections/README.md @@ -0,0 +1,361 @@ +# Connections +(*connections()*) + +## Overview + +Manage your companies' data connections. + +### Available Operations + +* [create](#create) - Create connection +* [delete](#delete) - Delete connection +* [get](#get) - Get connection +* [list](#list) - List connections +* [unlink](#unlink) - Unlink connection + +## create + +Creates a connection for the company by providing a valid `platformKey`. + +Use the [List Integrations](https://docs.codat.io/lending-api#/operations/list-integrations) endpoint to access valid platform keys. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateConnectionRequest; +import io.codat.lending.models.operations.CreateConnectionRequestBody; +import io.codat.lending.models.operations.CreateConnectionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateConnectionRequest req = CreateConnectionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .requestBody(CreateConnectionRequestBody.builder() + .platformKey("gbol") + .build()) + .build(); + + CreateConnectionResponse res = sdk.connections().create() + .request(req) + .call(); + + if (res.connection().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.CreateConnectionRequest](../../models/operations/CreateConnectionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## delete + +Revoke and remove a connection from a company. +This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DeleteConnectionRequest; +import io.codat.lending.models.operations.DeleteConnectionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DeleteConnectionRequest req = DeleteConnectionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + DeleteConnectionResponse res = sdk.connections().delete() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DeleteConnectionRequest](../../models/operations/DeleteConnectionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DeleteConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetConnectionRequest; +import io.codat.lending.models.operations.GetConnectionResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetConnectionRequest req = GetConnectionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetConnectionResponse res = sdk.connections().get() + .request(req) + .call(); + + if (res.connection().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetConnectionRequest](../../models/operations/GetConnectionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +List the connections for a company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListConnectionsRequest; +import io.codat.lending.models.operations.ListConnectionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListConnectionsRequest req = ListConnectionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListConnectionsResponse res = sdk.connections().list() + .request(req) + .call(); + + if (res.connections().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListConnectionsRequest](../../models/operations/ListConnectionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListConnectionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## unlink + +This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.UnlinkConnectionRequest; +import io.codat.lending.models.operations.UnlinkConnectionResponse; +import io.codat.lending.models.operations.UnlinkConnectionUpdateConnection; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.DataConnectionStatus; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + UnlinkConnectionRequest req = UnlinkConnectionRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .requestBody(UnlinkConnectionUpdateConnection.builder() + .status(DataConnectionStatus.PENDING_AUTH) + .build()) + .build(); + + UnlinkConnectionResponse res = sdk.connections().unlink() + .request(req) + .call(); + + if (res.connection().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.UnlinkConnectionRequest](../../models/operations/UnlinkConnectionRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UnlinkConnectionResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/createoperations/README.md b/lending/docs/sdks/createoperations/README.md new file mode 100644 index 00000000..1f318abf --- /dev/null +++ b/lending/docs/sdks/createoperations/README.md @@ -0,0 +1,144 @@ +# CreateOperations +(*loanWriteback().createOperations()*) + +### Available Operations + +* [get](#get) - Get create operation +* [list](#list) - List create operations + +## get + +Retrieve create operation. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateOperationRequest; +import io.codat.lending.models.operations.GetCreateOperationResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateOperationRequest req = GetCreateOperationRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .pushOperationKey("b18d8d81-fd7b-4764-a31e-475cb1f36591") + .build(); + + GetCreateOperationResponse res = sdk.loanWriteback().createOperations().get() + .request(req) + .call(); + + if (res.pushOperation().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCreateOperationRequest](../../models/operations/GetCreateOperationRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateOperationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +List create operations. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCreateOperationsRequest; +import io.codat.lending.models.operations.ListCreateOperationsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCreateOperationsRequest req = ListCreateOperationsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCreateOperationsResponse res = sdk.loanWriteback().createOperations().list() + .request(req) + .call(); + + if (res.pushOperations().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCreateOperationsRequest](../../models/operations/ListCreateOperationsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCreateOperationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/creditnotes/README.md b/lending/docs/sdks/creditnotes/README.md new file mode 100644 index 00000000..b3b03ae9 --- /dev/null +++ b/lending/docs/sdks/creditnotes/README.md @@ -0,0 +1,156 @@ +# CreditNotes +(*accountsReceivable().creditNotes()*) + +### Available Operations + +* [get](#get) - Get credit note +* [list](#list) - List credit notes + +## get + +The *Get credit note* endpoint returns a single credit note for a given creditNoteId. + +[Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) are issued to a customer to indicate debt, typically with reference to a previously issued invoice and/or purchase. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=creditNotes) for integrations that support getting a specific credit note. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingCreditNoteRequest; +import io.codat.lending.models.operations.GetAccountingCreditNoteResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingCreditNoteRequest req = GetAccountingCreditNoteRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .creditNoteId("string") + .build(); + + GetAccountingCreditNoteResponse res = sdk.accountsReceivable().creditNotes().get() + .request(req) + .call(); + + if (res.accountingCreditNote().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingCreditNoteRequest](../../models/operations/GetAccountingCreditNoteRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingCreditNoteResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List credit notes* endpoint returns a list of [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) for a given company's connection. + +[Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) are issued to a customer to indicate debt, typically with reference to a previously issued invoice and/or purchase. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingCreditNotesRequest; +import io.codat.lending.models.operations.ListAccountingCreditNotesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingCreditNotesRequest req = ListAccountingCreditNotesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingCreditNotesResponse res = sdk.accountsReceivable().creditNotes().list() + .request(req) + .call(); + + if (res.accountingCreditNotes().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingCreditNotesRequest](../../models/operations/ListAccountingCreditNotesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingCreditNotesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/customers/README.md b/lending/docs/sdks/customers/README.md new file mode 100644 index 00000000..9904b395 --- /dev/null +++ b/lending/docs/sdks/customers/README.md @@ -0,0 +1,380 @@ +# Customers +(*accountsReceivable().customers()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download customer attachment +* [get](#get) - Get customer +* [getAttachment](#getattachment) - Get customer attachment +* [list](#list) - List customers +* [listAttachments](#listattachments) - List customer attachments + +## downloadAttachment + +The *Download customer attachment* endpoint downloads a specific attachment for a given `customerId` and `attachmentId`. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support downloading a customer attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingCustomerAttachmentRequest req = DownloadAccountingCustomerAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .customerId("string") + .build(); + + DownloadAccountingCustomerAttachmentResponse res = sdk.accountsReceivable().customers().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequest](../../models/operations/DownloadAccountingCustomerAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingCustomerAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get customer* endpoint returns a single customer for a given customerId. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a specific customer. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingCustomerRequest; +import io.codat.lending.models.operations.GetAccountingCustomerResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingCustomerRequest req = GetAccountingCustomerRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .customerId("string") + .build(); + + GetAccountingCustomerResponse res = sdk.accountsReceivable().customers().get() + .request(req) + .call(); + + if (res.accountingCustomer().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingCustomerRequest](../../models/operations/GetAccountingCustomerRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingCustomerResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get customer attachment* endpoint returns a specific attachment for a given `customerId` and `attachmentId`. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a customer attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingCustomerAttachmentRequest req = GetAccountingCustomerAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .customerId("string") + .build(); + + GetAccountingCustomerAttachmentResponse res = sdk.accountsReceivable().customers().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequest](../../models/operations/GetAccountingCustomerAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingCustomerAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingCustomersRequest; +import io.codat.lending.models.operations.ListAccountingCustomersResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingCustomersRequest req = ListAccountingCustomersRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingCustomersResponse res = sdk.accountsReceivable().customers().list() + .request(req) + .call(); + + if (res.accountingCustomers().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingCustomersRequest](../../models/operations/ListAccountingCustomersRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingCustomersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List customer attachments* endpoint returns a list of attachments avialable to download for given `customerId`. + +[Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support listing customer attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingCustomerAttachmentsRequest req = ListAccountingCustomerAttachmentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .customerId("string") + .build(); + + ListAccountingCustomerAttachmentsResponse res = sdk.accountsReceivable().customers().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequest](../../models/operations/ListAccountingCustomerAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingCustomerAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/dataintegrity/README.md b/lending/docs/sdks/dataintegrity/README.md new file mode 100644 index 00000000..39a58fdb --- /dev/null +++ b/lending/docs/sdks/dataintegrity/README.md @@ -0,0 +1,234 @@ +# DataIntegrity +(*dataIntegrity()*) + +## Overview + +Match mutable accounting data with immutable banking data to increase confidence in financial data. + +### Available Operations + +* [details](#details) - List data integrity details +* [status](#status) - Get data integrity status +* [summaries](#summaries) - Get data integrity summaries + +## details + +The *List data integrity details* endpoint returns the match result record by record for a given data type, filtered based on a query string in the same way as summary results. + +The [details](https://docs.codat.io/lending-api#/schemas/DataIntegrityDetails) are paginated and support ordering, following the same conventions as our other data endpoints. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListDataIntegrityDetailsRequest; +import io.codat.lending.models.operations.ListDataIntegrityDetailsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.DataIntegrityDataType; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListDataIntegrityDetailsRequest req = ListDataIntegrityDetailsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .dataType(DataIntegrityDataType.BANKING_ACCOUNTS) + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListDataIntegrityDetailsResponse res = sdk.dataIntegrity().details() + .request(req) + .call(); + + if (res.dataIntegrityDetails().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListDataIntegrityDetailsRequest](../../models/operations/ListDataIntegrityDetailsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListDataIntegrityDetailsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## status + +The *Get data integrity status* endpoint returns the [status](https://docs.codat.io/lending-api#/schemas/DataIntegrityStatus) for the company’s match results between the data type provided in the URL and other data types that Data Integrity uses to support matching. +This endpoint helps you understand whether match data is available and, if so, how to usefully query it. + +The response tells you: + +- Whether match results are available. +- When the results were generated, and their status. +- The connection IDs, amounts, and dates involved to support useful querying. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetDataIntegrityStatusRequest; +import io.codat.lending.models.operations.GetDataIntegrityStatusResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.DataIntegrityDataType; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetDataIntegrityStatusRequest req = GetDataIntegrityStatusRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .dataType(DataIntegrityDataType.BANKING_ACCOUNTS) + .build(); + + GetDataIntegrityStatusResponse res = sdk.dataIntegrity().status() + .request(req) + .call(); + + if (res.dataIntegrityStatuses().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetDataIntegrityStatusRequest](../../models/operations/GetDataIntegrityStatusRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetDataIntegrityStatusResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## summaries + +The *Get data integrity summary* endpoint returns a [summary](https://docs.codat.io/lending-api#/schemas/DataIntegritySummary) of match results for a given data type filtered by a query string in the [Codat query language](https://docs.codat.io/using-the-api/querying). + +For example, if you wanted to see summary match results only for transactions after 1 December 2020, you could include a query parameter of `query=date>2020-12-01`. + +The endpoint response includes only the summary results, not transactions. To view match data for transactions, use the [List data integrity details](https://docs.codat.io/lending-api#/operations/list-data-type-data-integrity-details) endpoint. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetDataIntegritySummariesRequest; +import io.codat.lending.models.operations.GetDataIntegritySummariesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.DataIntegrityDataType; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetDataIntegritySummariesRequest req = GetDataIntegritySummariesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .dataType(DataIntegrityDataType.BANKING_ACCOUNTS) + .query("string") + .build(); + + GetDataIntegritySummariesResponse res = sdk.dataIntegrity().summaries() + .request(req) + .call(); + + if (res.dataIntegritySummaries().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetDataIntegritySummariesRequest](../../models/operations/GetDataIntegritySummariesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetDataIntegritySummariesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/directcosts/README.md b/lending/docs/sdks/directcosts/README.md new file mode 100644 index 00000000..48ae0021 --- /dev/null +++ b/lending/docs/sdks/directcosts/README.md @@ -0,0 +1,243 @@ +# DirectCosts +(*loanWriteback().directCosts()*) + +### Available Operations + +* [create](#create) - Create direct cost +* [getCreateModel](#getcreatemodel) - Get create direct cost model + +## create + +The *Create direct cost* endpoint creates a new [direct cost](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company's connection. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are the expenses associated with a business' operations. For example, purchases of raw materials that are paid off at the point of the purchase and service fees are considered direct costs. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create direct cost model](https://docs.codat.io/lending-api#/operations/get-create-directCosts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateDirectCostRequest; +import io.codat.lending.models.operations.CreateDirectCostResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountRef; +import io.codat.lending.models.shared.AccountingPaymentAllocation; +import io.codat.lending.models.shared.Allocation; +import io.codat.lending.models.shared.ContactReference; +import io.codat.lending.models.shared.DirectCostLineItem; +import io.codat.lending.models.shared.DirectCostPrototype; +import io.codat.lending.models.shared.DirectCostPrototypeDataType; +import io.codat.lending.models.shared.PaymentAllocationPayment; +import io.codat.lending.models.shared.PropertieItemRef; +import io.codat.lending.models.shared.RecordRef; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import io.codat.lending.models.shared.TaxRateRef; +import io.codat.lending.models.shared.Tracking; +import io.codat.lending.models.shared.TrackingCategoryRef; +import io.codat.lending.models.shared.TrackingRecordRef; +import io.codat.lending.models.shared.TrackingRecordRefDataType; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateDirectCostRequest req = CreateDirectCostRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .allowSyncOnPushComplete(false) + .directCostPrototype(DirectCostPrototype.builder() + .currency("USD") + .issueDate("2022-10-23T00:00:00Z") + .lineItems(java.util.List.of( + DirectCostLineItem.builder() + .quantity(2884.08d) + .unitAmount(1343.65d) + .accountRef(AccountRef.builder() + .build()) + .itemRef(PropertieItemRef.builder() + .id("string") + .build()) + .taxRateRef(TaxRateRef.builder() + .build()) + .tracking(Tracking.builder() + .recordRefs(java.util.List.of( + TrackingRecordRef.builder() + .dataType(TrackingRecordRefDataType.TRACKING_CATEGORIES) + .build())) + .invoiceTo(RecordRef.builder() + .dataType("transfer") + .build()) + .build()) + .trackingCategoryRefs(java.util.List.of( + TrackingCategoryRef.builder() + .id("string") + .build())) + .build())) + .paymentAllocations(java.util.List.of( + AccountingPaymentAllocation.builder() + .allocation(Allocation.builder() + .allocatedOnDate("2022-10-23T00:00:00Z") + .currency("EUR") + .currencyRate(8915.1d) + .totalAmount(0.86d) + .build()) + .payment(PaymentAllocationPayment.builder() + .accountRef(AccountRef.builder() + .id("") + .name("string") + .build()) + .currency("USD") + .currencyRate(1697.27d) + .id("") + .note("string") + .paidOnDate("2022-10-23T00:00:00Z") + .reference("string") + .totalAmount(899.64d) + .build()) + .build())) + .subTotal(7150.4d) + .taxAmount(7926.2d) + .totalAmount(8559.52d) + .contactRef(ContactReference.builder() + .id("string") + .dataType(DirectCostPrototypeDataType.SUPPLIERS) + .build()) + .currencyRate(5519.29d) + .note("string") + .reference("string") + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .build()) + .timeoutInMinutes(586220) + .build(); + + CreateDirectCostResponse res = sdk.loanWriteback().directCosts().create() + .request(req) + .call(); + + if (res.accountingCreateDirectCostResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.CreateDirectCostRequest](../../models/operations/CreateDirectCostRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateDirectCostResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateModel + +The *Get create direct cost model* endpoint returns the expected data for the request payload when creating a [direct cost](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company and integration. + +[Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating a direct cost. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateDirectCostsModelRequest; +import io.codat.lending.models.operations.GetCreateDirectCostsModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateDirectCostsModelRequest req = GetCreateDirectCostsModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateDirectCostsModelResponse res = sdk.loanWriteback().directCosts().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCreateDirectCostsModelRequest](../../models/operations/GetCreateDirectCostsModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateDirectCostsModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/directincomes/README.md b/lending/docs/sdks/directincomes/README.md new file mode 100644 index 00000000..f6b47b72 --- /dev/null +++ b/lending/docs/sdks/directincomes/README.md @@ -0,0 +1,383 @@ +# DirectIncomes +(*accountsReceivable().directIncomes()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download direct income attachment +* [get](#get) - Get direct income +* [getAttachment](#getattachment) - Get direct income attachment +* [list](#list) - List direct incomes +* [listAttachments](#listattachments) - List direct income attachments + +## downloadAttachment + +The *Download direct income attachment* endpoint downloads a specific attachment for a given `directIncomeId` and `attachmentId`. + +[Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support downloading a direct income attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingDirectIncomeAttachmentRequest req = DownloadAccountingDirectIncomeAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directIncomeId("string") + .build(); + + DownloadAccountingDirectIncomeAttachmentResponse res = sdk.accountsReceivable().directIncomes().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequest](../../models/operations/DownloadAccountingDirectIncomeAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingDirectIncomeAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get direct income* endpoint returns a single direct income for a given directIncomeId. + +[Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support getting a specific direct income. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingDirectIncomeRequest; +import io.codat.lending.models.operations.GetAccountingDirectIncomeResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingDirectIncomeRequest req = GetAccountingDirectIncomeRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directIncomeId("string") + .build(); + + GetAccountingDirectIncomeResponse res = sdk.accountsReceivable().directIncomes().get() + .request(req) + .call(); + + if (res.accountingDirectIncome().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingDirectIncomeRequest](../../models/operations/GetAccountingDirectIncomeRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingDirectIncomeResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get direct income attachment* endpoint returns a specific attachment for a given `directIncomeId` and `attachmentId`. + +[Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support getting a direct income attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingDirectIncomeAttachmentRequest req = GetAccountingDirectIncomeAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directIncomeId("string") + .timeoutInMinutes(903055) + .build(); + + GetAccountingDirectIncomeAttachmentResponse res = sdk.accountsReceivable().directIncomes().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest](../../models/operations/GetAccountingDirectIncomeAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingDirectIncomeAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List direct incomes* endpoint returns a list of [direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) for a given company's connection. + +[Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingDirectIncomesRequest; +import io.codat.lending.models.operations.ListAccountingDirectIncomesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingDirectIncomesRequest req = ListAccountingDirectIncomesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingDirectIncomesResponse res = sdk.accountsReceivable().directIncomes().list() + .request(req) + .call(); + + if (res.accountingDirectIncomes().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingDirectIncomesRequest](../../models/operations/ListAccountingDirectIncomesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingDirectIncomesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List direct income attachments* endpoint returns a list of attachments available to download for given `directIncomeId`. + +[Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support listing direct income attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingDirectIncomeAttachmentsRequest req = ListAccountingDirectIncomeAttachmentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .directIncomeId("string") + .build(); + + ListAccountingDirectIncomeAttachmentsResponse res = sdk.accountsReceivable().directIncomes().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequest](../../models/operations/ListAccountingDirectIncomeAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingDirectIncomeAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/disputes/README.md b/lending/docs/sdks/disputes/README.md new file mode 100644 index 00000000..437fdfa7 --- /dev/null +++ b/lending/docs/sdks/disputes/README.md @@ -0,0 +1,158 @@ +# Disputes +(*sales().disputes()*) + +### Available Operations + +* [get](#get) - Get dispute +* [list](#list) - List disputes + +## get + +The *Get dispute* endpoint returns a single dispute for a given disputeId. + +[Disputes](https://docs.codat.io/lending-api#/schemas/Dispute) are created when a customer is unsatisfied with their purchase or believe they have been charged incorrectly. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-disputes) for integrations that support getting a specific dispute. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceDisputeRequest; +import io.codat.lending.models.operations.GetCommerceDisputeResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceDisputeRequest req = GetCommerceDisputeRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .disputeId("string") + .build(); + + GetCommerceDisputeResponse res = sdk.sales().disputes().get() + .request(req) + .call(); + + if (res.commerceDispute().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceDisputeRequest](../../models/operations/GetCommerceDisputeRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceDisputeResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List disputes* endpoint returns a list of [disputes](https://docs.codat.io/lending-api#/schemas/Dispute) for a given company's connection. + +[Disputes](https://docs.codat.io/lending-api#/schemas/Dispute) are created when a customer is unsatisfied with their purchase or believe they have been charged incorrectly. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceDisputesRequest; +import io.codat.lending.models.operations.ListCommerceDisputesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceDisputesRequest req = ListCommerceDisputesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceDisputesResponse res = sdk.sales().disputes().list() + .request(req) + .call(); + + if (res.commerceDisputes().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCommerceDisputesRequest](../../models/operations/ListCommerceDisputesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceDisputesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/excelreports/README.md b/lending/docs/sdks/excelreports/README.md new file mode 100644 index 00000000..c0a2452d --- /dev/null +++ b/lending/docs/sdks/excelreports/README.md @@ -0,0 +1,240 @@ +# ExcelReports +(*excelReports()*) + +## Overview + +Download reports in Excel format. + +### Available Operations + +* [download](#download) - Download Excel report +* [generate](#generate) - Generate Excel report +* [getStatus](#getstatus) - Get Excel report status + +## download + +The *Download Excel report* endpoint downloads the latest successfully generated Excel report of a specified report type for a given company. + +The downloadable Excel file is returned in the response. You can save it to your local machine. + +You can [learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadExcelReportRequest; +import io.codat.lending.models.operations.DownloadExcelReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.ExcelReportTypes; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadExcelReportRequest req = DownloadExcelReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .reportType(ExcelReportTypes.ENHANCED_FINANCIALS) + .build(); + + DownloadExcelReportResponse res = sdk.excelReports().download() + .request(req) + .call(); + + if (res.body().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadExcelReportRequest](../../models/operations/DownloadExcelReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadExcelReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## generate + +The *Generate Excel report* endpoint requests the production of a downloadable Excel file for a report type specified in the `reportType` query parameter. + +In response, the endpoint returns the [status](https://docs.codat.io/lending-api#/schemas/ExcelStatus) detailing the current state of the report generation request. + +### Report types + +| reportType | Description | +|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| +| [audit](https://docs.codat.io/lending/excel/audit-report) | Identifies inaccurate or out-of-date accounts, helping you to make decisions with confidence. || [audit](https://docs.codat.io/lending/excel/audit-report) | Identify inaccurate or out-of-date accounts, helping you to make decisions with confidence. | +| [enhancedCashFlow](https://docs.codat.io/lending/excel/enhanced-invoices-report) | Provides a fully categorized list of bank transactions for a company, allowing lenders to accurately forecast a company's cash flow. | +| [enhancedFinancials](https://docs.codat.io/lending/excel/enhanced-financials-report) | Supports decision-making using fully categorized financial statements to allow lenders to automate their underwriting processes. | +| [enhancedInvoices](https://docs.codat.io/lending/excel/enhanced-invoices-report) | Helps verify that payments have been made against historic invoices. Great for invoice finance lenders. | + +[Learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. + + + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GenerateExcelReportRequest; +import io.codat.lending.models.operations.GenerateExcelReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.ExcelReportTypes; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GenerateExcelReportRequest req = GenerateExcelReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .reportType(ExcelReportTypes.ENHANCED_INVOICES) + .build(); + + GenerateExcelReportResponse res = sdk.excelReports().generate() + .request(req) + .call(); + + if (res.excelStatus().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GenerateExcelReportRequest](../../models/operations/GenerateExcelReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GenerateExcelReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getStatus + +The *Get Excel report status* returns the status of the report mostly recently requested for Excel generation. It does not return the status of any historical report requests. + +Poll this endpoint to check the progress of the report once you have requested its generation. This will not affect the generation of the report. + +When the report generation completes successfully, the `inProgress` property will be marked as `false` and the `success` field will be marked as `true`. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest; +import io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.ExcelReportTypes; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetExcelReportGenerationStatusRequest req = GetExcelReportGenerationStatusRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .reportType(ExcelReportTypes.ENHANCED_CASH_FLOW) + .build(); + + GetExcelReportGenerationStatusResponse res = sdk.excelReports().getStatus() + .request(req) + .call(); + + if (res.excelStatus().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest](../../models/operations/GetExcelReportGenerationStatusRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetExcelReportGenerationStatusResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/fileupload/README.md b/lending/docs/sdks/fileupload/README.md new file mode 100644 index 00000000..e50b6c16 --- /dev/null +++ b/lending/docs/sdks/fileupload/README.md @@ -0,0 +1,224 @@ +# FileUpload +(*fileUpload()*) + +## Overview + +Endpoints to manage uploaded files. + +### Available Operations + +* [download](#download) - Download all files for a company +* [listUploaded](#listuploaded) - List all files uploaded by a company +* [upload](#upload) - Upload files for a company + +## download + +The *Download files* endpoint downloads all files that have been uploaded by to SMB to Codat. A `date` may be specified to download any files uploaded on the date provided. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadFilesRequest; +import io.codat.lending.models.operations.DownloadFilesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadFilesRequest req = DownloadFilesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .date("2022-10-23T00:00:00Z") + .build(); + + DownloadFilesResponse res = sdk.fileUpload().download() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadFilesRequest](../../models/operations/DownloadFilesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadFilesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listUploaded + +The *List files* endpoint returns a list of all files uploaded to Codat by the SMB. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListFilesRequest; +import io.codat.lending.models.operations.ListFilesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListFilesRequest req = ListFilesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + ListFilesResponse res = sdk.fileUpload().listUploaded() + .request(req) + .call(); + + if (res.files().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListFilesRequest](../../models/operations/ListFilesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListFilesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## upload + +The *Upload files* endpoint uploads multiple files provided by the SMB to Codat. This may include personal identity documents, pitch decks, contracts, or files with accounting and banking data. + +Uploaded files must meet the following requirements: + +- Up to 20 files can be uploaded at a time. +- PDF, XLS, XLSX, XLSB, CSV, DOC, DOCX, PPT, PPTX, JPEG, JPG, and PNG files can be uploaded. +- Each file can be up to 10MB in size. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.UploadFilesRequest; +import io.codat.lending.models.operations.UploadFilesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.CodatFile; +import io.codat.lending.models.shared.FileUpload; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + UploadFilesRequest req = UploadFilesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .fileUpload(FileUpload.builder() + .file(CodatFile.builder() + .content("0x87cbca97eC".getBytes()) + .fileName("string") + .build()) + .build()) + .build(); + + UploadFilesResponse res = sdk.fileUpload().upload() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.UploadFilesRequest](../../models/operations/UploadFilesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/UploadFilesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/financialstatements/README.md b/lending/docs/sdks/financialstatements/README.md new file mode 100644 index 00000000..d2699c5f --- /dev/null +++ b/lending/docs/sdks/financialstatements/README.md @@ -0,0 +1,5 @@ +# FinancialStatements +(*financialStatements()*) + +### Available Operations + diff --git a/lending/docs/sdks/invoices/README.md b/lending/docs/sdks/invoices/README.md new file mode 100644 index 00000000..d597768f --- /dev/null +++ b/lending/docs/sdks/invoices/README.md @@ -0,0 +1,523 @@ +# Invoices +(*accountsReceivable().invoices()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download invoice attachment +* [downloadPdf](#downloadpdf) - Get invoice as PDF +* [get](#get) - Get invoice +* [getAttachment](#getattachment) - Get invoice attachment +* [list](#list) - List invoices +* [listAttachments](#listattachments) - List invoice attachments +* [listReconciled](#listreconciled) - List reconciled invoices + +## downloadAttachment + +The *Download invoice attachment* endpoint downloads a specific attachment for a given `invoiceId` and `attachmentId`. + +[Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support downloading an invoice attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingInvoiceAttachmentRequest req = DownloadAccountingInvoiceAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .invoiceId("string") + .build(); + + DownloadAccountingInvoiceAttachmentResponse res = sdk.accountsReceivable().invoices().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequest](../../models/operations/DownloadAccountingInvoiceAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingInvoiceAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## downloadPdf + +Download invoice as a pdf. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequest; +import io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingInvoicePdfRequest req = DownloadAccountingInvoicePdfRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .invoiceId("string") + .build(); + + DownloadAccountingInvoicePdfResponse res = sdk.accountsReceivable().invoices().downloadPdf() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequest](../../models/operations/DownloadAccountingInvoicePdfRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingInvoicePdfResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get invoice* endpoint returns a single invoice for a given invoiceId. + +[Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting a specific invoice. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingInvoiceRequest; +import io.codat.lending.models.operations.GetAccountingInvoiceResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingInvoiceRequest req = GetAccountingInvoiceRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .invoiceId("string") + .build(); + + GetAccountingInvoiceResponse res = sdk.accountsReceivable().invoices().get() + .request(req) + .call(); + + if (res.accountingInvoice().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingInvoiceRequest](../../models/operations/GetAccountingInvoiceRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingInvoiceResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get invoice attachment* endpoint returns a specific attachment for a given `invoiceId` and `attachmentId`. + +[Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting an invoice attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingInvoiceAttachmentRequest req = GetAccountingInvoiceAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .invoiceId("string") + .build(); + + GetAccountingInvoiceAttachmentResponse res = sdk.accountsReceivable().invoices().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequest](../../models/operations/GetAccountingInvoiceAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingInvoiceAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List invoices* endpoint returns a list of [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) for a given company's connection. + +[Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + +### Useful queries + +- Outstanding invoices - `query = amountDue > 0` +- Invoices due after a certain date: `query = dueDate > 2021-01-28` + +[Read more about querying](https://docs.codat.io/using-the-api/querying). + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingInvoicesRequest; +import io.codat.lending.models.operations.ListAccountingInvoicesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingInvoicesRequest req = ListAccountingInvoicesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingInvoicesResponse res = sdk.accountsReceivable().invoices().list() + .request(req) + .call(); + + if (res.accountingInvoices().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingInvoicesRequest](../../models/operations/ListAccountingInvoicesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingInvoicesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List invoice attachments* endpoint returns a list of attachments available to download for given `invoiceId`. + +[Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support listing invoice attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingInvoiceAttachmentsRequest req = ListAccountingInvoiceAttachmentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .invoiceId("string") + .build(); + + ListAccountingInvoiceAttachmentsResponse res = sdk.accountsReceivable().invoices().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequest](../../models/operations/ListAccountingInvoiceAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingInvoiceAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listReconciled + +Gets a list of invoices linked to the corresponding banking transaction + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListReconciledInvoicesRequest; +import io.codat.lending.models.operations.ListReconciledInvoicesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListReconciledInvoicesRequest req = ListReconciledInvoicesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListReconciledInvoicesResponse res = sdk.accountsReceivable().invoices().listReconciled() + .request(req) + .call(); + + if (res.enhancedInvoicesReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListReconciledInvoicesRequest](../../models/operations/ListReconciledInvoicesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListReconciledInvoicesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/journalentries/README.md b/lending/docs/sdks/journalentries/README.md new file mode 100644 index 00000000..ddae94d4 --- /dev/null +++ b/lending/docs/sdks/journalentries/README.md @@ -0,0 +1,156 @@ +# JournalEntries +(*transactions().journalEntries()*) + +### Available Operations + +* [get](#get) - Get journal entry +* [list](#list) - List journal entries + +## get + +The *Get journal entry* endpoint returns a single journal entry for a given journalEntryId. + +[Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support getting a specific journal entry. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingJournalEntryRequest; +import io.codat.lending.models.operations.GetAccountingJournalEntryResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingJournalEntryRequest req = GetAccountingJournalEntryRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .journalEntryId("string") + .build(); + + GetAccountingJournalEntryResponse res = sdk.transactions().journalEntries().get() + .request(req) + .call(); + + if (res.accountingJournalEntry().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingJournalEntryRequest](../../models/operations/GetAccountingJournalEntryRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingJournalEntryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List journal entries* endpoint returns a list of [journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) for a given company's connection. + +[Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingJournalEntriesRequest; +import io.codat.lending.models.operations.ListAccountingJournalEntriesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingJournalEntriesRequest req = ListAccountingJournalEntriesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingJournalEntriesResponse res = sdk.transactions().journalEntries().list() + .request(req) + .call(); + + if (res.accountingJournalEntries().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingJournalEntriesRequest](../../models/operations/ListAccountingJournalEntriesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingJournalEntriesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/journals/README.md b/lending/docs/sdks/journals/README.md new file mode 100644 index 00000000..66fdd73f --- /dev/null +++ b/lending/docs/sdks/journals/README.md @@ -0,0 +1,156 @@ +# Journals +(*transactions().journals()*) + +### Available Operations + +* [get](#get) - Get journal +* [list](#list) - List journals + +## get + +The *Get journal* endpoint returns a single journal for a given journalId. + +[Journals](https://docs.codat.io/lending-api#/schemas/Journal) are used to record all the financial transactions of a company. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingJournalRequest; +import io.codat.lending.models.operations.GetAccountingJournalResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingJournalRequest req = GetAccountingJournalRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .journalId("string") + .build(); + + GetAccountingJournalResponse res = sdk.transactions().journals().get() + .request(req) + .call(); + + if (res.accountingJournal().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingJournalRequest](../../models/operations/GetAccountingJournalRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingJournalResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List journals* endpoint returns a list of [journals](https://docs.codat.io/lending-api#/schemas/Journal) for a given company's connection. + +[Journals](https://docs.codat.io/lending-api#/schemas/Journal) are used to record all the financial transactions of a company. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingJournalsRequest; +import io.codat.lending.models.operations.ListAccountingJournalsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingJournalsRequest req = ListAccountingJournalsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingJournalsResponse res = sdk.transactions().journals().list() + .request(req) + .call(); + + if (res.accountingJournals().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingJournalsRequest](../../models/operations/ListAccountingJournalsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingJournalsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/liabilities/README.md b/lending/docs/sdks/liabilities/README.md new file mode 100644 index 00000000..ab8d0720 --- /dev/null +++ b/lending/docs/sdks/liabilities/README.md @@ -0,0 +1,301 @@ +# Liabilities +(*liabilities()*) + +## Overview + +Debt and other liabilities. + +### Available Operations + +* [generateLoanSummary](#generateloansummary) - Generate loan summaries report +* [generateLoanTransactions](#generateloantransactions) - Generate loan transactions report +* [getLoanSummary](#getloansummary) - Get loan summaries +* [listLoanTransactions](#listloantransactions) - List loan transactions + +## generateLoanSummary + +The _Generate loan summaries_ endpoint requests the generation of the Loan Summaries report. + +Learn more about Codat's liabilities feature [here](https://docs.codat.io/lending/features/liabilities-overview). + +Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GenerateLoanSummaryRequest; +import io.codat.lending.models.operations.GenerateLoanSummaryResponse; +import io.codat.lending.models.operations.SourceType; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GenerateLoanSummaryRequest req = GenerateLoanSummaryRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .sourceType(SourceType.ACCOUNTING) + .build(); + + GenerateLoanSummaryResponse res = sdk.liabilities().generateLoanSummary() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GenerateLoanSummaryRequest](../../models/operations/GenerateLoanSummaryRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GenerateLoanSummaryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## generateLoanTransactions + +The _Generate loan transactions_ endpoint requests the generation of the Loan Transactions report. + +Learn more about Codat's liabilities feature [here](https://docs.codat.io/lending/features/liabilities-overview). + +Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GenerateLoanTransactionsRequest; +import io.codat.lending.models.operations.GenerateLoanTransactionsResponse; +import io.codat.lending.models.operations.QueryParamSourceType; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GenerateLoanTransactionsRequest req = GenerateLoanTransactionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .sourceType(QueryParamSourceType.ACCOUNTING) + .build(); + + GenerateLoanTransactionsResponse res = sdk.liabilities().generateLoanTransactions() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GenerateLoanTransactionsRequest](../../models/operations/GenerateLoanTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GenerateLoanTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getLoanSummary + +The *Get loan summaries* endpoint returns a summary by integration type of all loans identified from a company's accounting, banking, and commerce integrations. + +The endpoint returns a list of a company's [loan summaries](https://docs.codat.io/lending-api#/schemas/LoanSummary) for each valid data connection. + +Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetLoanSummaryQueryParamSourceType; +import io.codat.lending.models.operations.GetLoanSummaryRequest; +import io.codat.lending.models.operations.GetLoanSummaryResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetLoanSummaryRequest req = GetLoanSummaryRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .sourceType(GetLoanSummaryQueryParamSourceType.BANKING) + .build(); + + GetLoanSummaryResponse res = sdk.liabilities().getLoanSummary() + .request(req) + .call(); + + if (res.loanSummary().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetLoanSummaryRequest](../../models/operations/GetLoanSummaryRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetLoanSummaryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listLoanTransactions + +The *List loan transactions* endpoint returns all [loan transactions](https://docs.codat.io/lending-api#/schemas/LoanTransactions) identified from a company's accounting, banking, and commerce integrations. + +This detail gives analysts a better idea of the loan obligations a company may have. + +Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListLoanTransactionsQueryParamSourceType; +import io.codat.lending.models.operations.ListLoanTransactionsRequest; +import io.codat.lending.models.operations.ListLoanTransactionsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListLoanTransactionsRequest req = ListLoanTransactionsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .sourceType(ListLoanTransactionsQueryParamSourceType.COMMERCE) + .build(); + + ListLoanTransactionsResponse res = sdk.liabilities().listLoanTransactions() + .request(req) + .call(); + + if (res.loanTransactions().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListLoanTransactionsRequest](../../models/operations/ListLoanTransactionsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListLoanTransactionsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/loanwriteback/README.md b/lending/docs/sdks/loanwriteback/README.md new file mode 100644 index 00000000..ee55455c --- /dev/null +++ b/lending/docs/sdks/loanwriteback/README.md @@ -0,0 +1,5 @@ +# LoanWriteback +(*loanWriteback()*) + +### Available Operations + diff --git a/lending/docs/sdks/locations/README.md b/lending/docs/sdks/locations/README.md new file mode 100644 index 00000000..eb9d40fd --- /dev/null +++ b/lending/docs/sdks/locations/README.md @@ -0,0 +1,154 @@ +# Locations +(*sales().locations()*) + +### Available Operations + +* [get](#get) - Get location +* [list](#list) - List locations + +## get + +The *Get location* endpoint returns a single location for a given locationId. + +[Locations](https://docs.codat.io/lending-api#/schemas/Location) hold information on the geographic location at which stocks of [products](https://docs.codat.io/lending-api#/schemas/Product) may be held or where [orders](https://docs.codat.io/lending-api#/schemas/Order) were placed. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-locations) for integrations that support getting a specific location. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceLocationRequest; +import io.codat.lending.models.operations.GetCommerceLocationResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceLocationRequest req = GetCommerceLocationRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .locationId("string") + .build(); + + GetCommerceLocationResponse res = sdk.sales().locations().get() + .request(req) + .call(); + + if (res.commerceLocation().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceLocationRequest](../../models/operations/GetCommerceLocationRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceLocationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List locations* endpoint returns a list of [locations](https://docs.codat.io/lending-api#/schemas/Location) for a given company's connection. + +[Locations](https://docs.codat.io/lending-api#/schemas/Location) hold information on the geographic location at which stocks of [products](https://docs.codat.io/lending-api#/schemas/Product) may be held or where [orders](https://docs.codat.io/lending-api#/schemas/Order) were placed. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceLocationsRequest; +import io.codat.lending.models.operations.ListCommerceLocationsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceLocationsRequest req = ListCommerceLocationsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + ListCommerceLocationsResponse res = sdk.sales().locations().list() + .request(req) + .call(); + + if (res.commerceLocations().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListCommerceLocationsRequest](../../models/operations/ListCommerceLocationsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceLocationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/managedata/README.md b/lending/docs/sdks/managedata/README.md new file mode 100644 index 00000000..ae537d4b --- /dev/null +++ b/lending/docs/sdks/managedata/README.md @@ -0,0 +1,72 @@ +# ManageData +(*manageData()*) + +### Available Operations + +* [getStatus](#getstatus) - Get data status + +## getStatus + +Get the state of each data type for a company + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetDataStatusRequest; +import io.codat.lending.models.operations.GetDataStatusResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetDataStatusRequest req = GetDataStatusRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + GetDataStatusResponse res = sdk.manageData().getStatus() + .request(req) + .call(); + + if (res.dataStatuses().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetDataStatusRequest](../../models/operations/GetDataStatusRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetDataStatusResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/metrics/README.md b/lending/docs/sdks/metrics/README.md new file mode 100644 index 00000000..7a8092ac --- /dev/null +++ b/lending/docs/sdks/metrics/README.md @@ -0,0 +1,300 @@ +# Metrics +(*sales().metrics()*) + +### Available Operations + +* [getCustomerRetention](#getcustomerretention) - Get customer retention metrics +* [getLifetimeValue](#getlifetimevalue) - Get lifetime value metrics +* [getRevenue](#getrevenue) - Get commerce revenue metrics + +## getCustomerRetention + +The *Get customer retention metrics* endpoint returns customer retention insights for a specific company's commerce connection over one or more periods of time. + +This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + +#### Customer retention metrics + +- __Existing customers__: the number of unique customers that have placed an order(s) in the specified period and any previous period. +- __New customers__: the number of unique customers that have placed an order(s) in the specified period and none in any previous period. +- __Total customers__: the total number of existing and new customers within the specified period. +- __Retention rate__: the ratio of existing customers within the specified period compared to the total customers at the end of the previous period represented as a percentage. +- __Repeat rate__: the ratio of existing customers to total customers over the specified period represented as a percentage. + +Learn more about the formulas used to calculate customer retention metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + +#### Response structure + +The Customer retention report's dimensions and measures are: + +| Index | Dimensions | +|-----------------------------|----------------------------| +| `index` = 0 | Period | +| `index` = 1 | Customer retention metrics | + +| Index | Measures | +|----------------------|------------| +| `index` = 0 | Count | +| `index` = 1 | Percentage | + +The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest; +import io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.PeriodUnit; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceCustomerRetentionMetricsRequest req = GetCommerceCustomerRetentionMetricsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .numberOfPeriods(497588L) + .periodLength(613110L) + .periodUnit(PeriodUnit.WEEK) + .reportDate("29-09-2020") + .includeDisplayNames(false) + .build(); + + GetCommerceCustomerRetentionMetricsResponse res = sdk.sales().metrics().getCustomerRetention() + .request(req) + .call(); + + if (res.commerceReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest](../../models/operations/GetCommerceCustomerRetentionMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceCustomerRetentionMetricsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getLifetimeValue + +The *Get lifetime value metrics* endpoint returns the average revenue that a specific company will generate throughout its lifespan over one or more periods of time. + +This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + +Learn more about the formulas used to calculate the lifetime value metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + +Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more detail on commerce reports in Lending. + +#### Response structure + +The Lifetime value report's dimensions and measures are: + +| Index | Dimensions | +|---------------|------------------------| +| `index` = 0 | Period | +| `index` = 1 | Lifetime value metrics | + +| Index | Measures | +|-------------------|---------| +| `index` = 1 | Value | + +The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest; +import io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.PeriodUnit; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceLifetimeValueMetricsRequest req = GetCommerceLifetimeValueMetricsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .numberOfPeriods(900865L) + .periodLength(614777L) + .periodUnit(PeriodUnit.MONTH) + .reportDate("29-09-2020") + .includeDisplayNames(false) + .build(); + + GetCommerceLifetimeValueMetricsResponse res = sdk.sales().metrics().getLifetimeValue() + .request(req) + .call(); + + if (res.commerceReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest](../../models/operations/GetCommerceLifetimeValueMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceLifetimeValueMetricsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getRevenue + +The *Get revenue report* endpoint returns the revenue and revenue growth for a specific company connection over one or more periods of time. + +This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + +Learn more about the formulas used to calculate the revenue metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + +Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + +#### Response structure + +The Revenue report's dimensions and measures are: + +| Index | Dimensions | +|---------------|------------| +| `index` = 0 | Period | +| `index` = 1 | Revenue | + +| Index | Measures | +|---------------|--------------------------------------------------------------------------------------------------------------------------| +| `index` = 0 | Value | +| `index` = 1 | Percentage change, defined as the change between the current and previous periods' values and expressed as a percentage. | + +The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest; +import io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.PeriodUnit; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceRevenueMetricsRequest req = GetCommerceRevenueMetricsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .numberOfPeriods(307462L) + .periodLength(944219L) + .periodUnit(PeriodUnit.DAY) + .reportDate("29-09-2020") + .includeDisplayNames(false) + .build(); + + GetCommerceRevenueMetricsResponse res = sdk.sales().metrics().getRevenue() + .request(req) + .call(); + + if (res.commerceReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest](../../models/operations/GetCommerceRevenueMetricsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceRevenueMetricsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/orders/README.md b/lending/docs/sdks/orders/README.md new file mode 100644 index 00000000..7b94de11 --- /dev/null +++ b/lending/docs/sdks/orders/README.md @@ -0,0 +1,158 @@ +# Orders +(*sales().orders()*) + +### Available Operations + +* [get](#get) - Get order +* [list](#list) - List orders + +## get + +The *Get order* endpoint returns a single order for a given orderId. + +[Orders](https://docs.codat.io/lending-api#/schemas/Order) contain the transaction details for all products sold by the company. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-orders) for integrations that support getting a specific order. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceOrderRequest; +import io.codat.lending.models.operations.GetCommerceOrderResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceOrderRequest req = GetCommerceOrderRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderId("string") + .build(); + + GetCommerceOrderResponse res = sdk.sales().orders().get() + .request(req) + .call(); + + if (res.commerceOrder().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceOrderRequest](../../models/operations/GetCommerceOrderRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceOrderResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List orders* endpoint returns a list of [orders](https://docs.codat.io/lending-api#/schemas/Order) for a given company's connection. + +[Orders](https://docs.codat.io/lending-api#/schemas/Order) contain the transaction details for all products sold by the company. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceOrdersRequest; +import io.codat.lending.models.operations.ListCommerceOrdersResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceOrdersRequest req = ListCommerceOrdersRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceOrdersResponse res = sdk.sales().orders().list() + .request(req) + .call(); + + if (res.commerceOrders().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListCommerceOrdersRequest](../../models/operations/ListCommerceOrdersRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceOrdersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/paymentmethods/README.md b/lending/docs/sdks/paymentmethods/README.md new file mode 100644 index 00000000..a9b2db74 --- /dev/null +++ b/lending/docs/sdks/paymentmethods/README.md @@ -0,0 +1,158 @@ +# PaymentMethods +(*sales().paymentMethods()*) + +### Available Operations + +* [get](#get) - Get payment method +* [list](#list) - List payment methods + +## get + +The *Get payment method* endpoint returns a single payment method for a given paymentMethodId. + +[Payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) represent the payment method(s) used to make payments. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-paymentMethods) for integrations that support getting a specific payment method. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommercePaymentMethodRequest; +import io.codat.lending.models.operations.GetCommercePaymentMethodResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommercePaymentMethodRequest req = GetCommercePaymentMethodRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .paymentMethodId("string") + .build(); + + GetCommercePaymentMethodResponse res = sdk.sales().paymentMethods().get() + .request(req) + .call(); + + if (res.commercePaymentMethod().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommercePaymentMethodRequest](../../models/operations/GetCommercePaymentMethodRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommercePaymentMethodResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) for a given company's connection. + +[Payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) represent the payment method(s) used to make payments. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommercePaymentMethodsRequest; +import io.codat.lending.models.operations.ListCommercePaymentMethodsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommercePaymentMethodsRequest req = ListCommercePaymentMethodsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommercePaymentMethodsResponse res = sdk.sales().paymentMethods().list() + .request(req) + .call(); + + if (res.commercePaymentMethods().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCommercePaymentMethodsRequest](../../models/operations/ListCommercePaymentMethodsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommercePaymentMethodsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/payments/README.md b/lending/docs/sdks/payments/README.md new file mode 100644 index 00000000..694d1498 --- /dev/null +++ b/lending/docs/sdks/payments/README.md @@ -0,0 +1,156 @@ +# Payments +(*accountsReceivable().payments()*) + +### Available Operations + +* [get](#get) - Get payment +* [list](#list) - List payments + +## get + +The *Get payment* endpoint returns a single payment for a given paymentId. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support getting a specific payment. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingPaymentRequest; +import io.codat.lending.models.operations.GetAccountingPaymentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingPaymentRequest req = GetAccountingPaymentRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .paymentId("string") + .build(); + + GetAccountingPaymentResponse res = sdk.accountsReceivable().payments().get() + .request(req) + .call(); + + if (res.accountingPayment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingPaymentRequest](../../models/operations/GetAccountingPaymentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingPaymentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + +[Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingPaymentsRequest; +import io.codat.lending.models.operations.ListAccountingPaymentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingPaymentsRequest req = ListAccountingPaymentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingPaymentsResponse res = sdk.accountsReceivable().payments().list() + .request(req) + .call(); + + if (res.accountingPayments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingPaymentsRequest](../../models/operations/ListAccountingPaymentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingPaymentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/productcategories/README.md b/lending/docs/sdks/productcategories/README.md new file mode 100644 index 00000000..9e65776a --- /dev/null +++ b/lending/docs/sdks/productcategories/README.md @@ -0,0 +1,158 @@ +# ProductCategories +(*sales().productCategories()*) + +### Available Operations + +* [get](#get) - Get product category +* [list](#list) - List product categories + +## get + +The *Get product* endpoint returns a single product for a given productId. + +[Product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-productCategories) for integrations that support getting a specific product. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceProductCategoryRequest; +import io.codat.lending.models.operations.GetCommerceProductCategoryResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceProductCategoryRequest req = GetCommerceProductCategoryRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .productId("string") + .build(); + + GetCommerceProductCategoryResponse res = sdk.sales().productCategories().get() + .request(req) + .call(); + + if (res.commerceProductCategory().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCommerceProductCategoryRequest](../../models/operations/GetCommerceProductCategoryRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceProductCategoryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List product categories* endpoint returns a list of [product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) for a given company's connection. + +[Product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceProductCategoriesRequest; +import io.codat.lending.models.operations.ListCommerceProductCategoriesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceProductCategoriesRequest req = ListCommerceProductCategoriesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceProductCategoriesResponse res = sdk.sales().productCategories().list() + .request(req) + .call(); + + if (res.commerceProductCategories().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCommerceProductCategoriesRequest](../../models/operations/ListCommerceProductCategoriesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceProductCategoriesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/products/README.md b/lending/docs/sdks/products/README.md new file mode 100644 index 00000000..720eebbc --- /dev/null +++ b/lending/docs/sdks/products/README.md @@ -0,0 +1,158 @@ +# Products +(*sales().products()*) + +### Available Operations + +* [get](#get) - Get product +* [list](#list) - List products + +## get + +The *Get product* endpoint returns a single product for a given productId. + +[Products](https://docs.codat.io/lending-api#/schemas/Product) are items in the company's inventory that are available for sale. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-products) for integrations that support getting a specific product. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCommerceProductRequest; +import io.codat.lending.models.operations.GetCommerceProductResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCommerceProductRequest req = GetCommerceProductRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .productId("string") + .build(); + + GetCommerceProductResponse res = sdk.sales().products().get() + .request(req) + .call(); + + if (res.commerceProduct().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCommerceProductRequest](../../models/operations/GetCommerceProductRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCommerceProductResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List products* endpoint returns a list of [products](https://docs.codat.io/lending-api#/schemas/Product) for a given company's connection. + +[Products](https://docs.codat.io/lending-api#/schemas/Product) are items in the company's inventory that are available for sale. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListCommerceProductsRequest; +import io.codat.lending.models.operations.ListCommerceProductsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListCommerceProductsRequest req = ListCommerceProductsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListCommerceProductsResponse res = sdk.sales().products().list() + .request(req) + .call(); + + if (res.commerceProducts().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListCommerceProductsRequest](../../models/operations/ListCommerceProductsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListCommerceProductsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/profitandloss/README.md b/lending/docs/sdks/profitandloss/README.md new file mode 100644 index 00000000..db10dae8 --- /dev/null +++ b/lending/docs/sdks/profitandloss/README.md @@ -0,0 +1,146 @@ +# ProfitAndLoss +(*financialStatements().profitAndLoss()*) + +### Available Operations + +* [get](#get) - Get profit and loss +* [getCategorizedAccounts](#getcategorizedaccounts) - Get categorized profit and loss statement + +## get + +Gets the latest profit and loss for a company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingProfitAndLossRequest; +import io.codat.lending.models.operations.GetAccountingProfitAndLossResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingProfitAndLossRequest req = GetAccountingProfitAndLossRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .periodLength(4) + .periodsToCompare(20) + .startMonth("2022-10-23T00:00:00Z") + .build(); + + GetAccountingProfitAndLossResponse res = sdk.financialStatements().profitAndLoss().get() + .request(req) + .call(); + + if (res.accountingProfitAndLossReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingProfitAndLossRequest](../../models/operations/GetAccountingProfitAndLossRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingProfitAndLossResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCategorizedAccounts + +The *Get categorized profit and loss statement* endpoint returns a list of categorized accounts that appear on a company’s Profit and Loss statement. It also includes a balance as of the financial statement date. + +Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest; +import io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCategorizedProfitAndLossStatementRequest req = GetCategorizedProfitAndLossStatementRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .numberOfPeriods(258121L) + .reportDate("29-09-2020") + .build(); + + GetCategorizedProfitAndLossStatementResponse res = sdk.financialStatements().profitAndLoss().getCategorizedAccounts() + .request(req) + .call(); + + if (res.enhancedFinancialReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest](../../models/operations/GetCategorizedProfitAndLossStatementRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCategorizedProfitAndLossStatementResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/pulloperations/README.md b/lending/docs/sdks/pulloperations/README.md new file mode 100644 index 00000000..aca6d4b1 --- /dev/null +++ b/lending/docs/sdks/pulloperations/README.md @@ -0,0 +1,144 @@ +# PullOperations +(*manageData().pullOperations()*) + +### Available Operations + +* [get](#get) - Get pull operation +* [list](#list) - List pull operations + +## get + +Retrieve information about a single dataset or pull operation. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetPullOperationRequest; +import io.codat.lending.models.operations.GetPullOperationResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetPullOperationRequest req = GetPullOperationRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .datasetId("b18d8d81-fd7b-4764-a31e-475cb1f36591") + .build(); + + GetPullOperationResponse res = sdk.manageData().pullOperations().get() + .request(req) + .call(); + + if (res.pullOperation().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetPullOperationRequest](../../models/operations/GetPullOperationRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetPullOperationResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +Gets the pull operation history (datasets) for a given company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListPullOperationsRequest; +import io.codat.lending.models.operations.ListPullOperationsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListPullOperationsRequest req = ListPullOperationsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListPullOperationsResponse res = sdk.manageData().pullOperations().list() + .request(req) + .call(); + + if (res.pullOperations().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListPullOperationsRequest](../../models/operations/ListPullOperationsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListPullOperationsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/refresh/README.md b/lending/docs/sdks/refresh/README.md new file mode 100644 index 00000000..41e20395 --- /dev/null +++ b/lending/docs/sdks/refresh/README.md @@ -0,0 +1,146 @@ +# Refresh +(*manageData().refresh()*) + +### Available Operations + +* [allDataTypes](#alldatatypes) - Refresh all data +* [dataType](#datatype) - Refresh data type + +## allDataTypes + +Refreshes all data types with `fetch on first link` set to `true` for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.RefreshAllDataTypesRequest; +import io.codat.lending.models.operations.RefreshAllDataTypesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + RefreshAllDataTypesRequest req = RefreshAllDataTypesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + RefreshAllDataTypesResponse res = sdk.manageData().refresh().allDataTypes() + .request(req) + .call(); + + // handle response + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.RefreshAllDataTypesRequest](../../models/operations/RefreshAllDataTypesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/RefreshAllDataTypesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## dataType + +Refreshes a given data type for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.RefreshDataTypeRequest; +import io.codat.lending.models.operations.RefreshDataTypeResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.SchemaDataType; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + RefreshDataTypeRequest req = RefreshDataTypeRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .dataType(SchemaDataType.INVOICES) + .connectionId("34f47fda-384b-4d2f-a80b-311909008b33") + .build(); + + RefreshDataTypeResponse res = sdk.manageData().refresh().dataType() + .request(req) + .call(); + + if (res.pullOperation().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.RefreshDataTypeRequest](../../models/operations/RefreshDataTypeRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/RefreshDataTypeResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/reports/README.md b/lending/docs/sdks/reports/README.md new file mode 100644 index 00000000..c04371e1 --- /dev/null +++ b/lending/docs/sdks/reports/README.md @@ -0,0 +1,279 @@ +# Reports +(*accountsReceivable().reports()*) + +### Available Operations + +* [getAgedCreditors](#getagedcreditors) - Aged creditors report +* [getAgedDebtors](#getageddebtors) - Aged debtors report +* [isAgedCreditorsAvailable](#isagedcreditorsavailable) - Aged creditors report available +* [isAgedDebtorsAvailable](#isageddebtorsavailable) - Aged debtors report available + +## getAgedCreditors + +Returns aged creditors report for company that shows the total balance owed by a business to its suppliers over time. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest; +import io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingAgedCreditorsReportRequest req = GetAccountingAgedCreditorsReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .numberOfPeriods(12) + .periodLengthDays(30) + .reportDate(LocalDate.parse("2022-12-31")) + .build(); + + GetAccountingAgedCreditorsReportResponse res = sdk.accountsReceivable().reports().getAgedCreditors() + .request(req) + .call(); + + if (res.accountingAgedCreditorReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest](../../models/operations/GetAccountingAgedCreditorsReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingAgedCreditorsReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAgedDebtors + +Returns aged debtors report for company that shows the total outstanding balance due from customers to the business over time. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest; +import io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingAgedDebtorsReportRequest req = GetAccountingAgedDebtorsReportRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .numberOfPeriods(12) + .periodLengthDays(30) + .reportDate(LocalDate.parse("2022-12-31")) + .build(); + + GetAccountingAgedDebtorsReportResponse res = sdk.accountsReceivable().reports().getAgedDebtors() + .request(req) + .call(); + + if (res.accountingAgedDebtorReport().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest](../../models/operations/GetAccountingAgedDebtorsReportRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingAgedDebtorsReportResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## isAgedCreditorsAvailable + +Indicates whether the aged creditor report is available for the company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequest; +import io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + IsAgedCreditorsReportAvailableRequest req = IsAgedCreditorsReportAvailableRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + IsAgedCreditorsReportAvailableResponse res = sdk.accountsReceivable().reports().isAgedCreditorsAvailable() + .request(req) + .call(); + + if (res.boolean_().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequest](../../models/operations/IsAgedCreditorsReportAvailableRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/IsAgedCreditorsReportAvailableResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## isAgedDebtorsAvailable + +Indicates whether the aged debtors report is available for the company. + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequest; +import io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + IsAgedDebtorsReportAvailableRequest req = IsAgedDebtorsReportAvailableRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .build(); + + IsAgedDebtorsReportAvailableResponse res = sdk.accountsReceivable().reports().isAgedDebtorsAvailable() + .request(req) + .call(); + + if (res.boolean_().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequest](../../models/operations/IsAgedDebtorsReportAvailableRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/IsAgedDebtorsReportAvailableResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/sales/README.md b/lending/docs/sdks/sales/README.md new file mode 100644 index 00000000..467e34c3 --- /dev/null +++ b/lending/docs/sdks/sales/README.md @@ -0,0 +1,5 @@ +# Sales +(*sales()*) + +### Available Operations + diff --git a/lending/docs/sdks/suppliers/README.md b/lending/docs/sdks/suppliers/README.md new file mode 100644 index 00000000..64690b2b --- /dev/null +++ b/lending/docs/sdks/suppliers/README.md @@ -0,0 +1,380 @@ +# Suppliers +(*accountsPayable().suppliers()*) + +### Available Operations + +* [downloadAttachment](#downloadattachment) - Download supplier attachment +* [get](#get) - Get supplier +* [getAttachment](#getattachment) - Get supplier attachment +* [list](#list) - List suppliers +* [listAttachments](#listattachments) - List supplier attachments + +## downloadAttachment + +The *Download supplier attachment* endpoint downloads a specific attachment for a given `supplierId` and `attachmentId`. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support downloading a supplier attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequest; +import io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + DownloadAccountingSupplierAttachmentRequest req = DownloadAccountingSupplierAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .supplierId("string") + .build(); + + DownloadAccountingSupplierAttachmentResponse res = sdk.accountsPayable().suppliers().downloadAttachment() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequest](../../models/operations/DownloadAccountingSupplierAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/DownloadAccountingSupplierAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## get + +The *Get supplier* endpoint returns a single supplier for a given supplierId. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingSupplierRequest; +import io.codat.lending.models.operations.GetAccountingSupplierResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingSupplierRequest req = GetAccountingSupplierRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .supplierId("string") + .build(); + + GetAccountingSupplierResponse res = sdk.accountsPayable().suppliers().get() + .request(req) + .call(); + + if (res.accountingSupplier().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingSupplierRequest](../../models/operations/GetAccountingSupplierRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingSupplierResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getAttachment + +The *Get supplier attachment* endpoint returns a specific attachment for a given `supplierId` and `attachmentId`. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a supplier attachment. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequest; +import io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetAccountingSupplierAttachmentRequest req = GetAccountingSupplierAttachmentRequest.builder() + .attachmentId("8a210b68-6988-11ed-a1eb-0242ac120002") + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .supplierId("string") + .build(); + + GetAccountingSupplierAttachmentResponse res = sdk.accountsPayable().suppliers().getAttachment() + .request(req) + .call(); + + if (res.accountingAttachment().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequest](../../models/operations/GetAccountingSupplierAttachmentRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetAccountingSupplierAttachmentResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingSuppliersRequest; +import io.codat.lending.models.operations.ListAccountingSuppliersResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingSuppliersRequest req = ListAccountingSuppliersRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListAccountingSuppliersResponse res = sdk.accountsPayable().suppliers().list() + .request(req) + .call(); + + if (res.accountingSuppliers().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListAccountingSuppliersRequest](../../models/operations/ListAccountingSuppliersRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingSuppliersResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## listAttachments + +The *List supplier attachments* endpoint returns a list of attachments available to download for given `supplierId`. + +[Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support listing supplier attachments. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequest; +import io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListAccountingSupplierAttachmentsRequest req = ListAccountingSupplierAttachmentsRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .supplierId("string") + .build(); + + ListAccountingSupplierAttachmentsResponse res = sdk.accountsPayable().suppliers().listAttachments() + .request(req) + .call(); + + if (res.attachments().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequest](../../models/operations/ListAccountingSupplierAttachmentsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListAccountingSupplierAttachmentsResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/transactioncategories/README.md b/lending/docs/sdks/transactioncategories/README.md new file mode 100644 index 00000000..7094587b --- /dev/null +++ b/lending/docs/sdks/transactioncategories/README.md @@ -0,0 +1,158 @@ +# TransactionCategories +(*banking().transactionCategories()*) + +### Available Operations + +* [get](#get) - Get transaction category +* [list](#list) - List transaction categories + +## get + +The *Get transaction category* endpoint returns a single transaction category for a given transactionCategoryId. + +[Transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) are associated with a transaction to provide greater contextual meaning to transaction activity. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactionCategories) for integrations that support getting a specific transaction category. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetBankingTransactionCategoryRequest; +import io.codat.lending.models.operations.GetBankingTransactionCategoryResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetBankingTransactionCategoryRequest req = GetBankingTransactionCategoryRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .transactionCategoryId("string") + .build(); + + GetBankingTransactionCategoryResponse res = sdk.banking().transactionCategories().get() + .request(req) + .call(); + + if (res.bankingTransactionCategory().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetBankingTransactionCategoryRequest](../../models/operations/GetBankingTransactionCategoryRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetBankingTransactionCategoryResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## list + +The *List transaction categories* endpoint returns a list of [transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) for a given company's connection. + +[Transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) are associated with a transaction to provide greater contextual meaning to transaction activity. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest; +import io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + ListBankingTransactionCategoriesRequest req = ListBankingTransactionCategoriesRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .orderBy("-modifiedDate") + .page(1) + .pageSize(100) + .query("string") + .build(); + + ListBankingTransactionCategoriesResponse res = sdk.banking().transactionCategories().list() + .request(req) + .call(); + + if (res.bankingTransactionCategories().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest](../../models/operations/ListBankingTransactionCategoriesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/ListBankingTransactionCategoriesResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/docs/sdks/transactions/README.md b/lending/docs/sdks/transactions/README.md new file mode 100644 index 00000000..b215772b --- /dev/null +++ b/lending/docs/sdks/transactions/README.md @@ -0,0 +1,5 @@ +# Transactions +(*transactions()*) + +### Available Operations + diff --git a/lending/docs/sdks/transfers/README.md b/lending/docs/sdks/transfers/README.md new file mode 100644 index 00000000..2101a271 --- /dev/null +++ b/lending/docs/sdks/transfers/README.md @@ -0,0 +1,213 @@ +# Transfers +(*loanWriteback().transfers()*) + +### Available Operations + +* [create](#create) - Create transfer +* [getCreateModel](#getcreatemodel) - Get create transfer model + +## create + +The *Create transfer* endpoint creates a new [transfer](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company's connection. + +[Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create transfer model](https://docs.codat.io/lending-api#/operations/get-create-transfers-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating an account. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.CreateTransferRequest; +import io.codat.lending.models.operations.CreateTransferResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.AccountRef; +import io.codat.lending.models.shared.AccountingTransfer; +import io.codat.lending.models.shared.ContactRef; +import io.codat.lending.models.shared.ContactRefDataType; +import io.codat.lending.models.shared.Metadata; +import io.codat.lending.models.shared.RecordRef; +import io.codat.lending.models.shared.Security; +import io.codat.lending.models.shared.SupplementalData; +import io.codat.lending.models.shared.TrackingCategoryRef; +import io.codat.lending.models.shared.TransferAccount; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + CreateTransferRequest req = CreateTransferRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .accountingTransfer(AccountingTransfer.builder() + .contactRef(ContactRef.builder() + .id("string") + .dataType(ContactRefDataType.CUSTOMERS) + .build()) + .date("2022-10-23T00:00:00Z") + .depositedRecordRefs(java.util.List.of( + RecordRef.builder() + .dataType("accountTransaction") + .build())) + .description("Synchronised full-range emulation") + .from(TransferAccount.builder() + .accountRef(AccountRef.builder() + .id("") + .name("string") + .build()) + .amount(1343.65d) + .currency("EUR") + .build()) + .id("") + .metadata(Metadata.builder() + .isDeleted(false) + .build()) + .modifiedDate("2022-10-23T00:00:00Z") + .sourceModifiedDate("2022-10-23T00:00:00Z") + .supplementalData(SupplementalData.builder() + .content(java.util.Map.ofEntries( + entry("key", java.util.Map.ofEntries( + entry("key", "string"))))) + .build()) + .to(TransferAccount.builder() + .accountRef(AccountRef.builder() + .id("") + .name("string") + .build()) + .amount(7964.74d) + .currency("USD") + .build()) + .trackingCategoryRefs(java.util.List.of( + TrackingCategoryRef.builder() + .id("string") + .build())) + .build()) + .allowSyncOnPushComplete(false) + .timeoutInMinutes(951062) + .build(); + + CreateTransferResponse res = sdk.loanWriteback().transfers().create() + .request(req) + .call(); + + if (res.accountingCreateTransferResponse().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.CreateTransferRequest](../../models/operations/CreateTransferRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/CreateTransferResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | + +## getCreateModel + +The *Get create transfer model* endpoint returns the expected data for the request payload when creating a [transfer](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company and integration. + +[Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating a transfer. + + +### Example Usage + +```java +package hello.world; + +import io.codat.lending.CodatLending; +import io.codat.lending.models.operations.*; +import io.codat.lending.models.operations.GetCreateTransfersModelRequest; +import io.codat.lending.models.operations.GetCreateTransfersModelResponse; +import io.codat.lending.models.shared.*; +import io.codat.lending.models.shared.Security; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import static java.util.Map.entry; + +public class Application { + + public static void main(String[] args) { + try { + CodatLending sdk = CodatLending.builder() + .security(Security.builder() + .authHeader("Basic BASE_64_ENCODED(API_KEY)") + .build()) + .build(); + + GetCreateTransfersModelRequest req = GetCreateTransfersModelRequest.builder() + .companyId("8a210b68-6988-11ed-a1eb-0242ac120002") + .connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171") + .build(); + + GetCreateTransfersModelResponse res = sdk.loanWriteback().transfers().getCreateModel() + .request(req) + .call(); + + if (res.pushOption().isPresent()) { + // handle response + } + + } catch (io.codat.lending.models.errors.SDKError e) { + // handle exception + } catch (Exception e) { + // handle exception + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [io.codat.lending.models.operations.GetCreateTransfersModelRequest](../../models/operations/GetCreateTransfersModelRequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[Optional](../../models/operations/GetCreateTransfersModelResponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| models/errorsSDKError | 4xx-5xx | */* | diff --git a/lending/gen.yaml b/lending/gen.yaml index 0338cdaa..fd83f49a 100644 --- a/lending/gen.yaml +++ b/lending/gen.yaml @@ -1,23 +1,34 @@ -configVersion: 1.0.0 -management: - docChecksum: '00000000000000000000000000000000' - docVersion: 2.1.0 - speakeasyVersion: 1.53.0 - generationVersion: 2.58.0 +configVersion: 2.0.0 generation: sdkClassName: CodatLending + usageSnippets: + optionalPropertyRendering: withExample + fixes: + nameResolutionDec2023: false + parameterOrderingFeb2024: false + requestResponseComponentNamesFeb2024: false telemetryEnabled: true java: - version: 0.0.0 - author: Codat - description: Make credit decisions backed by enhanced financials, metrics, reports, - and data integrity features. - maxMethodParams: 0 - groupID: io.codat + version: 1.0.0 artifactID: lending - ossrhURL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - githubURL: github.com/codatio/client-sdk-java/lending + author: Codat + companyEmail: support@codat.io companyName: Codat companyURL: https://www.codat.io/ - companyEmail: support@codat.io + description: Make credit decisions backed by enhanced financials, metrics, reports, and data integrity features. + githubURL: github.com/codatio/client-sdk-java/lending + groupID: io.codat + imports: + option: openapi + paths: + callbacks: models/callbacks + errors: models/errors + operations: models/operations + shared: models/shared + webhooks: models/webhooks + inputModelSuffix: input + maxMethodParams: 0 + ossrhURL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + outputModelSuffix: output + projectName: openapi templateVersion: v2 diff --git a/lending/gradle/wrapper/gradle-wrapper.jar b/lending/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..d64cd491 Binary files /dev/null and b/lending/gradle/wrapper/gradle-wrapper.jar differ diff --git a/lending/gradle/wrapper/gradle-wrapper.properties b/lending/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..1af9e093 --- /dev/null +++ b/lending/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/lending/gradlew b/lending/gradlew new file mode 100755 index 00000000..1aa94a42 --- /dev/null +++ b/lending/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/lending/gradlew.bat b/lending/gradlew.bat new file mode 100755 index 00000000..6689b85b --- /dev/null +++ b/lending/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lending/lib/build.gradle b/lending/lib/build.gradle new file mode 100644 index 00000000..f58dbd5c --- /dev/null +++ b/lending/lib/build.gradle @@ -0,0 +1,120 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * This generated file contains a sample Java library project to get you started. + * For more details take a look at the 'Building Java and JVM projects' chapter in the Gradle + * User Manual available at https://docs.gradle.org/7.5.1/userguide/building_java_projects.html + */ + +plugins { + // Apply the java-library plugin for API and implementation separation. + id 'java-library' + id 'maven-publish' + id 'signing' +} + +compileJava.options.encoding = "UTF-8" +compileTestJava.options.encoding = "UTF-8" + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + withSourcesJar() + withJavadocJar() +} + +model { + tasks.generatePomFileForMavenPublication { + destination = file("$buildDir/pom.xml") + } +} + +jar { + dependsOn(":$project.name:generatePomFileForMavenPublication") + into("META-INF/maven/io.codat/lending") { + from("$buildDir/pom.xml") + } +} + +publishing { + repositories { + maven { + name = "OSSRH" + url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } + publications { + maven(MavenPublication) { + groupId = 'io.codat' + artifactId = 'lending' + version = '0.1.0' + + from components.java + + pom { + name = 'Codat Java SDK' + description = 'SDK enabling Java developers to easily integrate with the Codat API.' + url = 'https://github.com/codatio/client-sdk-java/lending' + scm { + url = 'github.com/codatio/client-sdk-java/lending' + connection = 'scm:git:ssh://git@github.com/codatio/client-sdk-java/lending.git' + } + licenses { + license { + name = 'The MIT License (MIT)' + url = 'https://mit-license.org/' + } + } + developers { + developer { + name = 'Codat' + organization = 'Codat' + email = 'support@codat.io' + } + } + organization { + name = 'Codat' + url = 'https://www.codat.io/' + } + } + } + } +} + +if (!project.hasProperty('skip.signing')) { + signing { + def signingKey = findProperty("signingKey") + def signingPassphrase = findProperty("signingPassphrase") + useInMemoryPgpKeys(signingKey, signingPassphrase) + sign publishing.publications.maven + } +} + +javadoc { + options.encoding = "UTF-8" + + if(JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) + } + options.addStringOption('Xdoclint:none', '-quiet') +} + +dependencies { + implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.16.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + 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/lending/lib/src/main/java/io/codat/lending/AccountBalances.java b/lending/lib/src/main/java/io/codat/lending/AccountBalances.java new file mode 100644 index 00000000..a36c8c20 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/AccountBalances.java @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class AccountBalances implements + MethodCallListBankingAccountBalances { + + private final SDKConfiguration sdkConfiguration; + + AccountBalances(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.ListBankingAccountBalancesRequestBuilder list() { + return new io.codat.lending.models.operations.ListBankingAccountBalancesRequestBuilder(this); + } + + /** + * List account balances + * The *List account balances* endpoint returns a list of [account balances](https://docs.codat.io/lending-api#/schemas/AccountBalance) for a given company's connection. + * + * [Account balances](https://docs.codat.io/lending-api#/schemas/AccountBalance) are balances for a bank account, including end-of-day batch balance or running balances per transaction. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListBankingAccountBalancesResponse list( + io.codat.lending.models.operations.ListBankingAccountBalancesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListBankingAccountBalancesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListBankingAccountBalancesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListBankingAccountBalancesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListBankingAccountBalancesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListBankingAccountBalancesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingAccountBalances out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingAccountBalances(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/AccountTransactions.java b/lending/lib/src/main/java/io/codat/lending/AccountTransactions.java new file mode 100644 index 00000000..904cabee --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/AccountTransactions.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class AccountTransactions implements + MethodCallGetAccountingAccountTransaction, + MethodCallListAccountingAccountTransactions { + + private final SDKConfiguration sdkConfiguration; + + AccountTransactions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingAccountTransactionRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingAccountTransactionRequestBuilder(this); + } + + /** + * Get account transaction + * The *Get account transaction* endpoint returns a single account transaction for a given accountTransactionId. + * + * [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions) for integrations that support getting a specific account transaction. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingAccountTransactionResponse get( + io.codat.lending.models.operations.GetAccountingAccountTransactionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingAccountTransactionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingAccountTransactionResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingAccountTransactionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingAccountTransactionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAccountTransaction out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAccountTransaction(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingAccountTransactionsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingAccountTransactionsRequestBuilder(this); + } + + /** + * List account transactions + * The *List account transactions* endpoint returns a list of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) for a given company's connection. + * + * [Account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction) represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse list( + io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/accountTransactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAccountTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAccountTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Accounts.java b/lending/lib/src/main/java/io/codat/lending/Accounts.java new file mode 100644 index 00000000..97649394 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Accounts.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Accounts implements + MethodCallGetAccountingBankAccount, + MethodCallListAccountingBankAccounts { + + private final SDKConfiguration sdkConfiguration; + + Accounts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingBankAccountRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingBankAccountRequestBuilder(this); + } + + /** + * Get bank account + * The *Get bank account* endpoint returns a single account for a given accountId. + * + * [Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support getting a specific bank account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingBankAccountResponse get( + io.codat.lending.models.operations.GetAccountingBankAccountRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBankAccountRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBankAccountResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBankAccountResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBankAccountResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBankAccount out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBankAccount(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingBankAccountsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingBankAccountsRequestBuilder(this); + } + + /** + * List bank accounts + * The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection. + * + * [Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingBankAccountsResponse list( + io.codat.lending.models.operations.ListAccountingBankAccountsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBankAccountsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingBankAccountsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBankAccountsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBankAccountsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBankAccountsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBankAccounts out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBankAccounts(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/AccountsPayable.java b/lending/lib/src/main/java/io/codat/lending/AccountsPayable.java new file mode 100644 index 00000000..dbf075f1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/AccountsPayable.java @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class AccountsPayable { + + private final SDKConfiguration sdkConfiguration; + private final Bills bills; + private final Suppliers suppliers; + private final BillCreditNotes billCreditNotes; + private final BillPayments billPayments; + + AccountsPayable(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.bills = new Bills(this.sdkConfiguration); + this.suppliers = new Suppliers(this.sdkConfiguration); + this.billCreditNotes = new BillCreditNotes(this.sdkConfiguration); + this.billPayments = new BillPayments(this.sdkConfiguration); + } + + public final Bills bills() { + return bills; + } + + public final Suppliers suppliers() { + return suppliers; + } + + public final BillCreditNotes billCreditNotes() { + return billCreditNotes; + } + + public final BillPayments billPayments() { + return billPayments; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/AccountsReceivable.java b/lending/lib/src/main/java/io/codat/lending/AccountsReceivable.java new file mode 100644 index 00000000..e7a9a324 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/AccountsReceivable.java @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class AccountsReceivable { + + private final SDKConfiguration sdkConfiguration; + private final Customers customers; + private final DirectIncomes directIncomes; + private final Invoices invoices; + private final CreditNotes creditNotes; + private final Payments payments; + private final Reports reports; + + AccountsReceivable(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.customers = new Customers(this.sdkConfiguration); + this.directIncomes = new DirectIncomes(this.sdkConfiguration); + this.invoices = new Invoices(this.sdkConfiguration); + this.creditNotes = new CreditNotes(this.sdkConfiguration); + this.payments = new Payments(this.sdkConfiguration); + this.reports = new Reports(this.sdkConfiguration); + } + + public final Customers customers() { + return customers; + } + + public final DirectIncomes directIncomes() { + return directIncomes; + } + + public final Invoices invoices() { + return invoices; + } + + public final CreditNotes creditNotes() { + return creditNotes; + } + + public final Payments payments() { + return payments; + } + + public final Reports reports() { + return reports; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/BalanceSheet.java b/lending/lib/src/main/java/io/codat/lending/BalanceSheet.java new file mode 100644 index 00000000..3e34b3ed --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/BalanceSheet.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class BalanceSheet implements + MethodCallGetAccountingBalanceSheet, + MethodCallGetCategorizedBalanceSheetStatement { + + private final SDKConfiguration sdkConfiguration; + + BalanceSheet(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingBalanceSheetRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingBalanceSheetRequestBuilder(this); + } + + /** + * Get balance sheet + * Gets the latest balance sheet for a company. + * @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 io.codat.lending.models.operations.GetAccountingBalanceSheetResponse get( + io.codat.lending.models.operations.GetAccountingBalanceSheetRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBalanceSheetRequest.class, + baseUrl, + "/companies/{companyId}/data/financials/balanceSheet", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingBalanceSheetRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBalanceSheetResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBalanceSheetResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBalanceSheetResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBalanceSheet out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBalanceSheet(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequestBuilder getCategorizedAccounts() { + return new io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequestBuilder(this); + } + + /** + * Get categorized balance sheet statement + * The *Get categorized balance sheet statement* endpoint returns a list of categorized accounts that appear on a company’s Balance Sheet along with a balance per financial statement date. + * + * Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. + * @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 io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse getCategorizedAccounts( + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest.class, + baseUrl, + "/companies/{companyId}/reports/enhancedBalanceSheet/accounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.EnhancedFinancialReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withEnhancedFinancialReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/BankAccounts.java b/lending/lib/src/main/java/io/codat/lending/BankAccounts.java new file mode 100644 index 00000000..b3acc696 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/BankAccounts.java @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class BankAccounts implements + MethodCallCreateBankAccount, + MethodCallGetCreateUpdateBankAccountsModel { + + private final SDKConfiguration sdkConfiguration; + + BankAccounts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateBankAccountRequestBuilder create() { + return new io.codat.lending.models.operations.CreateBankAccountRequestBuilder(this); + } + + /** + * Create bank account + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection. + * + * [Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/lending-api#/operations/get-create-update-bankAccounts-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + * @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 io.codat.lending.models.operations.CreateBankAccountResponse create( + io.codat.lending.models.operations.CreateBankAccountRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateBankAccountRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountingBankAccount", "json", true); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateBankAccountRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateBankAccountResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateBankAccountResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateBankAccountResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateBankAccountResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateBankAccountResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequestBuilder getCreateUpdateModel() { + return new io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequestBuilder(this); + } + + /** + * Get create/update bank account model + * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company and integration. + * + * [Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + * + * @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 io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse getCreateUpdateModel( + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/BankTransactions.java b/lending/lib/src/main/java/io/codat/lending/BankTransactions.java new file mode 100644 index 00000000..839f9692 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/BankTransactions.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class BankTransactions implements + MethodCallCreateBankTransactions, + MethodCallGetCreateBankTransactionsModel { + + private final SDKConfiguration sdkConfiguration; + + BankTransactions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateBankTransactionsRequestBuilder create() { + return new io.codat.lending.models.operations.CreateBankTransactionsRequestBuilder(this); + } + + /** + * Create bank account transactions + * The *Create bank account transactions* endpoint creates new [bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) for a given company's connection. + * + * [Bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + * + * **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/lending-api#/operations/get-create-bankTransactions-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating a bank account transactions. + * + * @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 io.codat.lending.models.operations.CreateBankTransactionsResponse create( + io.codat.lending.models.operations.CreateBankTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateBankTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountingCreateBankTransactions", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateBankTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateBankTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateBankTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateBankTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateBankTransactionsResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateBankTransactionsResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateBankTransactionsModelRequestBuilder getCreateModel() { + return new io.codat.lending.models.operations.GetCreateBankTransactionsModelRequestBuilder(this); + } + + /** + * Get create bank account 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/lending-api#/schemas/BankTransactions) for a given company and integration. + * + * [Bank account transactions](https://docs.codat.io/lending-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. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support creating an bank transaction. + * + * @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 io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateBankTransactionsModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateBankTransactionsModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Banking.java b/lending/lib/src/main/java/io/codat/lending/Banking.java new file mode 100644 index 00000000..46cbd96f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Banking.java @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Banking { + + private final SDKConfiguration sdkConfiguration; + private final AccountBalances accountBalances; + private final CodatLendingAccounts accounts; + private final TransactionCategories transactionCategories; + private final CodatLendingBankingTransactions transactions; + private final CategorizedStatement categorizedStatement; + + Banking(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.accountBalances = new AccountBalances(this.sdkConfiguration); + this.accounts = new CodatLendingAccounts(this.sdkConfiguration); + this.transactionCategories = new TransactionCategories(this.sdkConfiguration); + this.transactions = new CodatLendingBankingTransactions(this.sdkConfiguration); + this.categorizedStatement = new CategorizedStatement(this.sdkConfiguration); + } + + public final AccountBalances accountBalances() { + return accountBalances; + } + + public final CodatLendingAccounts accounts() { + return accounts; + } + + public final TransactionCategories transactionCategories() { + return transactionCategories; + } + + public final CodatLendingBankingTransactions transactions() { + return transactions; + } + + public final CategorizedStatement categorizedStatement() { + return categorizedStatement; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/BillCreditNotes.java b/lending/lib/src/main/java/io/codat/lending/BillCreditNotes.java new file mode 100644 index 00000000..b80ebd27 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/BillCreditNotes.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class BillCreditNotes implements + MethodCallGetAccountingBillCreditNote, + MethodCallListAccountingBillCreditNotes { + + private final SDKConfiguration sdkConfiguration; + + BillCreditNotes(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingBillCreditNoteRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingBillCreditNoteRequestBuilder(this); + } + + /** + * Get bill credit note + * The *Get bill credit note* endpoint returns a single bill credit note for a given billCreditNoteId. + * + * [Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support getting a specific bill credit note. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse get( + io.codat.lending.models.operations.GetAccountingBillCreditNoteRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBillCreditNoteRequest.class, + baseUrl, + "/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBillCreditNote out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBillCreditNote(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingBillCreditNotesRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingBillCreditNotesRequestBuilder(this); + } + + /** + * List bill credit notes + * The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) for a given company's connection. + * + * [Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse list( + io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest.class, + baseUrl, + "/companies/{companyId}/data/billCreditNotes", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBillCreditNotes out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBillCreditNotes(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/BillPayments.java b/lending/lib/src/main/java/io/codat/lending/BillPayments.java new file mode 100644 index 00000000..598fdd08 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/BillPayments.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class BillPayments implements + MethodCallGetAccountingBillPayment, + MethodCallListAccountingBillPayments { + + private final SDKConfiguration sdkConfiguration; + + BillPayments(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingBillPaymentRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingBillPaymentRequestBuilder(this); + } + + /** + * Get bill payment + * The *Get bill payment* endpoint returns a single bill payment for a given billPaymentId. + * + * [Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support getting a specific bill payment. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingBillPaymentResponse get( + io.codat.lending.models.operations.GetAccountingBillPaymentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBillPaymentRequest.class, + baseUrl, + "/companies/{companyId}/data/billPayments/{billPaymentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBillPaymentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBillPaymentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBillPaymentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBillPayment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBillPayment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingBillPaymentsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingBillPaymentsRequestBuilder(this); + } + + /** + * List bill payments + * The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) for a given company's connection. + * + * [Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingBillPaymentsResponse list( + io.codat.lending.models.operations.ListAccountingBillPaymentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBillPaymentsRequest.class, + baseUrl, + "/companies/{companyId}/data/billPayments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingBillPaymentsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBillPaymentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBillPaymentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBillPaymentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBillPayments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBillPayments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Bills.java b/lending/lib/src/main/java/io/codat/lending/Bills.java new file mode 100644 index 00000000..8bddbe23 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Bills.java @@ -0,0 +1,431 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Bills implements + MethodCallDownloadAccountingBillAttachment, + MethodCallGetAccountingBill, + MethodCallGetAccountingBillAttachment, + MethodCallListAccountingBills, + MethodCallListAccountingBillAttachments { + + private final SDKConfiguration sdkConfiguration; + + Bills(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequestBuilder(this); + } + + /** + * Download bill attachment + * The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + * + * [Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingBillRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingBillRequestBuilder(this); + } + + /** + * Get bill + * The *Get bill* endpoint returns a single bill for a given billId. + * + * [Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingBillResponse get( + io.codat.lending.models.operations.GetAccountingBillRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBillRequest.class, + baseUrl, + "/companies/{companyId}/data/bills/{billId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBillResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBillResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBillResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBill out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBill(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingBillAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingBillAttachmentRequestBuilder(this); + } + + /** + * Get bill attachment + * The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. + * + * [Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingBillAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingBillAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingBillAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingBillAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingBillAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingBillAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingBillsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingBillsRequestBuilder(this); + } + + /** + * List bills + * The *List bills* endpoint returns a list of [bills](https://docs.codat.io/lending-api#/schemas/Bill) for a given company's connection. + * + * [Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingBillsResponse list( + io.codat.lending.models.operations.ListAccountingBillsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBillsRequest.class, + baseUrl, + "/companies/{companyId}/data/bills", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingBillsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBillsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBillsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBillsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBills out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBills(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingBillAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingBillAttachmentsRequestBuilder(this); + } + + /** + * List bill attachments + * The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + * + * [Bills](https://docs.codat.io/lending-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support listing bill attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingBillAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBillAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CashFlow.java b/lending/lib/src/main/java/io/codat/lending/CashFlow.java new file mode 100644 index 00000000..80dd8a1c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CashFlow.java @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CashFlow implements + MethodCallGetAccountingCashFlowStatement { + + private final SDKConfiguration sdkConfiguration; + + CashFlow(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingCashFlowStatementRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingCashFlowStatementRequestBuilder(this); + } + + /** + * Get cash flow statement + * Gets the latest cash flow statement for a company. + * @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 io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse get( + io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest.class, + baseUrl, + "/companies/{companyId}/data/financials/cashFlowStatement", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCashFlowStatement out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCashFlowStatement(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CategorizedStatement.java b/lending/lib/src/main/java/io/codat/lending/CategorizedStatement.java new file mode 100644 index 00000000..68538891 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CategorizedStatement.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CategorizedStatement implements + MethodCallGetCategorizedBankStatement { + + private final SDKConfiguration sdkConfiguration; + + CategorizedStatement(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCategorizedBankStatementRequestBuilder get() { + return new io.codat.lending.models.operations.GetCategorizedBankStatementRequestBuilder(this); + } + + /** + * Get categorized bank statement + * > **Categorization engine** + * > + * > The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source. + * + * The _Get categorized bank statement_ endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources. + * @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 io.codat.lending.models.operations.GetCategorizedBankStatementResponse get( + io.codat.lending.models.operations.GetCategorizedBankStatementRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCategorizedBankStatementRequest.class, + baseUrl, + "/companies/{companyId}/reports/enhancedCashFlow/transactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCategorizedBankStatementRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCategorizedBankStatementResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCategorizedBankStatementResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCategorizedBankStatementResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.EnhancedCashFlowTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withEnhancedCashFlowTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLending.java b/lending/lib/src/main/java/io/codat/lending/CodatLending.java new file mode 100644 index 00000000..58e2948f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLending.java @@ -0,0 +1,458 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.SpeakeasyHTTPClient; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Lending API: Our Lending API helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce platforms they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. + * + * The Lending API is built on top of the latest accounting, commerce, and banking data, providing you with the most important data points you need to get a full picture of SMB creditworthiness and make a comprehensive assessment of your customers. + * + * [Explore product](https://docs.codat.io/lending/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + * + * --- + * + * ## Endpoints + * + * | Endpoints | Description | + * |:---------------------|:-----------------------------------------------------------------------------------------------------------| + * | Companies | Create and manage your SMB users' companies. | + * | Connections | Create new and manage existing data connections for a company. | + * | Bank statements | Retrieve banking data from linked bank accounts. | + * | Sales | Retrieve standardized sales data from a linked commerce platform. | + * | Financial statements | Financial data and reports from a linked accounting platform. | + * | Liabilities | Debt and other liabilities. | + * | Accounts payable | Data from a linked accounting platform representing money the business owes money to its suppliers. | + * | Accounts receivable | Data from a linked accounting platform representing money owed to the business for sold goods or services. | + * | Transactions | Data from a linked accounting platform representing transactions. | + * | Data integrity | Match mutable accounting data with immutable banking data to increase confidence in financial data. | + * | Company info | View company profile from the source platform. | + * | Excel reports | Download reports in Excel format. | + * | Categories | Manage Codat's automatic account categorization functionality. | + * | Manage data | Control how data is retrieved from an integration. | + * | File upload | Endpoints to manage uploaded files. | + */ +public class CodatLending { + /** + * SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] SERVERS = { + /** + * Production + */ + "https://api.codat.io", + }; + + /** + * Create and manage your Codat companies. + */ + private final Companies companies; + + /** + * Manage your companies' data connections. + */ + private final Connections connections; + + private final Transactions transactions; + + /** + * Access bank transactions from an accounting platform. + */ + private final CodatLendingAccountingBankData accountingBankData; + + private final Banking banking; + + private final AccountsPayable accountsPayable; + + private final Sales sales; + + /** + * View company information fetched from the source platform. + */ + private final CompanyInfo companyInfo; + + private final AccountsReceivable accountsReceivable; + + /** + * Endpoints to manage uploaded files. + */ + private final FileUpload fileUpload; + + private final LoanWriteback loanWriteback; + + private final FinancialStatements financialStatements; + + private final ManageData manageData; + + /** + * Debt and other liabilities. + */ + private final Liabilities liabilities; + + /** + * Match mutable accounting data with immutable banking data to increase confidence in financial data. + */ + private final DataIntegrity dataIntegrity; + + /** + * Download reports in Excel format. + */ + private final ExcelReports excelReports; + + /** + * Create and manage your Codat companies. + */ + public Companies companies() { + return companies; + } + + /** + * Manage your companies' data connections. + */ + public Connections connections() { + return connections; + } + + public Transactions transactions() { + return transactions; + } + + /** + * Access bank transactions from an accounting platform. + */ + public CodatLendingAccountingBankData accountingBankData() { + return accountingBankData; + } + + public Banking banking() { + return banking; + } + + public AccountsPayable accountsPayable() { + return accountsPayable; + } + + public Sales sales() { + return sales; + } + + /** + * View company information fetched from the source platform. + */ + public CompanyInfo companyInfo() { + return companyInfo; + } + + public AccountsReceivable accountsReceivable() { + return accountsReceivable; + } + + /** + * Endpoints to manage uploaded files. + */ + public FileUpload fileUpload() { + return fileUpload; + } + + public LoanWriteback loanWriteback() { + return loanWriteback; + } + + public FinancialStatements financialStatements() { + return financialStatements; + } + + public ManageData manageData() { + return manageData; + } + + /** + * Debt and other liabilities. + */ + public Liabilities liabilities() { + return liabilities; + } + + /** + * Match mutable accounting data with immutable banking data to increase confidence in financial data. + */ + public DataIntegrity dataIntegrity() { + return dataIntegrity; + } + + /** + * Download reports in Excel format. + */ + public ExcelReports excelReports() { + return excelReports; + } + + private final SDKConfiguration sdkConfiguration; + + /** + * The Builder class allows the configuration of a new instance of the SDK. + */ + public static class Builder { + + private final SDKConfiguration sdkConfiguration = new SDKConfiguration(); + + private Builder() { + } + + /** + * Allows the default HTTP client to be overridden with a custom implementation. + * @param client The HTTP client to use for all requests. + * @return The builder instance. + */ + public Builder client(HTTPClient client) { + this.sdkConfiguration.defaultClient = client; + return this; + } + + /** + * Configures the SDK to use the provided security details. + * @param security The security details to use for all requests. + * @return The builder instance. + */ + public Builder security(io.codat.lending.models.shared.Security security) { + this.sdkConfiguration.securitySource = SecuritySource.of(security); + return this; + } + + public Builder securitySource(SecuritySource securitySource) { + this.sdkConfiguration.securitySource = securitySource; + return this; + } + + /** + * Allows the overriding of the default server URL. + * @param serverUrl The server URL to use for all requests. + * @return The builder instance. + */ + public Builder serverURL(String serverUrl) { + this.sdkConfiguration.serverUrl = serverUrl; + return this; + } + + /** + * Allows the overriding of the default server URL with a templated URL populated with the provided parameters. + * @param serverUrl The server URL to use for all requests. + * @param params The parameters to use when templating the URL. + * @return The builder instance. + */ + public Builder serverURL(String serverUrl, java.util.Map params) { + this.sdkConfiguration.serverUrl = io.codat.lending.utils.Utils.templateUrl(serverUrl, params); + return this; + } + + /** + * Allows the overriding of the default server by index + * @param serverIdx The server to use for all requests. + * @return The builder instance. + */ + public Builder serverIndex(int serverIdx) { + this.sdkConfiguration.serverIdx = serverIdx; + this.sdkConfiguration.serverUrl = SERVERS[serverIdx]; + return this; + } + + /** + * Builds a new instance of the SDK. + * @return The SDK instance. + * @throws Exception Thrown if the SDK could not be built. + */ + public CodatLending build() throws Exception { + if (sdkConfiguration.defaultClient == null) { + sdkConfiguration.defaultClient = new SpeakeasyHTTPClient(); + } + if (sdkConfiguration.securitySource == null) { + sdkConfiguration.securitySource = SecuritySource.of(null); + } + if (sdkConfiguration.serverUrl == null || sdkConfiguration.serverUrl.isBlank()) { + sdkConfiguration.serverUrl = SERVERS[0]; + sdkConfiguration.serverIdx = 0; + } + if (sdkConfiguration.serverUrl.endsWith("/")) { + sdkConfiguration.serverUrl = sdkConfiguration.serverUrl.substring(0, sdkConfiguration.serverUrl.length() - 1); + } + return new CodatLending(sdkConfiguration); + } + } + + /** + * Get a new instance of the SDK builder to configure a new instance of the SDK. + * @return The SDK builder instance. + */ + public static Builder builder() { + return new Builder(); + } + + private CodatLending(SDKConfiguration sdkConfiguration) throws Exception { + this.sdkConfiguration = sdkConfiguration; + this.companies = new Companies(sdkConfiguration); + this.connections = new Connections(sdkConfiguration); + this.transactions = new Transactions(sdkConfiguration); + this.accountingBankData = new CodatLendingAccountingBankData(sdkConfiguration); + this.banking = new Banking(sdkConfiguration); + this.accountsPayable = new AccountsPayable(sdkConfiguration); + this.sales = new Sales(sdkConfiguration); + this.companyInfo = new CompanyInfo(sdkConfiguration); + this.accountsReceivable = new AccountsReceivable(sdkConfiguration); + this.fileUpload = new FileUpload(sdkConfiguration); + this.loanWriteback = new LoanWriteback(sdkConfiguration); + this.financialStatements = new FinancialStatements(sdkConfiguration); + this.manageData = new ManageData(sdkConfiguration); + this.liabilities = new Liabilities(sdkConfiguration); + this.dataIntegrity = new DataIntegrity(sdkConfiguration); + this.excelReports = new ExcelReports(sdkConfiguration); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingAccountingBankData.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingAccountingBankData.java new file mode 100644 index 00000000..6fb89b02 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingAccountingBankData.java @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Access bank transactions from an accounting platform. + */ +public class CodatLendingAccountingBankData implements + MethodCallListAccountingBankAccountTransactions { + + private final SDKConfiguration sdkConfiguration; + private final Accounts accounts; + + CodatLendingAccountingBankData(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.accounts = new Accounts(this.sdkConfiguration); + } + + public final Accounts accounts() { + return accounts; + } + public io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequestBuilder listTransactions() { + return new io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequestBuilder(this); + } + + /** + * List bank account transactions + * The *List account bank transactions* endpoint returns a list of [bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) for a given company's connection. + * + * [Bank account transactions](https://docs.codat.io/lending-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions) for integrations that support listing bank transactions. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse listTransactions( + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}/bankTransactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingBankTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingBankTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingAccounts.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingAccounts.java new file mode 100644 index 00000000..35418053 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingAccounts.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingAccounts implements + MethodCallGetBankingAccount, + MethodCallListBankingAccounts { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingAccounts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetBankingAccountRequestBuilder get() { + return new io.codat.lending.models.operations.GetBankingAccountRequestBuilder(this); + } + + /** + * Get account + * The *Get account* endpoint returns a single account for a given accountId. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are financial accounts maintained by a bank or other financial institution. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-accounts) for integrations that support getting a specific account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetBankingAccountResponse get( + io.codat.lending.models.operations.GetBankingAccountRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetBankingAccountRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-accounts/{accountId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetBankingAccountResponse.Builder resBuilder = + io.codat.lending.models.operations.GetBankingAccountResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetBankingAccountResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingAccount out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingAccount(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListBankingAccountsRequestBuilder list() { + return new io.codat.lending.models.operations.ListBankingAccountsRequestBuilder(this); + } + + /** + * List accounts + * The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are financial accounts maintained by a bank or other financial institution. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListBankingAccountsResponse list( + io.codat.lending.models.operations.ListBankingAccountsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListBankingAccountsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-accounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListBankingAccountsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListBankingAccountsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListBankingAccountsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListBankingAccountsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingAccounts out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingAccounts(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingBankingTransactions.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingBankingTransactions.java new file mode 100644 index 00000000..2915b72f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingBankingTransactions.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingBankingTransactions implements + MethodCallGetBankingTransaction, + MethodCallListBankingTransactions { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingBankingTransactions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetBankingTransactionRequestBuilder get() { + return new io.codat.lending.models.operations.GetBankingTransactionRequestBuilder(this); + } + + /** + * Get bank transaction + * The *Get transaction* endpoint returns a single transaction for a given transactionId. + * + * [Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactions) for integrations that support getting a specific transaction. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetBankingTransactionResponse get( + io.codat.lending.models.operations.GetBankingTransactionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetBankingTransactionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-transactions/{transactionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetBankingTransactionResponse.Builder resBuilder = + io.codat.lending.models.operations.GetBankingTransactionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetBankingTransactionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingTransaction out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingTransaction(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListBankingTransactionsRequestBuilder list() { + return new io.codat.lending.models.operations.ListBankingTransactionsRequestBuilder(this); + } + + /** + * List transactions + * The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. + * + * [Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) provide an immutable source of up-to-date information on income and expenditure. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListBankingTransactionsResponse list( + io.codat.lending.models.operations.ListBankingTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListBankingTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-transactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListBankingTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListBankingTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListBankingTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListBankingTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingCustomers.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingCustomers.java new file mode 100644 index 00000000..5d67bc6b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingCustomers.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingCustomers implements + MethodCallGetCommerceCustomer, + MethodCallListCommerceCustomers { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingCustomers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceCustomerRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceCustomerRequestBuilder(this); + } + + /** + * Get customer + * The *Get customer* endpoint returns a single customer for a given customerId. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that place orders, make payments and receive goods and/or services from the SMB. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-customers) for integrations that support getting a specific customer. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceCustomerResponse get( + io.codat.lending.models.operations.GetCommerceCustomerRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceCustomerRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-customers/{customerId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceCustomerResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceCustomerResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceCustomerResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceCustomer out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceCustomer(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceCustomersRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceCustomersRequestBuilder(this); + } + + /** + * List customers + * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that place orders, make payments and recieve goods and/or services from the SMB. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceCustomersResponse list( + io.codat.lending.models.operations.ListCommerceCustomersRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceCustomersRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-customers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceCustomersRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceCustomersResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceCustomersResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceCustomersResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceCustomers out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceCustomers(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingDirectCosts.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingDirectCosts.java new file mode 100644 index 00000000..794aa1e8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingDirectCosts.java @@ -0,0 +1,431 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingDirectCosts implements + MethodCallDownloadAccountingDirectCostAttachment, + MethodCallGetAccountingDirectCost, + MethodCallGetAccountingDirectCostAttachment, + MethodCallListAccountingDirectCosts, + MethodCallListAccountingDirectCostAttachments { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingDirectCosts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequestBuilder(this); + } + + /** + * Download direct cost attachment + * The *Download direct cost attachment* endpoint downloads a specific attachment for a given `directCostId` and `attachmentId`. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support downloading a direct cost attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingDirectCostRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingDirectCostRequestBuilder(this); + } + + /** + * Get direct cost + * The *Get direct cost* endpoint returns a single direct cost for a given directCostId. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a specific direct cost. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingDirectCostResponse get( + io.codat.lending.models.operations.GetAccountingDirectCostRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingDirectCostRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingDirectCostResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingDirectCostResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingDirectCostResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingDirectCost out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingDirectCost(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequestBuilder(this); + } + + /** + * Get direct cost attachment + * The *Get direct cost attachment* endpoint returns a specific attachment for a given `directCostId` and `attachmentId`. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support getting a direct cost attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingDirectCostsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingDirectCostsRequestBuilder(this); + } + + /** + * List direct costs + * The *List direct costs* endpoint returns a list of [direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company's connection. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingDirectCostsResponse list( + io.codat.lending.models.operations.ListAccountingDirectCostsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingDirectCostsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directCosts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingDirectCostsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingDirectCostsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingDirectCostsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingDirectCostsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingDirectCosts out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingDirectCosts(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequestBuilder(this); + } + + /** + * List direct cost attachments + * The *List direct cost attachments* endpoint returns a list of attachments available to download for given `directCostId`. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support listing direct cost attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingFinancialStatementsAccounts.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingFinancialStatementsAccounts.java new file mode 100644 index 00000000..07716523 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingFinancialStatementsAccounts.java @@ -0,0 +1,195 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingFinancialStatementsAccounts implements + MethodCallGetAccountingAccount, + MethodCallListAccountingAccounts { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingFinancialStatementsAccounts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingAccountRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingAccountRequestBuilder(this); + } + + /** + * Get account + * The *Get account* endpoint returns a single account for a given accountId. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support getting a specific account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingAccountResponse get( + io.codat.lending.models.operations.GetAccountingAccountRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingAccountRequest.class, + baseUrl, + "/companies/{companyId}/data/accounts/{accountId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingAccountResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingAccountResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingAccountResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAccount out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAccount(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingAccountsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingAccountsRequestBuilder(this); + } + + /** + * List accounts + * The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * @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 io.codat.lending.models.operations.ListAccountingAccountsResponse list( + io.codat.lending.models.operations.ListAccountingAccountsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingAccountsRequest.class, + baseUrl, + "/companies/{companyId}/data/accounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingAccountsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingAccountsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingAccountsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingAccountsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAccounts out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAccounts(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingLoanWritebackAccounts.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingLoanWritebackAccounts.java new file mode 100644 index 00000000..b00a0888 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingLoanWritebackAccounts.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingLoanWritebackAccounts implements + MethodCallCreateAccount, + MethodCallGetCreateChartOfAccountsModel { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingLoanWritebackAccounts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateAccountRequestBuilder create() { + return new io.codat.lending.models.operations.CreateAccountRequestBuilder(this); + } + + /** + * Create account + * The *Create account* endpoint creates a new [account](https://docs.codat.io/lending-api#/schemas/Account) for a given company's connection. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.CreateAccountResponse create( + io.codat.lending.models.operations.CreateAccountRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateAccountRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/accounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountPrototype", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateAccountRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateAccountResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateAccountResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateAccountResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateAccountResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateAccountResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequestBuilder getCreateModel() { + return new io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequestBuilder(this); + } + + /** + * Get create account model + * The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/lending-api#/schemas/Account) for a given company and integration. + * + * [Accounts](https://docs.codat.io/lending-api#/schemas/Account) are the categories a business uses to record accounting transactions. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingPayments.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingPayments.java new file mode 100644 index 00000000..8894b84a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingPayments.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingPayments implements + MethodCallCreatePayment, + MethodCallGetCreatePaymentModel { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingPayments(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreatePaymentRequestBuilder create() { + return new io.codat.lending.models.operations.CreatePaymentRequestBuilder(this); + } + + /** + * Create payment + * The *Create payment* endpoint creates a new [payment](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create payment model](https://docs.codat.io/lending-api#/operations/get-create-payments-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.CreatePaymentResponse create( + io.codat.lending.models.operations.CreatePaymentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreatePaymentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/payments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountingPayment", "json", true); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreatePaymentRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreatePaymentResponse.Builder resBuilder = + io.codat.lending.models.operations.CreatePaymentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreatePaymentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreatePaymentResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreatePaymentResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreatePaymentModelRequestBuilder getCreateModel() { + return new io.codat.lending.models.operations.GetCreatePaymentModelRequestBuilder(this); + } + + /** + * Get create payment model + * The *Get create payment model* endpoint returns the expected data for the request payload when creating a [payment](https://docs.codat.io/lending-api#/schemas/Payment) for a given company and integration. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support creating a payment. + * + * @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 io.codat.lending.models.operations.GetCreatePaymentModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreatePaymentModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreatePaymentModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/payments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreatePaymentModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreatePaymentModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreatePaymentModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingReports.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingReports.java new file mode 100644 index 00000000..372d4643 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingReports.java @@ -0,0 +1,238 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingReports implements + MethodCallGetCommerceOrdersReport, + MethodCallGetCommerceRefundsReport { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingReports(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceOrdersReportRequestBuilder getOrders() { + return new io.codat.lending.models.operations.GetCommerceOrdersReportRequestBuilder(this); + } + + /** + * Get orders report + * The *Get orders report* endpoint returns the number of orders, total value, and average order value for a specific company's commerce connection over one or more periods of time. + * + * This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + * + * Learn more about the formulas used to calculate the order metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + * + * Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + * + * #### Response structure + * + * The Orders report's dimensions and measures are: + * + * | Index | Dimensions | + * |---------------|----------------| + * | `index` = 0 | Period | + * | `index` = 1 | Order metrics | + * + * | Index | Measures | + * |---------------|------------| + * | `index` = 0 | Count | + * | `index` = 1 | Value | + * + * The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + * + * @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 io.codat.lending.models.operations.GetCommerceOrdersReportResponse getOrders( + io.codat.lending.models.operations.GetCommerceOrdersReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceOrdersReportRequest.class, + baseUrl, + "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/orders", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCommerceOrdersReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceOrdersReportResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceOrdersReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceOrdersReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCommerceRefundsReportRequestBuilder getRefunds() { + return new io.codat.lending.models.operations.GetCommerceRefundsReportRequestBuilder(this); + } + + /** + * Get refunds report + * The *Get refunds report* endpoint returns the number and total value of refunds and the refund rate for a specific company's commerce connection over one or more periods of time. + * + * This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + * + * Learn more about the formulas used to calculate the refunds metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + * + * Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + * + * #### Response structure + * + * The Refunds report's dimensions and measures are: + * + * | Index | Dimensions | + * |----------------|----------------| + * | `index` = 0 | Period | + * | `index` = 1 | Refund metrics | + * + * | Index | Measures | + * |----------------|------------| + * | `index` = 0 | Count | + * | `index` = 1 | Value | + * | `index` = 2 | Percentage | + * + * The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + * + * @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 io.codat.lending.models.operations.GetCommerceRefundsReportResponse getRefunds( + io.codat.lending.models.operations.GetCommerceRefundsReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceRefundsReportRequest.class, + baseUrl, + "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/refunds", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCommerceRefundsReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceRefundsReportResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceRefundsReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceRefundsReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingSalesPayments.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingSalesPayments.java new file mode 100644 index 00000000..9a4b4077 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingSalesPayments.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingSalesPayments implements + MethodCallGetCommercePayment, + MethodCallListCommercePayments { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingSalesPayments(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommercePaymentRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommercePaymentRequestBuilder(this); + } + + /** + * Get payment + * The *Get payment* endpoint returns a single payment for a given paymentId. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) contain details of all payments made by customers to the company. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-payments) for integrations that support getting a specific payment. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommercePaymentResponse get( + io.codat.lending.models.operations.GetCommercePaymentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommercePaymentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-payments/{paymentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommercePaymentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommercePaymentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommercePaymentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommercePayment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommercePayment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommercePaymentsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommercePaymentsRequestBuilder(this); + } + + /** + * List payments + * The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) contain details of all payments made by customers to the company. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommercePaymentsResponse list( + io.codat.lending.models.operations.ListCommercePaymentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommercePaymentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-payments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommercePaymentsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommercePaymentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommercePaymentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommercePaymentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommercePayments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommercePayments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingSuppliers.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingSuppliers.java new file mode 100644 index 00000000..10b7d0ad --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingSuppliers.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingSuppliers implements + MethodCallCreateSupplier, + MethodCallGetCreateUpdateSuppliersModel { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingSuppliers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateSupplierRequestBuilder create() { + return new io.codat.lending.models.operations.CreateSupplierRequestBuilder(this); + } + + /** + * Create supplier + * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company's connection. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/lending-api#/operations/get-create-update-suppliers-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.CreateSupplierResponse create( + io.codat.lending.models.operations.CreateSupplierRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateSupplierRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/suppliers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountingSupplier", "json", true); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateSupplierRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateSupplierResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateSupplierResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateSupplierResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateSupplierResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateSupplierResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequestBuilder getCreateUpdateModel() { + return new io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequestBuilder(this); + } + + /** + * Get create/update supplier model + * The *Get create/update supplier model* endpoint returns the expected data for the request payload when creating and updating a [supplier](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company and integration. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating and updating a supplier. + * + * @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 io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse getCreateUpdateModel( + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/suppliers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingTransactions.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingTransactions.java new file mode 100644 index 00000000..705e6b04 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingTransactions.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingTransactions implements + MethodCallGetCommerceTransaction, + MethodCallListCommerceTransactions { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingTransactions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceTransactionRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceTransactionRequestBuilder(this); + } + + /** + * Get transaction + * The *Get transaction* endpoint returns a single transaction for a given transactionId. + * + * [Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) detail all financial affairs recorded in the commerce or point of sale system. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-transactions) for integrations that support getting a specific transaction. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceTransactionResponse get( + io.codat.lending.models.operations.GetCommerceTransactionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceTransactionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions/{transactionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceTransactionResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceTransactionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceTransactionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceTransaction out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceTransaction(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceTransactionsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceTransactionsRequestBuilder(this); + } + + /** + * List transactions + * The *List transactions* endpoint returns a list of [transactions](https://docs.codat.io/lending-api#/schemas/Transaction) for a given company's connection. + * + * [Transactions](https://docs.codat.io/lending-api#/schemas/Transaction) detail all financial affairs recorded in the commerce or point of sale system. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceTransactionsResponse list( + io.codat.lending.models.operations.ListCommerceTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-transactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CodatLendingTransfers.java b/lending/lib/src/main/java/io/codat/lending/CodatLendingTransfers.java new file mode 100644 index 00000000..f4c538a9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CodatLendingTransfers.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CodatLendingTransfers implements + MethodCallGetAccountingTransfer, + MethodCallListAccountingTransfers { + + private final SDKConfiguration sdkConfiguration; + + CodatLendingTransfers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingTransferRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingTransferRequestBuilder(this); + } + + /** + * Get transfer + * The *Get transfer* endpoint returns a single transfer for a given transferId. + * + * [Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support getting a specific transfer. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingTransferResponse get( + io.codat.lending.models.operations.GetAccountingTransferRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingTransferRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/transfers/{transferId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingTransferResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingTransferResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingTransferResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingTransfer out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingTransfer(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingTransfersRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingTransfersRequestBuilder(this); + } + + /** + * List transfers + * The *List transfers* endpoint returns a list of [transfers](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company's connection. + * + * [Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingTransfersResponse list( + io.codat.lending.models.operations.ListAccountingTransfersRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingTransfersRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/transfers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingTransfersRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingTransfersResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingTransfersResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingTransfersResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingTransfers out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingTransfers(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Companies.java b/lending/lib/src/main/java/io/codat/lending/Companies.java new file mode 100644 index 00000000..1add743a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Companies.java @@ -0,0 +1,423 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Create and manage your Codat companies. + */ +public class Companies implements + MethodCallCreateCompany, + MethodCallDeleteCompany, + MethodCallGetCompany, + MethodCallListCompanies, + MethodCallUpdateCompany { + + private final SDKConfiguration sdkConfiguration; + + Companies(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateCompanyRequestBuilder create() { + return new io.codat.lending.models.operations.CreateCompanyRequestBuilder(this); + } + + /** + * Create company + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/lending-api#/schemas/Company) that represents your customer in Codat. + * + * A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. + * Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * + * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.CreateCompanyResponse create( + Optional request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + baseUrl, + "/companies"); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "request", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateCompanyResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateCompanyResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateCompanyResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Company out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCompany(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.DeleteCompanyRequestBuilder delete() { + return new io.codat.lending.models.operations.DeleteCompanyRequestBuilder(this); + } + + /** + * Delete a company + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/lending-api#/schemas/Company), its [connections](https://docs.codat.io/lending-api#/schemas/Connection) and any cached data. This operation is irreversible. + * + * A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. + * Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.DeleteCompanyResponse delete( + io.codat.lending.models.operations.DeleteCompanyRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DeleteCompanyRequest.class, + baseUrl, + "/companies/{companyId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("DELETE"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DeleteCompanyResponse.Builder resBuilder = + io.codat.lending.models.operations.DeleteCompanyResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.DeleteCompanyResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 204) { + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCompanyRequestBuilder get() { + return new io.codat.lending.models.operations.GetCompanyRequestBuilder(this); + } + + /** + * Get company + * The *Get company* endpoint returns a single company for a given `companyId`. + * + * A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. + * Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.GetCompanyResponse get( + io.codat.lending.models.operations.GetCompanyRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCompanyRequest.class, + baseUrl, + "/companies/{companyId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCompanyResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCompanyResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCompanyResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Company out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCompany(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCompaniesRequestBuilder list() { + return new io.codat.lending.models.operations.ListCompaniesRequestBuilder(this); + } + + /** + * List companies + * The *List companies* endpoint returns a list of [companies] associated to your instances. + * + * A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. + * Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.ListCompaniesResponse list( + io.codat.lending.models.operations.ListCompaniesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + baseUrl, + "/companies"); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCompaniesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCompaniesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCompaniesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCompaniesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Companies out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCompanies(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.UpdateCompanyRequestBuilder update() { + return new io.codat.lending.models.operations.UpdateCompanyRequestBuilder(this); + } + + /** + * Update company + * Use the *Update company* endpoint to update both the name and description of the company. + * If you use [groups](https://docs.codat.io/lending-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/lending-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/lending-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. + * + * A [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data. + * Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.UpdateCompanyResponse update( + io.codat.lending.models.operations.UpdateCompanyRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.UpdateCompanyRequest.class, + baseUrl, + "/companies/{companyId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("PUT"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "companyRequestBody", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.UpdateCompanyResponse.Builder resBuilder = + io.codat.lending.models.operations.UpdateCompanyResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.UpdateCompanyResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Company out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCompany(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CompanyInfo.java b/lending/lib/src/main/java/io/codat/lending/CompanyInfo.java new file mode 100644 index 00000000..f8c261fb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CompanyInfo.java @@ -0,0 +1,183 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * View company information fetched from the source platform. + */ +public class CompanyInfo implements + MethodCallGetAccountingProfile, + MethodCallGetCommerceProfile { + + private final SDKConfiguration sdkConfiguration; + + CompanyInfo(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingProfileRequestBuilder getAccountingProfile() { + return new io.codat.lending.models.operations.GetAccountingProfileRequestBuilder(this); + } + + /** + * Get company accounting profile + * Gets the latest basic info for a company. + * @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 io.codat.lending.models.operations.GetAccountingProfileResponse getAccountingProfile( + io.codat.lending.models.operations.GetAccountingProfileRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingProfileRequest.class, + baseUrl, + "/companies/{companyId}/data/info", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingProfileResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingProfileResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingProfileResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCompanyInfo out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCompanyInfo(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCommerceProfileRequestBuilder getCommerceProfile() { + return new io.codat.lending.models.operations.GetCommerceProfileRequestBuilder(this); + } + + /** + * Get company commerce profile + * Retrieve information about the company, as seen in the commerce + * platform. + * + * This may include information like addresses, tax registration details and + * social media or website 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 + */ + public io.codat.lending.models.operations.GetCommerceProfileResponse getCommerceProfile( + io.codat.lending.models.operations.GetCommerceProfileRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceProfileRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-info", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceProfileResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceProfileResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceProfileResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceCompanyInfo out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceCompanyInfo(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Connections.java b/lending/lib/src/main/java/io/codat/lending/Connections.java new file mode 100644 index 00000000..1c9b46b2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Connections.java @@ -0,0 +1,410 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Manage your companies' data connections. + */ +public class Connections implements + MethodCallCreateConnection, + MethodCallDeleteConnection, + MethodCallGetConnection, + MethodCallListConnections, + MethodCallUnlinkConnection { + + private final SDKConfiguration sdkConfiguration; + + Connections(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateConnectionRequestBuilder create() { + return new io.codat.lending.models.operations.CreateConnectionRequestBuilder(this); + } + + /** + * Create connection + * Creates a connection for the company by providing a valid `platformKey`. + * + * Use the [List Integrations](https://docs.codat.io/lending-api#/operations/list-integrations) endpoint to access valid platform keys. + * @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 io.codat.lending.models.operations.CreateConnectionResponse create( + io.codat.lending.models.operations.CreateConnectionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateConnectionRequest.class, + baseUrl, + "/companies/{companyId}/connections", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "requestBody", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateConnectionResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateConnectionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateConnectionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Connection out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withConnection(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.DeleteConnectionRequestBuilder delete() { + return new io.codat.lending.models.operations.DeleteConnectionRequestBuilder(this); + } + + /** + * Delete connection + * Revoke and remove a connection from a company. + * This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.DeleteConnectionResponse delete( + io.codat.lending.models.operations.DeleteConnectionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DeleteConnectionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("DELETE"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DeleteConnectionResponse.Builder resBuilder = + io.codat.lending.models.operations.DeleteConnectionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.DeleteConnectionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetConnectionRequestBuilder get() { + return new io.codat.lending.models.operations.GetConnectionRequestBuilder(this); + } + + /** + * Get connection + * Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.GetConnectionResponse get( + io.codat.lending.models.operations.GetConnectionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetConnectionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetConnectionResponse.Builder resBuilder = + io.codat.lending.models.operations.GetConnectionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetConnectionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Connection out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withConnection(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListConnectionsRequestBuilder list() { + return new io.codat.lending.models.operations.ListConnectionsRequestBuilder(this); + } + + /** + * List connections + * List the connections for a company. + * @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 io.codat.lending.models.operations.ListConnectionsResponse list( + io.codat.lending.models.operations.ListConnectionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListConnectionsRequest.class, + baseUrl, + "/companies/{companyId}/connections", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListConnectionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListConnectionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListConnectionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListConnectionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Connections out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withConnections(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.UnlinkConnectionRequestBuilder unlink() { + return new io.codat.lending.models.operations.UnlinkConnectionRequestBuilder(this); + } + + /** + * Unlink connection + * This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.UnlinkConnectionResponse unlink( + io.codat.lending.models.operations.UnlinkConnectionRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.UnlinkConnectionRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("PATCH"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "requestBody", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.UnlinkConnectionResponse.Builder resBuilder = + io.codat.lending.models.operations.UnlinkConnectionResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.UnlinkConnectionResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Connection out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withConnection(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CreateOperations.java b/lending/lib/src/main/java/io/codat/lending/CreateOperations.java new file mode 100644 index 00000000..9ecaedee --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CreateOperations.java @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreateOperations implements + MethodCallGetCreateOperation, + MethodCallListCreateOperations { + + private final SDKConfiguration sdkConfiguration; + + CreateOperations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCreateOperationRequestBuilder get() { + return new io.codat.lending.models.operations.GetCreateOperationRequestBuilder(this); + } + + /** + * Get create operation + * Retrieve create operation. + * @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 io.codat.lending.models.operations.GetCreateOperationResponse get( + io.codat.lending.models.operations.GetCreateOperationRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateOperationRequest.class, + baseUrl, + "/companies/{companyId}/push/{pushOperationKey}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateOperationResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateOperationResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateOperationResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOperation out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOperation(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCreateOperationsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCreateOperationsRequestBuilder(this); + } + + /** + * List create operations + * List create operations. + * @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 io.codat.lending.models.operations.ListCreateOperationsResponse list( + io.codat.lending.models.operations.ListCreateOperationsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCreateOperationsRequest.class, + baseUrl, + "/companies/{companyId}/push", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCreateOperationsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCreateOperationsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCreateOperationsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCreateOperationsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOperations out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOperations(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/CreditNotes.java b/lending/lib/src/main/java/io/codat/lending/CreditNotes.java new file mode 100644 index 00000000..4ac4a042 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/CreditNotes.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class CreditNotes implements + MethodCallGetAccountingCreditNote, + MethodCallListAccountingCreditNotes { + + private final SDKConfiguration sdkConfiguration; + + CreditNotes(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingCreditNoteRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingCreditNoteRequestBuilder(this); + } + + /** + * Get credit note + * The *Get credit note* endpoint returns a single credit note for a given creditNoteId. + * + * [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) are issued to a customer to indicate debt, typically with reference to a previously issued invoice and/or purchase. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=creditNotes) for integrations that support getting a specific credit note. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingCreditNoteResponse get( + io.codat.lending.models.operations.GetAccountingCreditNoteRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingCreditNoteRequest.class, + baseUrl, + "/companies/{companyId}/data/creditNotes/{creditNoteId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingCreditNoteResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingCreditNoteResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingCreditNoteResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreditNote out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreditNote(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingCreditNotesRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingCreditNotesRequestBuilder(this); + } + + /** + * List credit notes + * The *List credit notes* endpoint returns a list of [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) for a given company's connection. + * + * [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) are issued to a customer to indicate debt, typically with reference to a previously issued invoice and/or purchase. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingCreditNotesResponse list( + io.codat.lending.models.operations.ListAccountingCreditNotesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingCreditNotesRequest.class, + baseUrl, + "/companies/{companyId}/data/creditNotes", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingCreditNotesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingCreditNotesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingCreditNotesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingCreditNotesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreditNotes out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreditNotes(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Customers.java b/lending/lib/src/main/java/io/codat/lending/Customers.java new file mode 100644 index 00000000..dda3b10d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Customers.java @@ -0,0 +1,431 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Customers implements + MethodCallDownloadAccountingCustomerAttachment, + MethodCallGetAccountingCustomer, + MethodCallGetAccountingCustomerAttachment, + MethodCallListAccountingCustomers, + MethodCallListAccountingCustomerAttachments { + + private final SDKConfiguration sdkConfiguration; + + Customers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequestBuilder(this); + } + + /** + * Download customer attachment + * The *Download customer attachment* endpoint downloads a specific attachment for a given `customerId` and `attachmentId`. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support downloading a customer attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingCustomerRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingCustomerRequestBuilder(this); + } + + /** + * Get customer + * The *Get customer* endpoint returns a single customer for a given customerId. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a specific customer. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingCustomerResponse get( + io.codat.lending.models.operations.GetAccountingCustomerRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingCustomerRequest.class, + baseUrl, + "/companies/{companyId}/data/customers/{customerId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingCustomerResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingCustomerResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingCustomerResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCustomer out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCustomer(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequestBuilder(this); + } + + /** + * Get customer attachment + * The *Get customer attachment* endpoint returns a specific attachment for a given `customerId` and `attachmentId`. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support getting a customer attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingCustomersRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingCustomersRequestBuilder(this); + } + + /** + * List customers + * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/lending-api#/schemas/Customer) for a given company's connection. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingCustomersResponse list( + io.codat.lending.models.operations.ListAccountingCustomersRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingCustomersRequest.class, + baseUrl, + "/companies/{companyId}/data/customers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingCustomersRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingCustomersResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingCustomersResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingCustomersResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCustomers out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCustomers(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequestBuilder(this); + } + + /** + * List customer attachments + * The *List customer attachments* endpoint returns a list of attachments avialable to download for given `customerId`. + * + * [Customers](https://docs.codat.io/lending-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers) for integrations that support listing customer attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/customers/{customerId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/DataIntegrity.java b/lending/lib/src/main/java/io/codat/lending/DataIntegrity.java new file mode 100644 index 00000000..64870199 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/DataIntegrity.java @@ -0,0 +1,281 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Match mutable accounting data with immutable banking data to increase confidence in financial data. + */ +public class DataIntegrity implements + MethodCallListDataIntegrityDetails, + MethodCallGetDataIntegrityStatus, + MethodCallGetDataIntegritySummaries { + + private final SDKConfiguration sdkConfiguration; + + DataIntegrity(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.ListDataIntegrityDetailsRequestBuilder details() { + return new io.codat.lending.models.operations.ListDataIntegrityDetailsRequestBuilder(this); + } + + /** + * List data integrity details + * The *List data integrity details* endpoint returns the match result record by record for a given data type, filtered based on a query string in the same way as summary results. + * + * The [details](https://docs.codat.io/lending-api#/schemas/DataIntegrityDetails) are paginated and support ordering, following the same conventions as our other data endpoints. + * @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 io.codat.lending.models.operations.ListDataIntegrityDetailsResponse details( + io.codat.lending.models.operations.ListDataIntegrityDetailsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListDataIntegrityDetailsRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/details", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListDataIntegrityDetailsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListDataIntegrityDetailsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListDataIntegrityDetailsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListDataIntegrityDetailsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.DataIntegrityDetails out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withDataIntegrityDetails(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetDataIntegrityStatusRequestBuilder status() { + return new io.codat.lending.models.operations.GetDataIntegrityStatusRequestBuilder(this); + } + + /** + * Get data integrity status + * The *Get data integrity status* endpoint returns the [status](https://docs.codat.io/lending-api#/schemas/DataIntegrityStatus) for the company’s match results between the data type provided in the URL and other data types that Data Integrity uses to support matching. + * This endpoint helps you understand whether match data is available and, if so, how to usefully query it. + * + * The response tells you: + * + * - Whether match results are available. + * - When the results were generated, and their status. + * - The connection IDs, amounts, and dates involved to support useful querying. + * @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 io.codat.lending.models.operations.GetDataIntegrityStatusResponse status( + io.codat.lending.models.operations.GetDataIntegrityStatusRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetDataIntegrityStatusRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/status", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetDataIntegrityStatusResponse.Builder resBuilder = + io.codat.lending.models.operations.GetDataIntegrityStatusResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetDataIntegrityStatusResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.DataIntegrityStatuses out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withDataIntegrityStatuses(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetDataIntegritySummariesRequestBuilder summaries() { + return new io.codat.lending.models.operations.GetDataIntegritySummariesRequestBuilder(this); + } + + /** + * Get data integrity summaries + * The *Get data integrity summary* endpoint returns a [summary](https://docs.codat.io/lending-api#/schemas/DataIntegritySummary) of match results for a given data type filtered by a query string in the [Codat query language](https://docs.codat.io/using-the-api/querying). + * + * For example, if you wanted to see summary match results only for transactions after 1 December 2020, you could include a query parameter of `query=date>2020-12-01`. + * + * The endpoint response includes only the summary results, not transactions. To view match data for transactions, use the [List data integrity details](https://docs.codat.io/lending-api#/operations/list-data-type-data-integrity-details) endpoint. + * @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 io.codat.lending.models.operations.GetDataIntegritySummariesResponse summaries( + io.codat.lending.models.operations.GetDataIntegritySummariesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetDataIntegritySummariesRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/dataTypes/{dataType}/dataIntegrity/summaries", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetDataIntegritySummariesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetDataIntegritySummariesResponse.Builder resBuilder = + io.codat.lending.models.operations.GetDataIntegritySummariesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetDataIntegritySummariesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.DataIntegritySummaries out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withDataIntegritySummaries(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/DirectCosts.java b/lending/lib/src/main/java/io/codat/lending/DirectCosts.java new file mode 100644 index 00000000..de59890c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/DirectCosts.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class DirectCosts implements + MethodCallCreateDirectCost, + MethodCallGetCreateDirectCostsModel { + + private final SDKConfiguration sdkConfiguration; + + DirectCosts(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateDirectCostRequestBuilder create() { + return new io.codat.lending.models.operations.CreateDirectCostRequestBuilder(this); + } + + /** + * Create direct cost + * The *Create direct cost* endpoint creates a new [direct cost](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company's connection. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are the expenses associated with a business' operations. For example, purchases of raw materials that are paid off at the point of the purchase and service fees are considered direct costs. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create direct cost model](https://docs.codat.io/lending-api#/operations/get-create-directCosts-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.CreateDirectCostResponse create( + io.codat.lending.models.operations.CreateDirectCostRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateDirectCostRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/directCosts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "directCostPrototype", "json", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateDirectCostRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateDirectCostResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateDirectCostResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateDirectCostResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateDirectCostResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateDirectCostResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateDirectCostsModelRequestBuilder getCreateModel() { + return new io.codat.lending.models.operations.GetCreateDirectCostsModelRequestBuilder(this); + } + + /** + * Get create direct cost model + * The *Get create direct cost model* endpoint returns the expected data for the request payload when creating a [direct cost](https://docs.codat.io/lending-api#/schemas/DirectCost) for a given company and integration. + * + * [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) are purchases of items that are paid off at the point of the purchase. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts) for integrations that support creating a direct cost. + * + * @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 io.codat.lending.models.operations.GetCreateDirectCostsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateDirectCostsModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateDirectCostsModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/directCosts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateDirectCostsModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateDirectCostsModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateDirectCostsModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/DirectIncomes.java b/lending/lib/src/main/java/io/codat/lending/DirectIncomes.java new file mode 100644 index 00000000..5981e285 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/DirectIncomes.java @@ -0,0 +1,438 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class DirectIncomes implements + MethodCallDownloadAccountingDirectIncomeAttachment, + MethodCallGetAccountingDirectIncome, + MethodCallGetAccountingDirectIncomeAttachment, + MethodCallListAccountingDirectIncomes, + MethodCallListAccountingDirectIncomeAttachments { + + private final SDKConfiguration sdkConfiguration; + + DirectIncomes(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequestBuilder(this); + } + + /** + * Download direct income attachment + * The *Download direct income attachment* endpoint downloads a specific attachment for a given `directIncomeId` and `attachmentId`. + * + * [Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support downloading a direct income attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingDirectIncomeRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingDirectIncomeRequestBuilder(this); + } + + /** + * Get direct income + * The *Get direct income* endpoint returns a single direct income for a given directIncomeId. + * + * [Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support getting a specific direct income. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingDirectIncomeResponse get( + io.codat.lending.models.operations.GetAccountingDirectIncomeRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingDirectIncomeRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingDirectIncomeResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingDirectIncomeResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingDirectIncomeResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingDirectIncome out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingDirectIncome(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequestBuilder(this); + } + + /** + * Get direct income attachment + * The *Get direct income attachment* endpoint returns a specific attachment for a given `directIncomeId` and `attachmentId`. + * + * [Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support getting a direct income attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingDirectIncomesRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingDirectIncomesRequestBuilder(this); + } + + /** + * List direct incomes + * The *List direct incomes* endpoint returns a list of [direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) for a given company's connection. + * + * [Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingDirectIncomesResponse list( + io.codat.lending.models.operations.ListAccountingDirectIncomesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingDirectIncomesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directIncomes", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingDirectIncomesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingDirectIncomesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingDirectIncomesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingDirectIncomesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingDirectIncomes out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingDirectIncomes(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequestBuilder(this); + } + + /** + * List direct income attachments + * The *List direct income attachments* endpoint returns a list of attachments available to download for given `directIncomeId`. + * + * [Direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome) are sales of items directly to a customer where payment is received at the point of the sale. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes) for integrations that support listing direct income attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/directIncomes/{directIncomeId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Disputes.java b/lending/lib/src/main/java/io/codat/lending/Disputes.java new file mode 100644 index 00000000..9fd72346 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Disputes.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Disputes implements + MethodCallGetCommerceDispute, + MethodCallListCommerceDisputes { + + private final SDKConfiguration sdkConfiguration; + + Disputes(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceDisputeRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceDisputeRequestBuilder(this); + } + + /** + * Get dispute + * The *Get dispute* endpoint returns a single dispute for a given disputeId. + * + * [Disputes](https://docs.codat.io/lending-api#/schemas/Dispute) are created when a customer is unsatisfied with their purchase or believe they have been charged incorrectly. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-disputes) for integrations that support getting a specific dispute. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceDisputeResponse get( + io.codat.lending.models.operations.GetCommerceDisputeRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceDisputeRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes/{disputeId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceDisputeResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceDisputeResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceDisputeResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceDispute out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceDispute(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceDisputesRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceDisputesRequestBuilder(this); + } + + /** + * List disputes + * The *List disputes* endpoint returns a list of [disputes](https://docs.codat.io/lending-api#/schemas/Dispute) for a given company's connection. + * + * [Disputes](https://docs.codat.io/lending-api#/schemas/Dispute) are created when a customer is unsatisfied with their purchase or believe they have been charged incorrectly. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceDisputesResponse list( + io.codat.lending.models.operations.ListCommerceDisputesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceDisputesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-disputes", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceDisputesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceDisputesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceDisputesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceDisputesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceDisputes out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceDisputes(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/ExcelReports.java b/lending/lib/src/main/java/io/codat/lending/ExcelReports.java new file mode 100644 index 00000000..014180d0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/ExcelReports.java @@ -0,0 +1,294 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Download reports in Excel format. + */ +public class ExcelReports implements + MethodCallDownloadExcelReport, + MethodCallGenerateExcelReport, + MethodCallGetExcelReportGenerationStatus { + + private final SDKConfiguration sdkConfiguration; + + ExcelReports(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadExcelReportRequestBuilder download() { + return new io.codat.lending.models.operations.DownloadExcelReportRequestBuilder(this); + } + + /** + * Download Excel report + * The *Download Excel report* endpoint downloads the latest successfully generated Excel report of a specified report type for a given company. + * + * The downloadable Excel file is returned in the response. You can save it to your local machine. + * + * You can [learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. + * @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 io.codat.lending.models.operations.DownloadExcelReportResponse download( + io.codat.lending.models.operations.DownloadExcelReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadExcelReportRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/excel/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.DownloadExcelReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadExcelReportResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadExcelReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.DownloadExcelReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GenerateExcelReportRequestBuilder generate() { + return new io.codat.lending.models.operations.GenerateExcelReportRequestBuilder(this); + } + + /** + * Generate Excel report + * The *Generate Excel report* endpoint requests the production of a downloadable Excel file for a report type specified in the `reportType` query parameter. + * + * In response, the endpoint returns the [status](https://docs.codat.io/lending-api#/schemas/ExcelStatus) detailing the current state of the report generation request. + * + * ### Report types + * + * | reportType | Description | + * |--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| + * | [audit](https://docs.codat.io/lending/excel/audit-report) | Identifies inaccurate or out-of-date accounts, helping you to make decisions with confidence. || [audit](https://docs.codat.io/lending/excel/audit-report) | Identify inaccurate or out-of-date accounts, helping you to make decisions with confidence. | + * | [enhancedCashFlow](https://docs.codat.io/lending/excel/enhanced-invoices-report) | Provides a fully categorized list of bank transactions for a company, allowing lenders to accurately forecast a company's cash flow. | + * | [enhancedFinancials](https://docs.codat.io/lending/excel/enhanced-financials-report) | Supports decision-making using fully categorized financial statements to allow lenders to automate their underwriting processes. | + * | [enhancedInvoices](https://docs.codat.io/lending/excel/enhanced-invoices-report) | Helps verify that payments have been made against historic invoices. Great for invoice finance lenders. | + * + * [Learn more](https://docs.codat.io/lending/excel/overview) about valid Excel report types. + * + * + * + * @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 io.codat.lending.models.operations.GenerateExcelReportResponse generate( + io.codat.lending.models.operations.GenerateExcelReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GenerateExcelReportRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/excel", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GenerateExcelReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GenerateExcelReportResponse.Builder resBuilder = + io.codat.lending.models.operations.GenerateExcelReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GenerateExcelReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ExcelStatus out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withExcelStatus(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetExcelReportGenerationStatusRequestBuilder getStatus() { + return new io.codat.lending.models.operations.GetExcelReportGenerationStatusRequestBuilder(this); + } + + /** + * Get Excel report status + * The *Get Excel report status* returns the status of the report mostly recently requested for Excel generation. It does not return the status of any historical report requests. + * + * Poll this endpoint to check the progress of the report once you have requested its generation. This will not affect the generation of the report. + * + * When the report generation completes successfully, the `inProgress` property will be marked as `false` and the `success` field will be marked as `true`. + * @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 io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse getStatus( + io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest.class, + baseUrl, + "/data/companies/{companyId}/assess/excel", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse.Builder resBuilder = + io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ExcelStatus out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withExcelStatus(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/FileUpload.java b/lending/lib/src/main/java/io/codat/lending/FileUpload.java new file mode 100644 index 00000000..0f6ca221 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/FileUpload.java @@ -0,0 +1,260 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Endpoints to manage uploaded files. + */ +public class FileUpload implements + MethodCallDownloadFiles, + MethodCallListFiles, + MethodCallUploadFiles { + + private final SDKConfiguration sdkConfiguration; + + FileUpload(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadFilesRequestBuilder download() { + return new io.codat.lending.models.operations.DownloadFilesRequestBuilder(this); + } + + /** + * Download all files for a company + * The *Download files* endpoint downloads all files that have been uploaded by to SMB to Codat. A `date` may be specified to download any files uploaded on the date provided. + * @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 io.codat.lending.models.operations.DownloadFilesResponse download( + io.codat.lending.models.operations.DownloadFilesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadFilesRequest.class, + baseUrl, + "/companies/{companyId}/files/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.DownloadFilesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadFilesResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadFilesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadFilesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListFilesRequestBuilder listUploaded() { + return new io.codat.lending.models.operations.ListFilesRequestBuilder(this); + } + + /** + * List all files uploaded by a company + * The *List files* endpoint returns a list of all files uploaded to Codat by the SMB. + * @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 io.codat.lending.models.operations.ListFilesResponse listUploaded( + io.codat.lending.models.operations.ListFilesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListFilesRequest.class, + baseUrl, + "/companies/{companyId}/files", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListFilesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListFilesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListFilesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + java.util.List out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference>() {}); + res.withFiles(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.UploadFilesRequestBuilder upload() { + return new io.codat.lending.models.operations.UploadFilesRequestBuilder(this); + } + + /** + * Upload files for a company + * The *Upload files* endpoint uploads multiple files provided by the SMB to Codat. This may include personal identity documents, pitch decks, contracts, or files with accounting and banking data. + * + * Uploaded files must meet the following requirements: + * + * - Up to 20 files can be uploaded at a time. + * - PDF, XLS, XLSX, XLSB, CSV, DOC, DOCX, PPT, PPTX, JPEG, JPG, and PNG files can be uploaded. + * - Each file can be up to 10MB in size. + * @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 io.codat.lending.models.operations.UploadFilesResponse upload( + io.codat.lending.models.operations.UploadFilesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.UploadFilesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/files", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "fileUpload", "multipart", false); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.UploadFilesResponse.Builder resBuilder = + io.codat.lending.models.operations.UploadFilesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.UploadFilesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/FinancialStatements.java b/lending/lib/src/main/java/io/codat/lending/FinancialStatements.java new file mode 100644 index 00000000..cc2bc27f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/FinancialStatements.java @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class FinancialStatements { + + private final SDKConfiguration sdkConfiguration; + private final CodatLendingFinancialStatementsAccounts accounts; + private final BalanceSheet balanceSheet; + private final CashFlow cashFlow; + private final ProfitAndLoss profitAndLoss; + + FinancialStatements(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.accounts = new CodatLendingFinancialStatementsAccounts(this.sdkConfiguration); + this.balanceSheet = new BalanceSheet(this.sdkConfiguration); + this.cashFlow = new CashFlow(this.sdkConfiguration); + this.profitAndLoss = new ProfitAndLoss(this.sdkConfiguration); + } + + public final CodatLendingFinancialStatementsAccounts accounts() { + return accounts; + } + + public final BalanceSheet balanceSheet() { + return balanceSheet; + } + + public final CashFlow cashFlow() { + return cashFlow; + } + + public final ProfitAndLoss profitAndLoss() { + return profitAndLoss; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/Invoices.java b/lending/lib/src/main/java/io/codat/lending/Invoices.java new file mode 100644 index 00000000..10a918fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Invoices.java @@ -0,0 +1,589 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Invoices implements + MethodCallDownloadAccountingInvoiceAttachment, + MethodCallDownloadAccountingInvoicePdf, + MethodCallGetAccountingInvoice, + MethodCallGetAccountingInvoiceAttachment, + MethodCallListAccountingInvoices, + MethodCallListAccountingInvoiceAttachments, + MethodCallListReconciledInvoices { + + private final SDKConfiguration sdkConfiguration; + + Invoices(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequestBuilder(this); + } + + /** + * Download invoice attachment + * The *Download invoice attachment* endpoint downloads a specific attachment for a given `invoiceId` and `attachmentId`. + * + * [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support downloading an invoice attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequestBuilder downloadPdf() { + return new io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequestBuilder(this); + } + + /** + * Get invoice as PDF + * Download invoice as a pdf. + * @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 io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse downloadPdf( + io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequest.class, + baseUrl, + "/companies/{companyId}/data/invoices/{invoiceId}/pdf", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/pdf;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/pdf")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/pdf")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingInvoiceRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingInvoiceRequestBuilder(this); + } + + /** + * Get invoice + * The *Get invoice* endpoint returns a single invoice for a given invoiceId. + * + * [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting a specific invoice. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * @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 io.codat.lending.models.operations.GetAccountingInvoiceResponse get( + io.codat.lending.models.operations.GetAccountingInvoiceRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingInvoiceRequest.class, + baseUrl, + "/companies/{companyId}/data/invoices/{invoiceId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingInvoiceResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingInvoiceResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingInvoiceResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingInvoice out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingInvoice(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequestBuilder(this); + } + + /** + * Get invoice attachment + * The *Get invoice attachment* endpoint returns a specific attachment for a given `invoiceId` and `attachmentId`. + * + * [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support getting an invoice attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingInvoicesRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingInvoicesRequestBuilder(this); + } + + /** + * List invoices + * The *List invoices* endpoint returns a list of [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) for a given company's connection. + * + * [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * ### Useful queries + * + * - Outstanding invoices - `query = amountDue > 0` + * - Invoices due after a certain date: `query = dueDate > 2021-01-28` + * + * [Read more about querying](https://docs.codat.io/using-the-api/querying). + * @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 io.codat.lending.models.operations.ListAccountingInvoicesResponse list( + io.codat.lending.models.operations.ListAccountingInvoicesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingInvoicesRequest.class, + baseUrl, + "/companies/{companyId}/data/invoices", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingInvoicesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingInvoicesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingInvoicesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingInvoicesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingInvoices out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingInvoices(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequestBuilder(this); + } + + /** + * List invoice attachments + * The *List invoice attachments* endpoint returns a list of attachments available to download for given `invoiceId`. + * + * [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) are itemized records of goods sold or services provided to a customer. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices) for integrations that support listing invoice attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/invoices/{invoiceId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListReconciledInvoicesRequestBuilder listReconciled() { + return new io.codat.lending.models.operations.ListReconciledInvoicesRequestBuilder(this); + } + + /** + * List reconciled invoices + * Gets a list of invoices linked to the corresponding banking transaction + * @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 io.codat.lending.models.operations.ListReconciledInvoicesResponse listReconciled( + io.codat.lending.models.operations.ListReconciledInvoicesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListReconciledInvoicesRequest.class, + baseUrl, + "/companies/{companyId}/reports/enhancedInvoices", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListReconciledInvoicesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListReconciledInvoicesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListReconciledInvoicesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListReconciledInvoicesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.EnhancedInvoicesReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withEnhancedInvoicesReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/JournalEntries.java b/lending/lib/src/main/java/io/codat/lending/JournalEntries.java new file mode 100644 index 00000000..e86cc1a4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/JournalEntries.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class JournalEntries implements + MethodCallGetAccountingJournalEntry, + MethodCallListAccountingJournalEntries { + + private final SDKConfiguration sdkConfiguration; + + JournalEntries(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingJournalEntryRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingJournalEntryRequestBuilder(this); + } + + /** + * Get journal entry + * The *Get journal entry* endpoint returns a single journal entry for a given journalEntryId. + * + * [Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support getting a specific journal entry. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingJournalEntryResponse get( + io.codat.lending.models.operations.GetAccountingJournalEntryRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingJournalEntryRequest.class, + baseUrl, + "/companies/{companyId}/data/journalEntries/{journalEntryId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingJournalEntryResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingJournalEntryResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingJournalEntryResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingJournalEntry out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingJournalEntry(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingJournalEntriesRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingJournalEntriesRequestBuilder(this); + } + + /** + * List journal entries + * The *List journal entries* endpoint returns a list of [journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) for a given company's connection. + * + * [Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingJournalEntriesResponse list( + io.codat.lending.models.operations.ListAccountingJournalEntriesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingJournalEntriesRequest.class, + baseUrl, + "/companies/{companyId}/data/journalEntries", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingJournalEntriesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingJournalEntriesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingJournalEntriesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingJournalEntriesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingJournalEntries out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingJournalEntries(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Journals.java b/lending/lib/src/main/java/io/codat/lending/Journals.java new file mode 100644 index 00000000..273bc854 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Journals.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Journals implements + MethodCallGetAccountingJournal, + MethodCallListAccountingJournals { + + private final SDKConfiguration sdkConfiguration; + + Journals(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingJournalRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingJournalRequestBuilder(this); + } + + /** + * Get journal + * The *Get journal* endpoint returns a single journal for a given journalId. + * + * [Journals](https://docs.codat.io/lending-api#/schemas/Journal) are used to record all the financial transactions of a company. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingJournalResponse get( + io.codat.lending.models.operations.GetAccountingJournalRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingJournalRequest.class, + baseUrl, + "/companies/{companyId}/data/journals/{journalId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingJournalResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingJournalResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingJournalResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingJournal out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingJournal(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingJournalsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingJournalsRequestBuilder(this); + } + + /** + * List journals + * The *List journals* endpoint returns a list of [journals](https://docs.codat.io/lending-api#/schemas/Journal) for a given company's connection. + * + * [Journals](https://docs.codat.io/lending-api#/schemas/Journal) are used to record all the financial transactions of a company. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingJournalsResponse list( + io.codat.lending.models.operations.ListAccountingJournalsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingJournalsRequest.class, + baseUrl, + "/companies/{companyId}/data/journals", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingJournalsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingJournalsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingJournalsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingJournalsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingJournals out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingJournals(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Liabilities.java b/lending/lib/src/main/java/io/codat/lending/Liabilities.java new file mode 100644 index 00000000..be1cb41f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Liabilities.java @@ -0,0 +1,358 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Debt and other liabilities. + */ +public class Liabilities implements + MethodCallGenerateLoanSummary, + MethodCallGenerateLoanTransactions, + MethodCallGetLoanSummary, + MethodCallListLoanTransactions { + + private final SDKConfiguration sdkConfiguration; + + Liabilities(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GenerateLoanSummaryRequestBuilder generateLoanSummary() { + return new io.codat.lending.models.operations.GenerateLoanSummaryRequestBuilder(this); + } + + /** + * Generate loan summaries report + * The _Generate loan summaries_ endpoint requests the generation of the Loan Summaries report. + * + * Learn more about Codat's liabilities feature [here](https://docs.codat.io/lending/features/liabilities-overview). + * + * Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + * + * @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 io.codat.lending.models.operations.GenerateLoanSummaryResponse generateLoanSummary( + io.codat.lending.models.operations.GenerateLoanSummaryRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GenerateLoanSummaryRequest.class, + baseUrl, + "/companies/{companyId}/reports/liabilities/loans", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GenerateLoanSummaryRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GenerateLoanSummaryResponse.Builder resBuilder = + io.codat.lending.models.operations.GenerateLoanSummaryResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GenerateLoanSummaryResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 202) { + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GenerateLoanTransactionsRequestBuilder generateLoanTransactions() { + return new io.codat.lending.models.operations.GenerateLoanTransactionsRequestBuilder(this); + } + + /** + * Generate loan transactions report + * The _Generate loan transactions_ endpoint requests the generation of the Loan Transactions report. + * + * Learn more about Codat's liabilities feature [here](https://docs.codat.io/lending/features/liabilities-overview). + * + * Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + * + * @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 io.codat.lending.models.operations.GenerateLoanTransactionsResponse generateLoanTransactions( + io.codat.lending.models.operations.GenerateLoanTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GenerateLoanTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/reports/liabilities/loans/transactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GenerateLoanTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GenerateLoanTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.GenerateLoanTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GenerateLoanTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 202) { + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetLoanSummaryRequestBuilder getLoanSummary() { + return new io.codat.lending.models.operations.GetLoanSummaryRequestBuilder(this); + } + + /** + * Get loan summaries + * The *Get loan summaries* endpoint returns a summary by integration type of all loans identified from a company's accounting, banking, and commerce integrations. + * + * The endpoint returns a list of a company's [loan summaries](https://docs.codat.io/lending-api#/schemas/LoanSummary) for each valid data connection. + * + * Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + * + * @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 io.codat.lending.models.operations.GetLoanSummaryResponse getLoanSummary( + io.codat.lending.models.operations.GetLoanSummaryRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetLoanSummaryRequest.class, + baseUrl, + "/companies/{companyId}/reports/liabilities/loans", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetLoanSummaryRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetLoanSummaryResponse.Builder resBuilder = + io.codat.lending.models.operations.GetLoanSummaryResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetLoanSummaryResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.LoanSummary out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withLoanSummary(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListLoanTransactionsRequestBuilder listLoanTransactions() { + return new io.codat.lending.models.operations.ListLoanTransactionsRequestBuilder(this); + } + + /** + * List loan transactions + * The *List loan transactions* endpoint returns all [loan transactions](https://docs.codat.io/lending-api#/schemas/LoanTransactions) identified from a company's accounting, banking, and commerce integrations. + * + * This detail gives analysts a better idea of the loan obligations a company may have. + * + * Make sure you have [synced a company](https://docs.codat.io/lending-api#/operations/refresh-company-data) recently before calling the endpoint. + * + * @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 io.codat.lending.models.operations.ListLoanTransactionsResponse listLoanTransactions( + io.codat.lending.models.operations.ListLoanTransactionsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListLoanTransactionsRequest.class, + baseUrl, + "/companies/{companyId}/reports/liabilities/loans/transactions", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListLoanTransactionsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListLoanTransactionsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListLoanTransactionsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListLoanTransactionsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.LoanTransactions out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withLoanTransactions(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/LoanWriteback.java b/lending/lib/src/main/java/io/codat/lending/LoanWriteback.java new file mode 100644 index 00000000..597f3791 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/LoanWriteback.java @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class LoanWriteback { + + private final SDKConfiguration sdkConfiguration; + private final BankAccounts bankAccounts; + private final BankTransactions bankTransactions; + private final CodatLendingLoanWritebackAccounts accounts; + private final DirectCosts directCosts; + private final CodatLendingPayments payments; + private final CodatLendingSuppliers suppliers; + private final Transfers transfers; + private final CreateOperations createOperations; + + LoanWriteback(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.bankAccounts = new BankAccounts(this.sdkConfiguration); + this.bankTransactions = new BankTransactions(this.sdkConfiguration); + this.accounts = new CodatLendingLoanWritebackAccounts(this.sdkConfiguration); + this.directCosts = new DirectCosts(this.sdkConfiguration); + this.payments = new CodatLendingPayments(this.sdkConfiguration); + this.suppliers = new CodatLendingSuppliers(this.sdkConfiguration); + this.transfers = new Transfers(this.sdkConfiguration); + this.createOperations = new CreateOperations(this.sdkConfiguration); + } + + public final BankAccounts bankAccounts() { + return bankAccounts; + } + + public final BankTransactions bankTransactions() { + return bankTransactions; + } + + public final CodatLendingLoanWritebackAccounts accounts() { + return accounts; + } + + public final DirectCosts directCosts() { + return directCosts; + } + + public final CodatLendingPayments payments() { + return payments; + } + + public final CodatLendingSuppliers suppliers() { + return suppliers; + } + + public final Transfers transfers() { + return transfers; + } + + public final CreateOperations createOperations() { + return createOperations; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/Locations.java b/lending/lib/src/main/java/io/codat/lending/Locations.java new file mode 100644 index 00000000..90bc3904 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Locations.java @@ -0,0 +1,188 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Locations implements + MethodCallGetCommerceLocation, + MethodCallListCommerceLocations { + + private final SDKConfiguration sdkConfiguration; + + Locations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceLocationRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceLocationRequestBuilder(this); + } + + /** + * Get location + * The *Get location* endpoint returns a single location for a given locationId. + * + * [Locations](https://docs.codat.io/lending-api#/schemas/Location) hold information on the geographic location at which stocks of [products](https://docs.codat.io/lending-api#/schemas/Product) may be held or where [orders](https://docs.codat.io/lending-api#/schemas/Order) were placed. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-locations) for integrations that support getting a specific location. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceLocationResponse get( + io.codat.lending.models.operations.GetCommerceLocationRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceLocationRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-locations/{locationId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceLocationResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceLocationResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceLocationResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceLocation out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceLocation(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceLocationsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceLocationsRequestBuilder(this); + } + + /** + * List locations + * The *List locations* endpoint returns a list of [locations](https://docs.codat.io/lending-api#/schemas/Location) for a given company's connection. + * + * [Locations](https://docs.codat.io/lending-api#/schemas/Location) hold information on the geographic location at which stocks of [products](https://docs.codat.io/lending-api#/schemas/Product) may be held or where [orders](https://docs.codat.io/lending-api#/schemas/Order) were placed. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceLocationsResponse list( + io.codat.lending.models.operations.ListCommerceLocationsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceLocationsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-locations", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceLocationsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceLocationsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceLocationsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceLocations out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceLocations(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/ManageData.java b/lending/lib/src/main/java/io/codat/lending/ManageData.java new file mode 100644 index 00000000..6626b2e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/ManageData.java @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ManageData implements + MethodCallGetDataStatus { + + private final SDKConfiguration sdkConfiguration; + private final Refresh refresh; + private final PullOperations pullOperations; + + ManageData(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.refresh = new Refresh(this.sdkConfiguration); + this.pullOperations = new PullOperations(this.sdkConfiguration); + } + + public final Refresh refresh() { + return refresh; + } + + public final PullOperations pullOperations() { + return pullOperations; + } + public io.codat.lending.models.operations.GetDataStatusRequestBuilder getStatus() { + return new io.codat.lending.models.operations.GetDataStatusRequestBuilder(this); + } + + /** + * Get data status + * Get the state of each data type for a company + * @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 io.codat.lending.models.operations.GetDataStatusResponse getStatus( + io.codat.lending.models.operations.GetDataStatusRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetDataStatusRequest.class, + baseUrl, + "/companies/{companyId}/dataStatus", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetDataStatusResponse.Builder resBuilder = + io.codat.lending.models.operations.GetDataStatusResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetDataStatusResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + java.util.Map out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference>() {}); + res.withDataStatuses(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Metrics.java b/lending/lib/src/main/java/io/codat/lending/Metrics.java new file mode 100644 index 00000000..397d3629 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Metrics.java @@ -0,0 +1,345 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Metrics implements + MethodCallGetCommerceCustomerRetentionMetrics, + MethodCallGetCommerceLifetimeValueMetrics, + MethodCallGetCommerceRevenueMetrics { + + private final SDKConfiguration sdkConfiguration; + + Metrics(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequestBuilder getCustomerRetention() { + return new io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequestBuilder(this); + } + + /** + * Get customer retention metrics + * The *Get customer retention metrics* endpoint returns customer retention insights for a specific company's commerce connection over one or more periods of time. + * + * This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + * + * #### Customer retention metrics + * + * - __Existing customers__: the number of unique customers that have placed an order(s) in the specified period and any previous period. + * - __New customers__: the number of unique customers that have placed an order(s) in the specified period and none in any previous period. + * - __Total customers__: the total number of existing and new customers within the specified period. + * - __Retention rate__: the ratio of existing customers within the specified period compared to the total customers at the end of the previous period represented as a percentage. + * - __Repeat rate__: the ratio of existing customers to total customers over the specified period represented as a percentage. + * + * Learn more about the formulas used to calculate customer retention metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + * + * #### Response structure + * + * The Customer retention report's dimensions and measures are: + * + * | Index | Dimensions | + * |-----------------------------|----------------------------| + * | `index` = 0 | Period | + * | `index` = 1 | Customer retention metrics | + * + * | Index | Measures | + * |----------------------|------------| + * | `index` = 0 | Count | + * | `index` = 1 | Percentage | + * + * The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + * @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 io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse getCustomerRetention( + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest.class, + baseUrl, + "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/customerRetention", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequestBuilder getLifetimeValue() { + return new io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequestBuilder(this); + } + + /** + * Get lifetime value metrics + * The *Get lifetime value metrics* endpoint returns the average revenue that a specific company will generate throughout its lifespan over one or more periods of time. + * + * This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + * + * Learn more about the formulas used to calculate the lifetime value metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + * + * Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more detail on commerce reports in Lending. + * + * #### Response structure + * + * The Lifetime value report's dimensions and measures are: + * + * | Index | Dimensions | + * |---------------|------------------------| + * | `index` = 0 | Period | + * | `index` = 1 | Lifetime value metrics | + * + * | Index | Measures | + * |-------------------|---------| + * | `index` = 1 | Value | + * + * The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + * + * @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 io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse getLifetimeValue( + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest.class, + baseUrl, + "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/lifetimeValue", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCommerceRevenueMetricsRequestBuilder getRevenue() { + return new io.codat.lending.models.operations.GetCommerceRevenueMetricsRequestBuilder(this); + } + + /** + * Get commerce revenue metrics + * The *Get revenue report* endpoint returns the revenue and revenue growth for a specific company connection over one or more periods of time. + * + * This detail helps you assess a merchant's health and advise them on performance improvement strategies. It also provides you with key insights you need to assess the credit risk of a company. + * + * Learn more about the formulas used to calculate the revenue metrics [here](https://docs.codat.io/lending/commerce-metrics/overview#what-metrics-are-available). + * + * Refer to the [commerce reporting structure](https://docs.codat.io/lending/commerce-metrics/reporting-structure) page for more details on commerce reports in Lending. + * + * #### Response structure + * + * The Revenue report's dimensions and measures are: + * + * | Index | Dimensions | + * |---------------|------------| + * | `index` = 0 | Period | + * | `index` = 1 | Revenue | + * + * | Index | Measures | + * |---------------|--------------------------------------------------------------------------------------------------------------------------| + * | `index` = 0 | Value | + * | `index` = 1 | Percentage change, defined as the change between the current and previous periods' values and expressed as a percentage. | + * + * The report data then combines multiple reporting dimensions and measures and outputs the value of each combination. + * + * @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 io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse getRevenue( + io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest.class, + baseUrl, + "/data/companies/{companyId}/connections/{connectionId}/assess/commerceMetrics/revenue", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Orders.java b/lending/lib/src/main/java/io/codat/lending/Orders.java new file mode 100644 index 00000000..39bb8156 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Orders.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Orders implements + MethodCallGetCommerceOrder, + MethodCallListCommerceOrders { + + private final SDKConfiguration sdkConfiguration; + + Orders(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceOrderRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceOrderRequestBuilder(this); + } + + /** + * Get order + * The *Get order* endpoint returns a single order for a given orderId. + * + * [Orders](https://docs.codat.io/lending-api#/schemas/Order) contain the transaction details for all products sold by the company. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-orders) for integrations that support getting a specific order. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceOrderResponse get( + io.codat.lending.models.operations.GetCommerceOrderRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceOrderRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-orders/{orderId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceOrderResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceOrderResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceOrderResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceOrder out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceOrder(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceOrdersRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceOrdersRequestBuilder(this); + } + + /** + * List orders + * The *List orders* endpoint returns a list of [orders](https://docs.codat.io/lending-api#/schemas/Order) for a given company's connection. + * + * [Orders](https://docs.codat.io/lending-api#/schemas/Order) contain the transaction details for all products sold by the company. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceOrdersResponse list( + io.codat.lending.models.operations.ListCommerceOrdersRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceOrdersRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-orders", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceOrdersRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceOrdersResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceOrdersResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceOrdersResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceOrders out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceOrders(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/PaymentMethods.java b/lending/lib/src/main/java/io/codat/lending/PaymentMethods.java new file mode 100644 index 00000000..ef61a9ac --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/PaymentMethods.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class PaymentMethods implements + MethodCallGetCommercePaymentMethod, + MethodCallListCommercePaymentMethods { + + private final SDKConfiguration sdkConfiguration; + + PaymentMethods(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommercePaymentMethodRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommercePaymentMethodRequestBuilder(this); + } + + /** + * Get payment method + * The *Get payment method* endpoint returns a single payment method for a given paymentMethodId. + * + * [Payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) represent the payment method(s) used to make payments. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-paymentMethods) for integrations that support getting a specific payment method. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommercePaymentMethodResponse get( + io.codat.lending.models.operations.GetCommercePaymentMethodRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommercePaymentMethodRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods/{paymentMethodId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommercePaymentMethodResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommercePaymentMethodResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommercePaymentMethodResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommercePaymentMethod out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommercePaymentMethod(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommercePaymentMethodsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommercePaymentMethodsRequestBuilder(this); + } + + /** + * List payment methods + * The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) for a given company's connection. + * + * [Payment methods](https://docs.codat.io/lending-api#/schemas/PaymentMethod) represent the payment method(s) used to make payments. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommercePaymentMethodsResponse list( + io.codat.lending.models.operations.ListCommercePaymentMethodsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommercePaymentMethodsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommercePaymentMethodsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommercePaymentMethodsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommercePaymentMethodsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommercePaymentMethodsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommercePaymentMethods out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommercePaymentMethods(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Payments.java b/lending/lib/src/main/java/io/codat/lending/Payments.java new file mode 100644 index 00000000..d74cc4d6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Payments.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Payments implements + MethodCallGetAccountingPayment, + MethodCallListAccountingPayments { + + private final SDKConfiguration sdkConfiguration; + + Payments(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingPaymentRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingPaymentRequestBuilder(this); + } + + /** + * Get payment + * The *Get payment* endpoint returns a single payment for a given paymentId. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments) for integrations that support getting a specific payment. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingPaymentResponse get( + io.codat.lending.models.operations.GetAccountingPaymentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingPaymentRequest.class, + baseUrl, + "/companies/{companyId}/data/payments/{paymentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingPaymentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingPaymentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingPaymentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingPayment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingPayment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingPaymentsRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingPaymentsRequestBuilder(this); + } + + /** + * List payments + * The *List payments* endpoint returns a list of [payments](https://docs.codat.io/lending-api#/schemas/Payment) for a given company's connection. + * + * [Payments](https://docs.codat.io/lending-api#/schemas/Payment) represent an allocation of money within any customer accounts receivable account. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingPaymentsResponse list( + io.codat.lending.models.operations.ListAccountingPaymentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingPaymentsRequest.class, + baseUrl, + "/companies/{companyId}/data/payments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingPaymentsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingPaymentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingPaymentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingPaymentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingPayments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingPayments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/ProductCategories.java b/lending/lib/src/main/java/io/codat/lending/ProductCategories.java new file mode 100644 index 00000000..aae745f8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/ProductCategories.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ProductCategories implements + MethodCallGetCommerceProductCategory, + MethodCallListCommerceProductCategories { + + private final SDKConfiguration sdkConfiguration; + + ProductCategories(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceProductCategoryRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceProductCategoryRequestBuilder(this); + } + + /** + * Get product category + * The *Get product* endpoint returns a single product for a given productId. + * + * [Product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-productCategories) for integrations that support getting a specific product. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceProductCategoryResponse get( + io.codat.lending.models.operations.GetCommerceProductCategoryRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceProductCategoryRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories/{productId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceProductCategoryResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceProductCategoryResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceProductCategoryResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceProductCategory out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceProductCategory(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceProductCategoriesRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceProductCategoriesRequestBuilder(this); + } + + /** + * List product categories + * The *List product categories* endpoint returns a list of [product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) for a given company's connection. + * + * [Product categories](https://docs.codat.io/lending-api#/schemas/ProductCategory) are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceProductCategoriesResponse list( + io.codat.lending.models.operations.ListCommerceProductCategoriesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceProductCategoriesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceProductCategoriesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceProductCategoriesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceProductCategoriesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceProductCategoriesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceProductCategories out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceProductCategories(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Products.java b/lending/lib/src/main/java/io/codat/lending/Products.java new file mode 100644 index 00000000..d8480ee0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Products.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Products implements + MethodCallGetCommerceProduct, + MethodCallListCommerceProducts { + + private final SDKConfiguration sdkConfiguration; + + Products(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetCommerceProductRequestBuilder get() { + return new io.codat.lending.models.operations.GetCommerceProductRequestBuilder(this); + } + + /** + * Get product + * The *Get product* endpoint returns a single product for a given productId. + * + * [Products](https://docs.codat.io/lending-api#/schemas/Product) are items in the company's inventory that are available for sale. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-products) for integrations that support getting a specific product. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetCommerceProductResponse get( + io.codat.lending.models.operations.GetCommerceProductRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCommerceProductRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-products/{productId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCommerceProductResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCommerceProductResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCommerceProductResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceProduct out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceProduct(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListCommerceProductsRequestBuilder list() { + return new io.codat.lending.models.operations.ListCommerceProductsRequestBuilder(this); + } + + /** + * List products + * The *List products* endpoint returns a list of [products](https://docs.codat.io/lending-api#/schemas/Product) for a given company's connection. + * + * [Products](https://docs.codat.io/lending-api#/schemas/Product) are items in the company's inventory that are available for sale. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListCommerceProductsResponse list( + io.codat.lending.models.operations.ListCommerceProductsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListCommerceProductsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/commerce-products", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListCommerceProductsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListCommerceProductsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListCommerceProductsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListCommerceProductsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.CommerceProducts out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withCommerceProducts(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/ProfitAndLoss.java b/lending/lib/src/main/java/io/codat/lending/ProfitAndLoss.java new file mode 100644 index 00000000..3bea2f51 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/ProfitAndLoss.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class ProfitAndLoss implements + MethodCallGetAccountingProfitAndLoss, + MethodCallGetCategorizedProfitAndLossStatement { + + private final SDKConfiguration sdkConfiguration; + + ProfitAndLoss(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingProfitAndLossRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingProfitAndLossRequestBuilder(this); + } + + /** + * Get profit and loss + * Gets the latest profit and loss for a company. + * @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 io.codat.lending.models.operations.GetAccountingProfitAndLossResponse get( + io.codat.lending.models.operations.GetAccountingProfitAndLossRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingProfitAndLossRequest.class, + baseUrl, + "/companies/{companyId}/data/financials/profitAndLoss", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingProfitAndLossRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingProfitAndLossResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingProfitAndLossResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingProfitAndLossResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingProfitAndLossReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingProfitAndLossReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequestBuilder getCategorizedAccounts() { + return new io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequestBuilder(this); + } + + /** + * Get categorized profit and loss statement + * The *Get categorized profit and loss statement* endpoint returns a list of categorized accounts that appear on a company’s Profit and Loss statement. It also includes a balance as of the financial statement date. + * + * Codat suggests a category for each account automatically, but you can [change it](https://docs.codat.io/lending/enhanced-financials/overview#categorize-accounts) to a more suitable one. + * @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 io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse getCategorizedAccounts( + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest.class, + baseUrl, + "/companies/{companyId}/reports/enhancedProfitAndLoss/accounts", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.EnhancedFinancialReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withEnhancedFinancialReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/PullOperations.java b/lending/lib/src/main/java/io/codat/lending/PullOperations.java new file mode 100644 index 00000000..20b2db4e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/PullOperations.java @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class PullOperations implements + MethodCallGetPullOperation, + MethodCallListPullOperations { + + private final SDKConfiguration sdkConfiguration; + + PullOperations(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetPullOperationRequestBuilder get() { + return new io.codat.lending.models.operations.GetPullOperationRequestBuilder(this); + } + + /** + * Get pull operation + * Retrieve information about a single dataset or pull operation. + * @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 io.codat.lending.models.operations.GetPullOperationResponse get( + io.codat.lending.models.operations.GetPullOperationRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetPullOperationRequest.class, + baseUrl, + "/companies/{companyId}/data/history/{datasetId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetPullOperationResponse.Builder resBuilder = + io.codat.lending.models.operations.GetPullOperationResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetPullOperationResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PullOperation out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPullOperation(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListPullOperationsRequestBuilder list() { + return new io.codat.lending.models.operations.ListPullOperationsRequestBuilder(this); + } + + /** + * List pull operations + * Gets the pull operation history (datasets) for a given company. + * @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 io.codat.lending.models.operations.ListPullOperationsResponse list( + io.codat.lending.models.operations.ListPullOperationsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListPullOperationsRequest.class, + baseUrl, + "/companies/{companyId}/data/history", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListPullOperationsRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListPullOperationsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListPullOperationsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListPullOperationsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PullOperations out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPullOperations(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Refresh.java b/lending/lib/src/main/java/io/codat/lending/Refresh.java new file mode 100644 index 00000000..f6a076de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Refresh.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Refresh implements + MethodCallRefreshAllDataTypes, + MethodCallRefreshDataType { + + private final SDKConfiguration sdkConfiguration; + + Refresh(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.RefreshAllDataTypesRequestBuilder allDataTypes() { + return new io.codat.lending.models.operations.RefreshAllDataTypesRequestBuilder(this); + } + + /** + * Refresh all data + * Refreshes all data types with `fetch on first link` set to `true` for a given company. + * + * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * + * [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.RefreshAllDataTypesResponse allDataTypes( + io.codat.lending.models.operations.RefreshAllDataTypesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.RefreshAllDataTypesRequest.class, + baseUrl, + "/companies/{companyId}/data/all", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.RefreshAllDataTypesResponse.Builder resBuilder = + io.codat.lending.models.operations.RefreshAllDataTypesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.RefreshAllDataTypesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 204) { + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.RefreshDataTypeRequestBuilder dataType() { + return new io.codat.lending.models.operations.RefreshDataTypeRequestBuilder(this); + } + + /** + * Refresh data type + * Refreshes a given data type for a given company. + * + * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * @param request the request object containing all of the parameters for the API call + * @return the response from the API call + * @throws Exception if the API call fails + */ + public io.codat.lending.models.operations.RefreshDataTypeResponse dataType( + io.codat.lending.models.operations.RefreshDataTypeRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.RefreshDataTypeRequest.class, + baseUrl, + "/companies/{companyId}/data/queue/{dataType}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.RefreshDataTypeRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.RefreshDataTypeResponse.Builder resBuilder = + io.codat.lending.models.operations.RefreshDataTypeResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.RefreshDataTypeResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PullOperation out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPullOperation(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Reports.java b/lending/lib/src/main/java/io/codat/lending/Reports.java new file mode 100644 index 00000000..56730339 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Reports.java @@ -0,0 +1,339 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Reports implements + MethodCallGetAccountingAgedCreditorsReport, + MethodCallGetAccountingAgedDebtorsReport, + MethodCallIsAgedCreditorsReportAvailable, + MethodCallIsAgedDebtorsReportAvailable { + + private final SDKConfiguration sdkConfiguration; + + Reports(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequestBuilder getAgedCreditors() { + return new io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequestBuilder(this); + } + + /** + * Aged creditors report + * Returns aged creditors report for company that shows the total balance owed by a business to its suppliers over time. + * @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 io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse getAgedCreditors( + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest.class, + baseUrl, + "/companies/{companyId}/reports/agedCreditor", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAgedCreditorReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAgedCreditorReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequestBuilder getAgedDebtors() { + return new io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequestBuilder(this); + } + + /** + * Aged debtors report + * Returns aged debtors report for company that shows the total outstanding balance due from customers to the business over time. + * @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 io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse getAgedDebtors( + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest.class, + baseUrl, + "/companies/{companyId}/reports/agedDebtor", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAgedDebtorReport out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAgedDebtorReport(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequestBuilder isAgedCreditorsAvailable() { + return new io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequestBuilder(this); + } + + /** + * Aged creditors report available + * Indicates whether the aged creditor report is available for the company. + * @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 io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse isAgedCreditorsAvailable( + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequest.class, + baseUrl, + "/companies/{companyId}/reports/agedCreditor/available", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse.Builder resBuilder = + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + boolean out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBoolean(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequestBuilder isAgedDebtorsAvailable() { + return new io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequestBuilder(this); + } + + /** + * Aged debtors report available + * Indicates whether the aged debtors report is available for the company. + * @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 io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse isAgedDebtorsAvailable( + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequest.class, + baseUrl, + "/companies/{companyId}/reports/agedDebtor/available", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse.Builder resBuilder = + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + boolean out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBoolean(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/SDKConfiguration.java b/lending/lib/src/main/java/io/codat/lending/SDKConfiguration.java new file mode 100644 index 00000000..3bdf3ee5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/SDKConfiguration.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.models.shared.Security; + +class SDKConfiguration { + public SecuritySource securitySource; + + public HTTPClient defaultClient; + public String serverUrl; + public int serverIdx = 0; + public String language = "java"; + public String openapiDocVersion = "3.0.0"; + public String sdkVersion = "0.1.0"; + public String genVersion = "2.250.8"; + public String userAgent = "speakeasy-sdk/java 0.1.0 2.250.8 3.0.0 io.codat.lending"; + + +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/Sales.java b/lending/lib/src/main/java/io/codat/lending/Sales.java new file mode 100644 index 00000000..9a360b4d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Sales.java @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Sales { + + private final SDKConfiguration sdkConfiguration; + private final CodatLendingCustomers customers; + private final Disputes disputes; + private final Locations locations; + private final Orders orders; + private final PaymentMethods paymentMethods; + private final CodatLendingSalesPayments payments; + private final ProductCategories productCategories; + private final Products products; + private final CodatLendingTransactions transactions; + private final Metrics metrics; + private final CodatLendingReports reports; + + Sales(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.customers = new CodatLendingCustomers(this.sdkConfiguration); + this.disputes = new Disputes(this.sdkConfiguration); + this.locations = new Locations(this.sdkConfiguration); + this.orders = new Orders(this.sdkConfiguration); + this.paymentMethods = new PaymentMethods(this.sdkConfiguration); + this.payments = new CodatLendingSalesPayments(this.sdkConfiguration); + this.productCategories = new ProductCategories(this.sdkConfiguration); + this.products = new Products(this.sdkConfiguration); + this.transactions = new CodatLendingTransactions(this.sdkConfiguration); + this.metrics = new Metrics(this.sdkConfiguration); + this.reports = new CodatLendingReports(this.sdkConfiguration); + } + + public final CodatLendingCustomers customers() { + return customers; + } + + public final Disputes disputes() { + return disputes; + } + + public final Locations locations() { + return locations; + } + + public final Orders orders() { + return orders; + } + + public final PaymentMethods paymentMethods() { + return paymentMethods; + } + + public final CodatLendingSalesPayments payments() { + return payments; + } + + public final ProductCategories productCategories() { + return productCategories; + } + + public final Products products() { + return products; + } + + public final CodatLendingTransactions transactions() { + return transactions; + } + + public final Metrics metrics() { + return metrics; + } + + public final CodatLendingReports reports() { + return reports; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/SecuritySource.java b/lending/lib/src/main/java/io/codat/lending/SecuritySource.java new file mode 100644 index 00000000..8972f4da --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/SecuritySource.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.shared.Security; + +public interface SecuritySource { + + Security getSecurity(); + + public static SecuritySource of(Security security) { + return new DefaultSecuritySource(security); + } + + public static class DefaultSecuritySource implements SecuritySource { + private Security security; + + public DefaultSecuritySource(Security security) { + this.security = security; + } + + public Security getSecurity() { + return security; + } + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/Suppliers.java b/lending/lib/src/main/java/io/codat/lending/Suppliers.java new file mode 100644 index 00000000..f4e0851b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Suppliers.java @@ -0,0 +1,431 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Suppliers implements + MethodCallDownloadAccountingSupplierAttachment, + MethodCallGetAccountingSupplier, + MethodCallGetAccountingSupplierAttachment, + MethodCallListAccountingSuppliers, + MethodCallListAccountingSupplierAttachments { + + private final SDKConfiguration sdkConfiguration; + + Suppliers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequestBuilder downloadAttachment() { + return new io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequestBuilder(this); + } + + /** + * Download supplier attachment + * The *Download supplier attachment* endpoint downloads a specific attachment for a given `supplierId` and `attachmentId`. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support downloading a supplier attachment. + * + * @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 io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}/download", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json;q=1, application/octet-stream;q=0"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + if ((httpRes.statusCode() == 200) && io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + resBuilder.data(httpRes.body()); + } + + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/octet-stream")) { + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingSupplierRequestBuilder get() { + return new io.codat.lending.models.operations.GetAccountingSupplierRequestBuilder(this); + } + + /** + * Get supplier + * The *Get supplier* endpoint returns a single supplier for a given supplierId. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetAccountingSupplierResponse get( + io.codat.lending.models.operations.GetAccountingSupplierRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingSupplierRequest.class, + baseUrl, + "/companies/{companyId}/data/suppliers/{supplierId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingSupplierResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingSupplierResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingSupplierResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingSupplier out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingSupplier(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequestBuilder getAttachment() { + return new io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequestBuilder(this); + } + + /** + * Get supplier attachment + * The *Get supplier attachment* endpoint returns a specific attachment for a given `supplierId` and `attachmentId`. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a supplier attachment. + * + * @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 io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments/{attachmentId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse.Builder resBuilder = + io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingAttachment out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingAttachment(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingSuppliersRequestBuilder list() { + return new io.codat.lending.models.operations.ListAccountingSuppliersRequestBuilder(this); + } + + /** + * List suppliers + * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) for a given company's connection. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListAccountingSuppliersResponse list( + io.codat.lending.models.operations.ListAccountingSuppliersRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingSuppliersRequest.class, + baseUrl, + "/companies/{companyId}/data/suppliers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListAccountingSuppliersRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingSuppliersResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingSuppliersResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingSuppliersResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingSuppliers out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingSuppliers(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequestBuilder listAttachments() { + return new io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequestBuilder(this); + } + + /** + * List supplier attachments + * The *List supplier attachments* endpoint returns a list of attachments available to download for given `supplierId`. + * + * [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support listing supplier attachments. + * + * @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 io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/suppliers/{supplierId}/attachments", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse.Builder resBuilder = + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.Attachments out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAttachments(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/TransactionCategories.java b/lending/lib/src/main/java/io/codat/lending/TransactionCategories.java new file mode 100644 index 00000000..5ed140a4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/TransactionCategories.java @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class TransactionCategories implements + MethodCallGetBankingTransactionCategory, + MethodCallListBankingTransactionCategories { + + private final SDKConfiguration sdkConfiguration; + + TransactionCategories(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.GetBankingTransactionCategoryRequestBuilder get() { + return new io.codat.lending.models.operations.GetBankingTransactionCategoryRequestBuilder(this); + } + + /** + * Get transaction category + * The *Get transaction category* endpoint returns a single transaction category for a given transactionCategoryId. + * + * [Transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) are associated with a transaction to provide greater contextual meaning to transaction activity. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactionCategories) for integrations that support getting a specific transaction category. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.GetBankingTransactionCategoryResponse get( + io.codat.lending.models.operations.GetBankingTransactionCategoryRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetBankingTransactionCategoryRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories/{transactionCategoryId}", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetBankingTransactionCategoryResponse.Builder resBuilder = + io.codat.lending.models.operations.GetBankingTransactionCategoryResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetBankingTransactionCategoryResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingTransactionCategory out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingTransactionCategory(org.openapitools.jackson.nullable.JsonNullable.of(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.ListBankingTransactionCategoriesRequestBuilder list() { + return new io.codat.lending.models.operations.ListBankingTransactionCategoriesRequestBuilder(this); + } + + /** + * List transaction categories + * The *List transaction categories* endpoint returns a list of [transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) for a given company's connection. + * + * [Transaction categories](https://docs.codat.io/lending-api#/schemas/TransactionCategory) are associated with a transaction to provide greater contextual meaning to transaction activity. + * + * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data). + * + * @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 io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse list( + io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/data/banking-transactionCategories", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse.Builder resBuilder = + io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.BankingTransactionCategories out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withBankingTransactionCategories(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 409 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/Transactions.java b/lending/lib/src/main/java/io/codat/lending/Transactions.java new file mode 100644 index 00000000..b4ec55db --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Transactions.java @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Transactions { + + private final SDKConfiguration sdkConfiguration; + private final AccountTransactions accountTransactions; + private final CodatLendingDirectCosts directCosts; + private final CodatLendingTransfers transfers; + private final JournalEntries journalEntries; + private final Journals journals; + + Transactions(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.accountTransactions = new AccountTransactions(this.sdkConfiguration); + this.directCosts = new CodatLendingDirectCosts(this.sdkConfiguration); + this.transfers = new CodatLendingTransfers(this.sdkConfiguration); + this.journalEntries = new JournalEntries(this.sdkConfiguration); + this.journals = new Journals(this.sdkConfiguration); + } + + public final AccountTransactions accountTransactions() { + return accountTransactions; + } + + public final CodatLendingDirectCosts directCosts() { + return directCosts; + } + + public final CodatLendingTransfers transfers() { + return transfers; + } + + public final JournalEntries journalEntries() { + return journalEntries; + } + + public final Journals journals() { + return journals; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/Transfers.java b/lending/lib/src/main/java/io/codat/lending/Transfers.java new file mode 100644 index 00000000..942f5659 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/Transfers.java @@ -0,0 +1,206 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.codat.lending.models.errors.SDKError; +import io.codat.lending.models.operations.SDKMethodInterfaces.*; +import io.codat.lending.utils.HTTPClient; +import io.codat.lending.utils.HTTPRequest; +import io.codat.lending.utils.JSON; +import io.codat.lending.utils.SerializedBody; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import org.apache.http.NameValuePair; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Transfers implements + MethodCallCreateTransfer, + MethodCallGetCreateTransfersModel { + + private final SDKConfiguration sdkConfiguration; + + Transfers(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + public io.codat.lending.models.operations.CreateTransferRequestBuilder create() { + return new io.codat.lending.models.operations.CreateTransferRequestBuilder(this); + } + + /** + * Create transfer + * The *Create transfer* endpoint creates a new [transfer](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company's connection. + * + * [Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + * + * **Integration-specific behaviour** + * + * Required data may vary by integration. To see what data to post, first call [Get create transfer model](https://docs.codat.io/lending-api#/operations/get-create-transfers-model). + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating an account. + * + * @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 io.codat.lending.models.operations.CreateTransferResponse create( + io.codat.lending.models.operations.CreateTransferRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.CreateTransferRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/push/transfers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("POST"); + req.setURL(url); + SerializedBody serializedRequestBody = io.codat.lending.utils.Utils.serializeRequestBody( + request, "accountingTransfer", "json", true); + req.setBody(serializedRequestBody); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + java.util.List queryParams = io.codat.lending.utils.Utils.getQueryParams( + io.codat.lending.models.operations.CreateTransferRequest.class, request, null); + if (queryParams != null) { + for (NameValuePair queryParam : queryParams) { + req.addQueryParam(queryParam); + } + } + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.CreateTransferResponse.Builder resBuilder = + io.codat.lending.models.operations.CreateTransferResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.CreateTransferResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.AccountingCreateTransferResponse out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withAccountingCreateTransferResponse(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 400 || httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + + public io.codat.lending.models.operations.GetCreateTransfersModelRequestBuilder getCreateModel() { + return new io.codat.lending.models.operations.GetCreateTransfersModelRequestBuilder(this); + } + + /** + * Get create transfer model + * The *Get create transfer model* endpoint returns the expected data for the request payload when creating a [transfer](https://docs.codat.io/lending-api#/schemas/Transfer) for a given company and integration. + * + * [Transfers](https://docs.codat.io/lending-api#/schemas/Transfer) record the movement of money between two bank accounts, or between a bank account and a nominal account. + * + * **Integration-specific behaviour** + * + * See the *response examples* for integration-specific indicative models. + * + * Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers) for integrations that support creating a transfer. + * + * @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 io.codat.lending.models.operations.GetCreateTransfersModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateTransfersModelRequest request) throws Exception { + String baseUrl = this.sdkConfiguration.serverUrl; + String url = io.codat.lending.utils.Utils.generateURL( + io.codat.lending.models.operations.GetCreateTransfersModelRequest.class, + baseUrl, + "/companies/{companyId}/connections/{connectionId}/options/transfers", + request, null); + + HTTPRequest req = new HTTPRequest(); + req.setMethod("GET"); + req.setURL(url); + + req.addHeader("Accept", "application/json"); + req.addHeader("user-agent", this.sdkConfiguration.userAgent); + + HTTPClient client = io.codat.lending.utils.Utils.configureSecurityClient( + this.sdkConfiguration.defaultClient, this.sdkConfiguration.securitySource.getSecurity()); + + HttpResponse httpRes = client.send(req); + + String contentType = httpRes + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + + io.codat.lending.models.operations.GetCreateTransfersModelResponse.Builder resBuilder = + io.codat.lending.models.operations.GetCreateTransfersModelResponse + .builder() + .contentType(contentType) + .statusCode(httpRes.statusCode()) + .rawResponse(httpRes); + + io.codat.lending.models.operations.GetCreateTransfersModelResponse res = resBuilder.build(); + + res.withRawResponse(httpRes); + + if (httpRes.statusCode() == 200) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.PushOption out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withPushOption(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } else if (httpRes.statusCode() == 401 || httpRes.statusCode() == 402 || httpRes.statusCode() == 403 || httpRes.statusCode() == 404 || httpRes.statusCode() == 429 || httpRes.statusCode() == 500 || httpRes.statusCode() == 503) { + if (io.codat.lending.utils.Utils.matchContentType(contentType, "application/json")) { + ObjectMapper mapper = JSON.getMapper(); + io.codat.lending.models.shared.ErrorMessage out = mapper.readValue( + Utils.toUtf8AndClose(httpRes.body()), + new TypeReference() {}); + res.withErrorMessage(java.util.Optional.ofNullable(out)); + } else { + throw new SDKError(httpRes, httpRes.statusCode(), "Unknown content-type received: " + contentType, Utils.toByteArrayAndClose(httpRes.body())); + } + } + + return res; + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/errors/SDKError.java b/lending/lib/src/main/java/io/codat/lending/models/errors/SDKError.java new file mode 100644 index 00000000..6f6b3df5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/errors/SDKError.java @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.errors; + +import java.net.http.HttpResponse; +import java.io.InputStream; +import io.codat.lending.utils.Utils; + +/** + * Thrown by a service call when an error response occurs. Contains details about the response. + */ +public class SDKError extends Exception { + + private final HttpResponse rawResponse; + private final int code; + private final String message; + private final byte[] body; + + public SDKError( + HttpResponse rawResponse, + int code, + String message, + byte[] body) { + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(body, "body"); + this.rawResponse = rawResponse; + this.code = code; + this.message = message; + this.body = body; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SDKError other = (SDKError) o; + return + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.body, other.body); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + rawResponse, + code, + message, + body); + } + + @Override + public String toString() { + return Utils.toString(SDKError.class, + "rawResponse", rawResponse, + "code", code, + "message", message, + "body", body); + } + + public HttpResponse rawResponse() { + return this.rawResponse; + } + + public int code() { + return this.code; + } + + public String message() { + return this.message; + } + + public byte[] body() { + return this.body; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequest.java new file mode 100644 index 00000000..22b27303 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequest.java @@ -0,0 +1,302 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateAccountRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional accountPrototype; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateAccountRequest( + Optional accountPrototype, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountPrototype, "accountPrototype"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountPrototype = accountPrototype; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public Optional accountPrototype() { + return accountPrototype; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateAccountRequest withAccountPrototype(io.codat.lending.models.shared.AccountPrototype accountPrototype) { + Utils.checkNotNull(accountPrototype, "accountPrototype"); + this.accountPrototype = Optional.ofNullable(accountPrototype); + return this; + } + + public CreateAccountRequest withAccountPrototype(Optional accountPrototype) { + Utils.checkNotNull(accountPrototype, "accountPrototype"); + this.accountPrototype = accountPrototype; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateAccountRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateAccountRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateAccountRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateAccountRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateAccountRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateAccountRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAccountRequest other = (CreateAccountRequest) o; + return + java.util.Objects.deepEquals(this.accountPrototype, other.accountPrototype) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountPrototype, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateAccountRequest.class, + "accountPrototype", accountPrototype, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private Optional accountPrototype = Optional.empty(); + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountPrototype(io.codat.lending.models.shared.AccountPrototype accountPrototype) { + Utils.checkNotNull(accountPrototype, "accountPrototype"); + this.accountPrototype = Optional.ofNullable(accountPrototype); + return this; + } + + public Builder accountPrototype(Optional accountPrototype) { + Utils.checkNotNull(accountPrototype, "accountPrototype"); + this.accountPrototype = accountPrototype; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateAccountRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateAccountRequest( + accountPrototype, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequestBuilder.java new file mode 100644 index 00000000..93acae9a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateAccountRequestBuilder { + + private CreateAccountRequest request; + + private final SDKMethodInterfaces.MethodCallCreateAccount sdk; + + public CreateAccountRequestBuilder(SDKMethodInterfaces.MethodCallCreateAccount sdk) { + this.sdk = sdk; + } + + public CreateAccountRequestBuilder request(CreateAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateAccountResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountResponse.java new file mode 100644 index 00000000..0ca03131 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateAccountResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateAccountResponse { + + /** + * Success + */ + private Optional accountingCreateAccountResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateAccountResponse( + Optional accountingCreateAccountResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateAccountResponse, "accountingCreateAccountResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateAccountResponse = accountingCreateAccountResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateAccountResponse() { + return accountingCreateAccountResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateAccountResponse withAccountingCreateAccountResponse(io.codat.lending.models.shared.AccountingCreateAccountResponse accountingCreateAccountResponse) { + Utils.checkNotNull(accountingCreateAccountResponse, "accountingCreateAccountResponse"); + this.accountingCreateAccountResponse = Optional.ofNullable(accountingCreateAccountResponse); + return this; + } + + /** + * Success + */ + public CreateAccountResponse withAccountingCreateAccountResponse(Optional accountingCreateAccountResponse) { + Utils.checkNotNull(accountingCreateAccountResponse, "accountingCreateAccountResponse"); + this.accountingCreateAccountResponse = accountingCreateAccountResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateAccountResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateAccountResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateAccountResponse 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; + } + CreateAccountResponse other = (CreateAccountResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateAccountResponse, other.accountingCreateAccountResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateAccountResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateAccountResponse.class, + "accountingCreateAccountResponse", accountingCreateAccountResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateAccountResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateAccountResponse(io.codat.lending.models.shared.AccountingCreateAccountResponse accountingCreateAccountResponse) { + Utils.checkNotNull(accountingCreateAccountResponse, "accountingCreateAccountResponse"); + this.accountingCreateAccountResponse = Optional.ofNullable(accountingCreateAccountResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateAccountResponse(Optional accountingCreateAccountResponse) { + Utils.checkNotNull(accountingCreateAccountResponse, "accountingCreateAccountResponse"); + this.accountingCreateAccountResponse = accountingCreateAccountResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateAccountResponse build() { + return new CreateAccountResponse( + accountingCreateAccountResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequest.java new file mode 100644 index 00000000..409399c6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequest.java @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateBankAccountRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private JsonNullable accountingBankAccount; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateBankAccountRequest( + JsonNullable accountingBankAccount, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountingBankAccount = accountingBankAccount; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public JsonNullable accountingBankAccount() { + return accountingBankAccount; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateBankAccountRequest withAccountingBankAccount(io.codat.lending.models.shared.AccountingBankAccount accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = JsonNullable.of(accountingBankAccount); + return this; + } + + public CreateBankAccountRequest withAccountingBankAccount(JsonNullable accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = accountingBankAccount; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateBankAccountRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateBankAccountRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateBankAccountRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateBankAccountRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateBankAccountRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateBankAccountRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBankAccountRequest other = (CreateBankAccountRequest) o; + return + java.util.Objects.deepEquals(this.accountingBankAccount, other.accountingBankAccount) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBankAccount, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateBankAccountRequest.class, + "accountingBankAccount", accountingBankAccount, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private JsonNullable accountingBankAccount = JsonNullable.undefined(); + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountingBankAccount(io.codat.lending.models.shared.AccountingBankAccount accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = JsonNullable.of(accountingBankAccount); + return this; + } + + public Builder accountingBankAccount(JsonNullable accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = accountingBankAccount; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateBankAccountRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateBankAccountRequest( + accountingBankAccount, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequestBuilder.java new file mode 100644 index 00000000..e92686a6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateBankAccountRequestBuilder { + + private CreateBankAccountRequest request; + + private final SDKMethodInterfaces.MethodCallCreateBankAccount sdk; + + public CreateBankAccountRequestBuilder(SDKMethodInterfaces.MethodCallCreateBankAccount sdk) { + this.sdk = sdk; + } + + public CreateBankAccountRequestBuilder request(CreateBankAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateBankAccountResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountResponse.java new file mode 100644 index 00000000..70d9bf6a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankAccountResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateBankAccountResponse { + + /** + * Success + */ + private Optional accountingCreateBankAccountResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateBankAccountResponse( + Optional accountingCreateBankAccountResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateBankAccountResponse, "accountingCreateBankAccountResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateBankAccountResponse = accountingCreateBankAccountResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateBankAccountResponse() { + return accountingCreateBankAccountResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateBankAccountResponse withAccountingCreateBankAccountResponse(io.codat.lending.models.shared.AccountingCreateBankAccountResponse accountingCreateBankAccountResponse) { + Utils.checkNotNull(accountingCreateBankAccountResponse, "accountingCreateBankAccountResponse"); + this.accountingCreateBankAccountResponse = Optional.ofNullable(accountingCreateBankAccountResponse); + return this; + } + + /** + * Success + */ + public CreateBankAccountResponse withAccountingCreateBankAccountResponse(Optional accountingCreateBankAccountResponse) { + Utils.checkNotNull(accountingCreateBankAccountResponse, "accountingCreateBankAccountResponse"); + this.accountingCreateBankAccountResponse = accountingCreateBankAccountResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateBankAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateBankAccountResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateBankAccountResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateBankAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateBankAccountResponse 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; + } + CreateBankAccountResponse other = (CreateBankAccountResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateBankAccountResponse, other.accountingCreateBankAccountResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateBankAccountResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateBankAccountResponse.class, + "accountingCreateBankAccountResponse", accountingCreateBankAccountResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateBankAccountResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateBankAccountResponse(io.codat.lending.models.shared.AccountingCreateBankAccountResponse accountingCreateBankAccountResponse) { + Utils.checkNotNull(accountingCreateBankAccountResponse, "accountingCreateBankAccountResponse"); + this.accountingCreateBankAccountResponse = Optional.ofNullable(accountingCreateBankAccountResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateBankAccountResponse(Optional accountingCreateBankAccountResponse) { + Utils.checkNotNull(accountingCreateBankAccountResponse, "accountingCreateBankAccountResponse"); + this.accountingCreateBankAccountResponse = accountingCreateBankAccountResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateBankAccountResponse build() { + return new CreateBankAccountResponse( + accountingCreateBankAccountResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequest.java new file mode 100644 index 00000000..deb6f708 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequest.java @@ -0,0 +1,342 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateBankTransactionsRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional accountingCreateBankTransactions; + + /** + * Unique identifier for an account. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=accountId") + private String accountId; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateBankTransactionsRequest( + Optional accountingCreateBankTransactions, + String accountId, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountingCreateBankTransactions, "accountingCreateBankTransactions"); + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountingCreateBankTransactions = accountingCreateBankTransactions; + this.accountId = accountId; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public Optional accountingCreateBankTransactions() { + return accountingCreateBankTransactions; + } + + /** + * Unique identifier for an account. + */ + public String accountId() { + return accountId; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateBankTransactionsRequest withAccountingCreateBankTransactions(io.codat.lending.models.shared.AccountingCreateBankTransactions accountingCreateBankTransactions) { + Utils.checkNotNull(accountingCreateBankTransactions, "accountingCreateBankTransactions"); + this.accountingCreateBankTransactions = Optional.ofNullable(accountingCreateBankTransactions); + return this; + } + + public CreateBankTransactionsRequest withAccountingCreateBankTransactions(Optional accountingCreateBankTransactions) { + Utils.checkNotNull(accountingCreateBankTransactions, "accountingCreateBankTransactions"); + this.accountingCreateBankTransactions = accountingCreateBankTransactions; + return this; + } + + /** + * Unique identifier for an account. + */ + public CreateBankTransactionsRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateBankTransactionsRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateBankTransactionsRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateBankTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateBankTransactionsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateBankTransactionsRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateBankTransactionsRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBankTransactionsRequest other = (CreateBankTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.accountingCreateBankTransactions, other.accountingCreateBankTransactions) && + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateBankTransactions, + accountId, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateBankTransactionsRequest.class, + "accountingCreateBankTransactions", accountingCreateBankTransactions, + "accountId", accountId, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private Optional accountingCreateBankTransactions = Optional.empty(); + + private String accountId; + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountingCreateBankTransactions(io.codat.lending.models.shared.AccountingCreateBankTransactions accountingCreateBankTransactions) { + Utils.checkNotNull(accountingCreateBankTransactions, "accountingCreateBankTransactions"); + this.accountingCreateBankTransactions = Optional.ofNullable(accountingCreateBankTransactions); + return this; + } + + public Builder accountingCreateBankTransactions(Optional accountingCreateBankTransactions) { + Utils.checkNotNull(accountingCreateBankTransactions, "accountingCreateBankTransactions"); + this.accountingCreateBankTransactions = accountingCreateBankTransactions; + return this; + } + + /** + * Unique identifier for an account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateBankTransactionsRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateBankTransactionsRequest( + accountingCreateBankTransactions, + accountId, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequestBuilder.java new file mode 100644 index 00000000..dcb8e8fa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateBankTransactionsRequestBuilder { + + private CreateBankTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallCreateBankTransactions sdk; + + public CreateBankTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallCreateBankTransactions sdk) { + this.sdk = sdk; + } + + public CreateBankTransactionsRequestBuilder request(CreateBankTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateBankTransactionsResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsResponse.java new file mode 100644 index 00000000..48078dbe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateBankTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateBankTransactionsResponse { + + /** + * Success + */ + private Optional accountingCreateBankTransactionsResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateBankTransactionsResponse( + Optional accountingCreateBankTransactionsResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateBankTransactionsResponse, "accountingCreateBankTransactionsResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateBankTransactionsResponse = accountingCreateBankTransactionsResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateBankTransactionsResponse() { + return accountingCreateBankTransactionsResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateBankTransactionsResponse withAccountingCreateBankTransactionsResponse(io.codat.lending.models.shared.AccountingCreateBankTransactionsResponse accountingCreateBankTransactionsResponse) { + Utils.checkNotNull(accountingCreateBankTransactionsResponse, "accountingCreateBankTransactionsResponse"); + this.accountingCreateBankTransactionsResponse = Optional.ofNullable(accountingCreateBankTransactionsResponse); + return this; + } + + /** + * Success + */ + public CreateBankTransactionsResponse withAccountingCreateBankTransactionsResponse(Optional accountingCreateBankTransactionsResponse) { + Utils.checkNotNull(accountingCreateBankTransactionsResponse, "accountingCreateBankTransactionsResponse"); + this.accountingCreateBankTransactionsResponse = accountingCreateBankTransactionsResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateBankTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateBankTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateBankTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateBankTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateBankTransactionsResponse 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; + } + CreateBankTransactionsResponse other = (CreateBankTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateBankTransactionsResponse, other.accountingCreateBankTransactionsResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateBankTransactionsResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateBankTransactionsResponse.class, + "accountingCreateBankTransactionsResponse", accountingCreateBankTransactionsResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateBankTransactionsResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateBankTransactionsResponse(io.codat.lending.models.shared.AccountingCreateBankTransactionsResponse accountingCreateBankTransactionsResponse) { + Utils.checkNotNull(accountingCreateBankTransactionsResponse, "accountingCreateBankTransactionsResponse"); + this.accountingCreateBankTransactionsResponse = Optional.ofNullable(accountingCreateBankTransactionsResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateBankTransactionsResponse(Optional accountingCreateBankTransactionsResponse) { + Utils.checkNotNull(accountingCreateBankTransactionsResponse, "accountingCreateBankTransactionsResponse"); + this.accountingCreateBankTransactionsResponse = accountingCreateBankTransactionsResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateBankTransactionsResponse build() { + return new CreateBankTransactionsResponse( + accountingCreateBankTransactionsResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyRequestBuilder.java new file mode 100644 index 00000000..982322ba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyRequestBuilder.java @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateCompanyRequestBuilder { + + private Optional request = Optional.empty(); + + private final SDKMethodInterfaces.MethodCallCreateCompany sdk; + + public CreateCompanyRequestBuilder(SDKMethodInterfaces.MethodCallCreateCompany sdk) { + this.sdk = sdk; + } + + public CreateCompanyRequestBuilder request(io.codat.lending.models.shared.CompanyRequestBody request) { + Utils.checkNotNull(request, "request"); + this.request = Optional.of(request); + return this; + } + + public CreateCompanyRequestBuilder request(Optional request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateCompanyResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyResponse.java new file mode 100644 index 00000000..38856712 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateCompanyResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateCompanyResponse { + + /** + * OK + */ + private Optional company; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateCompanyResponse( + Optional company, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(company, "company"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.company = company; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional company() { + return company; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public CreateCompanyResponse withCompany(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public CreateCompanyResponse withCompany(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateCompanyResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateCompanyResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateCompanyResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateCompanyResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateCompanyResponse 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; + } + CreateCompanyResponse other = (CreateCompanyResponse) o; + return + java.util.Objects.deepEquals(this.company, other.company) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateCompanyResponse.class, + "company", company, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional company = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder company(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public Builder company(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateCompanyResponse build() { + return new CreateCompanyResponse( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequest.java new file mode 100644 index 00000000..ebcd3850 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequest.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateConnectionRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional requestBody; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public CreateConnectionRequest( + Optional requestBody, + String companyId) { + Utils.checkNotNull(requestBody, "requestBody"); + Utils.checkNotNull(companyId, "companyId"); + this.requestBody = requestBody; + this.companyId = companyId; + } + + public Optional requestBody() { + return requestBody; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateConnectionRequest withRequestBody(CreateConnectionRequestBody requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public CreateConnectionRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateConnectionRequest 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; + } + CreateConnectionRequest other = (CreateConnectionRequest) o; + return + java.util.Objects.deepEquals(this.requestBody, other.requestBody) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + requestBody, + companyId); + } + + @Override + public String toString() { + return Utils.toString(CreateConnectionRequest.class, + "requestBody", requestBody, + "companyId", companyId); + } + + public final static class Builder { + + private Optional requestBody = Optional.empty(); + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + public Builder requestBody(CreateConnectionRequestBody 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; + } + + public CreateConnectionRequest build() { + return new CreateConnectionRequest( + requestBody, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBody.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBody.java new file mode 100644 index 00000000..10402c1f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBody.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateConnectionRequestBody { + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("platformKey") + private Optional platformKey; + + public CreateConnectionRequestBody( + @JsonProperty("platformKey") Optional platformKey) { + Utils.checkNotNull(platformKey, "platformKey"); + this.platformKey = platformKey; + } + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + public Optional platformKey() { + return platformKey; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + public CreateConnectionRequestBody withPlatformKey(String platformKey) { + Utils.checkNotNull(platformKey, "platformKey"); + this.platformKey = Optional.ofNullable(platformKey); + return this; + } + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + public CreateConnectionRequestBody withPlatformKey(Optional platformKey) { + Utils.checkNotNull(platformKey, "platformKey"); + this.platformKey = platformKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateConnectionRequestBody other = (CreateConnectionRequestBody) o; + return + java.util.Objects.deepEquals(this.platformKey, other.platformKey); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + platformKey); + } + + @Override + public String toString() { + return Utils.toString(CreateConnectionRequestBody.class, + "platformKey", platformKey); + } + + public final static class Builder { + + private Optional platformKey = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + public Builder platformKey(String platformKey) { + Utils.checkNotNull(platformKey, "platformKey"); + this.platformKey = Optional.ofNullable(platformKey); + return this; + } + + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + */ + public Builder platformKey(Optional platformKey) { + Utils.checkNotNull(platformKey, "platformKey"); + this.platformKey = platformKey; + return this; + } + + public CreateConnectionRequestBody build() { + return new CreateConnectionRequestBody( + platformKey); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBuilder.java new file mode 100644 index 00000000..136477c5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateConnectionRequestBuilder { + + private CreateConnectionRequest request; + + private final SDKMethodInterfaces.MethodCallCreateConnection sdk; + + public CreateConnectionRequestBuilder(SDKMethodInterfaces.MethodCallCreateConnection sdk) { + this.sdk = sdk; + } + + public CreateConnectionRequestBuilder request(CreateConnectionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateConnectionResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionResponse.java new file mode 100644 index 00000000..1fd41840 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateConnectionResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateConnectionResponse { + + /** + * OK + */ + private Optional connection; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateConnectionResponse( + Optional connection, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(connection, "connection"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.connection = connection; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional connection() { + return connection; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public CreateConnectionResponse withConnection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public CreateConnectionResponse withConnection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public CreateConnectionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public CreateConnectionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateConnectionResponse 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; + } + CreateConnectionResponse other = (CreateConnectionResponse) o; + return + java.util.Objects.deepEquals(this.connection, other.connection) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateConnectionResponse.class, + "connection", connection, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional connection = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder connection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public Builder connection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateConnectionResponse build() { + return new CreateConnectionResponse( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequest.java new file mode 100644 index 00000000..901ef019 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequest.java @@ -0,0 +1,302 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateDirectCostRequest { + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional directCostPrototype; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateDirectCostRequest( + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional directCostPrototype, + Optional timeoutInMinutes) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directCostPrototype, "directCostPrototype"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.directCostPrototype = directCostPrototype; + this.timeoutInMinutes = timeoutInMinutes; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public Optional directCostPrototype() { + return directCostPrototype; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allow a sync upon push completion. + */ + public CreateDirectCostRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateDirectCostRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateDirectCostRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateDirectCostRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public CreateDirectCostRequest withDirectCostPrototype(io.codat.lending.models.shared.DirectCostPrototype directCostPrototype) { + Utils.checkNotNull(directCostPrototype, "directCostPrototype"); + this.directCostPrototype = Optional.ofNullable(directCostPrototype); + return this; + } + + public CreateDirectCostRequest withDirectCostPrototype(Optional directCostPrototype) { + Utils.checkNotNull(directCostPrototype, "directCostPrototype"); + this.directCostPrototype = directCostPrototype; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateDirectCostRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateDirectCostRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDirectCostRequest other = (CreateDirectCostRequest) o; + return + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directCostPrototype, other.directCostPrototype) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allowSyncOnPushComplete, + companyId, + connectionId, + directCostPrototype, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateDirectCostRequest.class, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "directCostPrototype", directCostPrototype, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional directCostPrototype = Optional.empty(); + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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 Builder directCostPrototype(io.codat.lending.models.shared.DirectCostPrototype directCostPrototype) { + Utils.checkNotNull(directCostPrototype, "directCostPrototype"); + this.directCostPrototype = Optional.ofNullable(directCostPrototype); + return this; + } + + public Builder directCostPrototype(Optional directCostPrototype) { + Utils.checkNotNull(directCostPrototype, "directCostPrototype"); + this.directCostPrototype = directCostPrototype; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateDirectCostRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateDirectCostRequest( + allowSyncOnPushComplete, + companyId, + connectionId, + directCostPrototype, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequestBuilder.java new file mode 100644 index 00000000..203579d2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateDirectCostRequestBuilder { + + private CreateDirectCostRequest request; + + private final SDKMethodInterfaces.MethodCallCreateDirectCost sdk; + + public CreateDirectCostRequestBuilder(SDKMethodInterfaces.MethodCallCreateDirectCost sdk) { + this.sdk = sdk; + } + + public CreateDirectCostRequestBuilder request(CreateDirectCostRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateDirectCostResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostResponse.java new file mode 100644 index 00000000..bf13fc0a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateDirectCostResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateDirectCostResponse { + + /** + * Success + */ + private Optional accountingCreateDirectCostResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateDirectCostResponse( + Optional accountingCreateDirectCostResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateDirectCostResponse, "accountingCreateDirectCostResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateDirectCostResponse = accountingCreateDirectCostResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateDirectCostResponse() { + return accountingCreateDirectCostResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateDirectCostResponse withAccountingCreateDirectCostResponse(io.codat.lending.models.shared.AccountingCreateDirectCostResponse accountingCreateDirectCostResponse) { + Utils.checkNotNull(accountingCreateDirectCostResponse, "accountingCreateDirectCostResponse"); + this.accountingCreateDirectCostResponse = Optional.ofNullable(accountingCreateDirectCostResponse); + return this; + } + + /** + * Success + */ + public CreateDirectCostResponse withAccountingCreateDirectCostResponse(Optional accountingCreateDirectCostResponse) { + Utils.checkNotNull(accountingCreateDirectCostResponse, "accountingCreateDirectCostResponse"); + this.accountingCreateDirectCostResponse = accountingCreateDirectCostResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateDirectCostResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateDirectCostResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateDirectCostResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateDirectCostResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateDirectCostResponse 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; + } + CreateDirectCostResponse other = (CreateDirectCostResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateDirectCostResponse, other.accountingCreateDirectCostResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateDirectCostResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateDirectCostResponse.class, + "accountingCreateDirectCostResponse", accountingCreateDirectCostResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateDirectCostResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateDirectCostResponse(io.codat.lending.models.shared.AccountingCreateDirectCostResponse accountingCreateDirectCostResponse) { + Utils.checkNotNull(accountingCreateDirectCostResponse, "accountingCreateDirectCostResponse"); + this.accountingCreateDirectCostResponse = Optional.ofNullable(accountingCreateDirectCostResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateDirectCostResponse(Optional accountingCreateDirectCostResponse) { + Utils.checkNotNull(accountingCreateDirectCostResponse, "accountingCreateDirectCostResponse"); + this.accountingCreateDirectCostResponse = accountingCreateDirectCostResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateDirectCostResponse build() { + return new CreateDirectCostResponse( + accountingCreateDirectCostResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequest.java new file mode 100644 index 00000000..597304c7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequest.java @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreatePaymentRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private JsonNullable accountingPayment; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreatePaymentRequest( + JsonNullable accountingPayment, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountingPayment = accountingPayment; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public JsonNullable accountingPayment() { + return accountingPayment; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreatePaymentRequest withAccountingPayment(io.codat.lending.models.shared.AccountingPayment accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = JsonNullable.of(accountingPayment); + return this; + } + + public CreatePaymentRequest withAccountingPayment(JsonNullable accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = accountingPayment; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreatePaymentRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreatePaymentRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreatePaymentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreatePaymentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreatePaymentRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreatePaymentRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePaymentRequest other = (CreatePaymentRequest) o; + return + java.util.Objects.deepEquals(this.accountingPayment, other.accountingPayment) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingPayment, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreatePaymentRequest.class, + "accountingPayment", accountingPayment, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private JsonNullable accountingPayment = JsonNullable.undefined(); + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountingPayment(io.codat.lending.models.shared.AccountingPayment accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = JsonNullable.of(accountingPayment); + return this; + } + + public Builder accountingPayment(JsonNullable accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = accountingPayment; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreatePaymentRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreatePaymentRequest( + accountingPayment, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequestBuilder.java new file mode 100644 index 00000000..5e706a82 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreatePaymentRequestBuilder { + + private CreatePaymentRequest request; + + private final SDKMethodInterfaces.MethodCallCreatePayment sdk; + + public CreatePaymentRequestBuilder(SDKMethodInterfaces.MethodCallCreatePayment sdk) { + this.sdk = sdk; + } + + public CreatePaymentRequestBuilder request(CreatePaymentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreatePaymentResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentResponse.java new file mode 100644 index 00000000..6f94d7ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreatePaymentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreatePaymentResponse { + + /** + * Success + */ + private Optional accountingCreatePaymentResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreatePaymentResponse( + Optional accountingCreatePaymentResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreatePaymentResponse, "accountingCreatePaymentResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreatePaymentResponse = accountingCreatePaymentResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreatePaymentResponse() { + return accountingCreatePaymentResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreatePaymentResponse withAccountingCreatePaymentResponse(io.codat.lending.models.shared.AccountingCreatePaymentResponse accountingCreatePaymentResponse) { + Utils.checkNotNull(accountingCreatePaymentResponse, "accountingCreatePaymentResponse"); + this.accountingCreatePaymentResponse = Optional.ofNullable(accountingCreatePaymentResponse); + return this; + } + + /** + * Success + */ + public CreatePaymentResponse withAccountingCreatePaymentResponse(Optional accountingCreatePaymentResponse) { + Utils.checkNotNull(accountingCreatePaymentResponse, "accountingCreatePaymentResponse"); + this.accountingCreatePaymentResponse = accountingCreatePaymentResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreatePaymentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreatePaymentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreatePaymentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreatePaymentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePaymentResponse 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; + } + CreatePaymentResponse other = (CreatePaymentResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreatePaymentResponse, other.accountingCreatePaymentResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreatePaymentResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreatePaymentResponse.class, + "accountingCreatePaymentResponse", accountingCreatePaymentResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreatePaymentResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreatePaymentResponse(io.codat.lending.models.shared.AccountingCreatePaymentResponse accountingCreatePaymentResponse) { + Utils.checkNotNull(accountingCreatePaymentResponse, "accountingCreatePaymentResponse"); + this.accountingCreatePaymentResponse = Optional.ofNullable(accountingCreatePaymentResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreatePaymentResponse(Optional accountingCreatePaymentResponse) { + Utils.checkNotNull(accountingCreatePaymentResponse, "accountingCreatePaymentResponse"); + this.accountingCreatePaymentResponse = accountingCreatePaymentResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreatePaymentResponse build() { + return new CreatePaymentResponse( + accountingCreatePaymentResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequest.java new file mode 100644 index 00000000..3cd2d479 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequest.java @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateSupplierRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private JsonNullable accountingSupplier; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateSupplierRequest( + JsonNullable accountingSupplier, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountingSupplier = accountingSupplier; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public JsonNullable accountingSupplier() { + return accountingSupplier; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateSupplierRequest withAccountingSupplier(io.codat.lending.models.shared.AccountingSupplier accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = JsonNullable.of(accountingSupplier); + return this; + } + + public CreateSupplierRequest withAccountingSupplier(JsonNullable accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = accountingSupplier; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateSupplierRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateSupplierRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateSupplierRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateSupplierRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateSupplierRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateSupplierRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSupplierRequest other = (CreateSupplierRequest) o; + return + java.util.Objects.deepEquals(this.accountingSupplier, other.accountingSupplier) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingSupplier, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateSupplierRequest.class, + "accountingSupplier", accountingSupplier, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private JsonNullable accountingSupplier = JsonNullable.undefined(); + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountingSupplier(io.codat.lending.models.shared.AccountingSupplier accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = JsonNullable.of(accountingSupplier); + return this; + } + + public Builder accountingSupplier(JsonNullable accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = accountingSupplier; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateSupplierRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateSupplierRequest( + accountingSupplier, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequestBuilder.java new file mode 100644 index 00000000..a62f21d7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateSupplierRequestBuilder { + + private CreateSupplierRequest request; + + private final SDKMethodInterfaces.MethodCallCreateSupplier sdk; + + public CreateSupplierRequestBuilder(SDKMethodInterfaces.MethodCallCreateSupplier sdk) { + this.sdk = sdk; + } + + public CreateSupplierRequestBuilder request(CreateSupplierRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateSupplierResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierResponse.java new file mode 100644 index 00000000..5cba771b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateSupplierResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateSupplierResponse { + + /** + * Success + */ + private Optional accountingCreateSupplierResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateSupplierResponse( + Optional accountingCreateSupplierResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateSupplierResponse, "accountingCreateSupplierResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateSupplierResponse = accountingCreateSupplierResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateSupplierResponse() { + return accountingCreateSupplierResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateSupplierResponse withAccountingCreateSupplierResponse(io.codat.lending.models.shared.AccountingCreateSupplierResponse accountingCreateSupplierResponse) { + Utils.checkNotNull(accountingCreateSupplierResponse, "accountingCreateSupplierResponse"); + this.accountingCreateSupplierResponse = Optional.ofNullable(accountingCreateSupplierResponse); + return this; + } + + /** + * Success + */ + public CreateSupplierResponse withAccountingCreateSupplierResponse(Optional accountingCreateSupplierResponse) { + Utils.checkNotNull(accountingCreateSupplierResponse, "accountingCreateSupplierResponse"); + this.accountingCreateSupplierResponse = accountingCreateSupplierResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateSupplierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateSupplierResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateSupplierResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateSupplierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateSupplierResponse 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; + } + CreateSupplierResponse other = (CreateSupplierResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateSupplierResponse, other.accountingCreateSupplierResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateSupplierResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateSupplierResponse.class, + "accountingCreateSupplierResponse", accountingCreateSupplierResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateSupplierResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateSupplierResponse(io.codat.lending.models.shared.AccountingCreateSupplierResponse accountingCreateSupplierResponse) { + Utils.checkNotNull(accountingCreateSupplierResponse, "accountingCreateSupplierResponse"); + this.accountingCreateSupplierResponse = Optional.ofNullable(accountingCreateSupplierResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateSupplierResponse(Optional accountingCreateSupplierResponse) { + Utils.checkNotNull(accountingCreateSupplierResponse, "accountingCreateSupplierResponse"); + this.accountingCreateSupplierResponse = accountingCreateSupplierResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateSupplierResponse build() { + return new CreateSupplierResponse( + accountingCreateSupplierResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequest.java new file mode 100644 index 00000000..72b62cd9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequest.java @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreateTransferRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private JsonNullable accountingTransfer; + + /** + * Allow a sync upon push completion. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=allowSyncOnPushComplete") + private Optional allowSyncOnPushComplete; + + /** + * 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; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public CreateTransferRequest( + JsonNullable accountingTransfer, + Optional allowSyncOnPushComplete, + String companyId, + String connectionId, + Optional timeoutInMinutes) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.accountingTransfer = accountingTransfer; + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + this.companyId = companyId; + this.connectionId = connectionId; + this.timeoutInMinutes = timeoutInMinutes; + } + + public JsonNullable accountingTransfer() { + return accountingTransfer; + } + + /** + * Allow a sync upon push completion. + */ + public Optional allowSyncOnPushComplete() { + return allowSyncOnPushComplete; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + public CreateTransferRequest withAccountingTransfer(io.codat.lending.models.shared.AccountingTransfer accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = JsonNullable.of(accountingTransfer); + return this; + } + + public CreateTransferRequest withAccountingTransfer(JsonNullable accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = accountingTransfer; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateTransferRequest withAllowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public CreateTransferRequest withAllowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + return this; + } + + /** + * Unique identifier for a company. + */ + public CreateTransferRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public CreateTransferRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateTransferRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public CreateTransferRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransferRequest other = (CreateTransferRequest) o; + return + java.util.Objects.deepEquals(this.accountingTransfer, other.accountingTransfer) && + java.util.Objects.deepEquals(this.allowSyncOnPushComplete, other.allowSyncOnPushComplete) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingTransfer, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(CreateTransferRequest.class, + "accountingTransfer", accountingTransfer, + "allowSyncOnPushComplete", allowSyncOnPushComplete, + "companyId", companyId, + "connectionId", connectionId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private JsonNullable accountingTransfer = JsonNullable.undefined(); + + private Optional allowSyncOnPushComplete; + + private String companyId; + + private String connectionId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountingTransfer(io.codat.lending.models.shared.AccountingTransfer accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = JsonNullable.of(accountingTransfer); + return this; + } + + public Builder accountingTransfer(JsonNullable accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = accountingTransfer; + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(boolean allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = Optional.ofNullable(allowSyncOnPushComplete); + return this; + } + + /** + * Allow a sync upon push completion. + */ + public Builder allowSyncOnPushComplete(Optional allowSyncOnPushComplete) { + Utils.checkNotNull(allowSyncOnPushComplete, "allowSyncOnPushComplete"); + this.allowSyncOnPushComplete = allowSyncOnPushComplete; + 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; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public CreateTransferRequest build() { + if (allowSyncOnPushComplete == null) { + allowSyncOnPushComplete = _SINGLETON_VALUE_AllowSyncOnPushComplete.value(); + } + return new CreateTransferRequest( + accountingTransfer, + allowSyncOnPushComplete, + companyId, + connectionId, + timeoutInMinutes); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_AllowSyncOnPushComplete = + new LazySingletonValue<>( + "allowSyncOnPushComplete", + "true", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequestBuilder.java new file mode 100644 index 00000000..257d8795 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class CreateTransferRequestBuilder { + + private CreateTransferRequest request; + + private final SDKMethodInterfaces.MethodCallCreateTransfer sdk; + + public CreateTransferRequestBuilder(SDKMethodInterfaces.MethodCallCreateTransfer sdk) { + this.sdk = sdk; + } + + public CreateTransferRequestBuilder request(CreateTransferRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CreateTransferResponse call() throws Exception { + return sdk.create( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferResponse.java new file mode 100644 index 00000000..f9bacc0f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/CreateTransferResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreateTransferResponse { + + /** + * Success + */ + private Optional accountingCreateTransferResponse; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public CreateTransferResponse( + Optional accountingCreateTransferResponse, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreateTransferResponse, "accountingCreateTransferResponse"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreateTransferResponse = accountingCreateTransferResponse; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreateTransferResponse() { + return accountingCreateTransferResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public CreateTransferResponse withAccountingCreateTransferResponse(io.codat.lending.models.shared.AccountingCreateTransferResponse accountingCreateTransferResponse) { + Utils.checkNotNull(accountingCreateTransferResponse, "accountingCreateTransferResponse"); + this.accountingCreateTransferResponse = Optional.ofNullable(accountingCreateTransferResponse); + return this; + } + + /** + * Success + */ + public CreateTransferResponse withAccountingCreateTransferResponse(Optional accountingCreateTransferResponse) { + Utils.checkNotNull(accountingCreateTransferResponse, "accountingCreateTransferResponse"); + this.accountingCreateTransferResponse = accountingCreateTransferResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public CreateTransferResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public CreateTransferResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public CreateTransferResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreateTransferResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreateTransferResponse 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; + } + CreateTransferResponse other = (CreateTransferResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreateTransferResponse, other.accountingCreateTransferResponse) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreateTransferResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreateTransferResponse.class, + "accountingCreateTransferResponse", accountingCreateTransferResponse, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreateTransferResponse = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreateTransferResponse(io.codat.lending.models.shared.AccountingCreateTransferResponse accountingCreateTransferResponse) { + Utils.checkNotNull(accountingCreateTransferResponse, "accountingCreateTransferResponse"); + this.accountingCreateTransferResponse = Optional.ofNullable(accountingCreateTransferResponse); + return this; + } + + /** + * Success + */ + public Builder accountingCreateTransferResponse(Optional accountingCreateTransferResponse) { + Utils.checkNotNull(accountingCreateTransferResponse, "accountingCreateTransferResponse"); + this.accountingCreateTransferResponse = accountingCreateTransferResponse; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 CreateTransferResponse build() { + return new CreateTransferResponse( + accountingCreateTransferResponse, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequest.java new file mode 100644 index 00000000..5dacd120 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DeleteCompanyRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public DeleteCompanyRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public DeleteCompanyRequest 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; + } + DeleteCompanyRequest other = (DeleteCompanyRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(DeleteCompanyRequest.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 DeleteCompanyRequest build() { + return new DeleteCompanyRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequestBuilder.java new file mode 100644 index 00000000..81b59282 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DeleteCompanyRequestBuilder { + + private DeleteCompanyRequest request; + + private final SDKMethodInterfaces.MethodCallDeleteCompany sdk; + + public DeleteCompanyRequestBuilder(SDKMethodInterfaces.MethodCallDeleteCompany sdk) { + this.sdk = sdk; + } + + public DeleteCompanyRequestBuilder request(DeleteCompanyRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DeleteCompanyResponse call() throws Exception { + return sdk.delete( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyResponse.java new file mode 100644 index 00000000..c778649b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteCompanyResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteCompanyResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DeleteCompanyResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteCompanyResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DeleteCompanyResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DeleteCompanyResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteCompanyResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteCompanyResponse 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; + } + DeleteCompanyResponse other = (DeleteCompanyResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteCompanyResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DeleteCompanyResponse build() { + return new DeleteCompanyResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequest.java new file mode 100644 index 00000000..8bcd9321 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DeleteConnectionRequest { + + /** + * 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; + + public DeleteConnectionRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public DeleteConnectionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DeleteConnectionRequest 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; + } + DeleteConnectionRequest other = (DeleteConnectionRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(DeleteConnectionRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public DeleteConnectionRequest build() { + return new DeleteConnectionRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequestBuilder.java new file mode 100644 index 00000000..079bdb9d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DeleteConnectionRequestBuilder { + + private DeleteConnectionRequest request; + + private final SDKMethodInterfaces.MethodCallDeleteConnection sdk; + + public DeleteConnectionRequestBuilder(SDKMethodInterfaces.MethodCallDeleteConnection sdk) { + this.sdk = sdk; + } + + public DeleteConnectionRequestBuilder request(DeleteConnectionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DeleteConnectionResponse call() throws Exception { + return sdk.delete( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionResponse.java new file mode 100644 index 00000000..c9001369 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DeleteConnectionResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DeleteConnectionResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DeleteConnectionResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DeleteConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DeleteConnectionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DeleteConnectionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteConnectionResponse 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; + } + DeleteConnectionResponse other = (DeleteConnectionResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteConnectionResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DeleteConnectionResponse build() { + return new DeleteConnectionResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequest.java new file mode 100644 index 00000000..d3cbded9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingBillAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * Unique identifier for a bill. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billId") + private String billId; + + /** + * 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; + + public DownloadAccountingBillAttachmentRequest( + String attachmentId, + String billId, + String companyId, + String connectionId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(billId, "billId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.attachmentId = attachmentId; + this.billId = billId; + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a bill. + */ + public String billId() { + return billId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingBillAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a bill. + */ + public DownloadAccountingBillAttachmentRequest withBillId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingBillAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingBillAttachmentRequest 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; + } + DownloadAccountingBillAttachmentRequest other = (DownloadAccountingBillAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.billId, other.billId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + billId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingBillAttachmentRequest.class, + "attachmentId", attachmentId, + "billId", billId, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String attachmentId; + + private String billId; + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a bill. + */ + public Builder billId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + 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 DownloadAccountingBillAttachmentRequest build() { + return new DownloadAccountingBillAttachmentRequest( + attachmentId, + billId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequestBuilder.java new file mode 100644 index 00000000..a2aa8c24 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingBillAttachmentRequestBuilder { + + private DownloadAccountingBillAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingBillAttachment sdk; + + public DownloadAccountingBillAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingBillAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingBillAttachmentRequestBuilder request(DownloadAccountingBillAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingBillAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentResponse.java new file mode 100644 index 00000000..8fce8c74 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingBillAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingBillAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingBillAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingBillAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingBillAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingBillAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingBillAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingBillAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingBillAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingBillAttachmentResponse 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; + } + DownloadAccountingBillAttachmentResponse other = (DownloadAccountingBillAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingBillAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingBillAttachmentResponse build() { + return new DownloadAccountingBillAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequest.java new file mode 100644 index 00000000..4f85ed7e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingCustomerAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a customer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=customerId") + private String customerId; + + public DownloadAccountingCustomerAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String customerId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(customerId, "customerId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.customerId = customerId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a customer. + */ + public String customerId() { + return customerId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingCustomerAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingCustomerAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingCustomerAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public DownloadAccountingCustomerAttachmentRequest withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingCustomerAttachmentRequest other = (DownloadAccountingCustomerAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.customerId, other.customerId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + customerId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingCustomerAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "customerId", customerId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String customerId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a customer. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + public DownloadAccountingCustomerAttachmentRequest build() { + return new DownloadAccountingCustomerAttachmentRequest( + attachmentId, + companyId, + connectionId, + customerId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequestBuilder.java new file mode 100644 index 00000000..6d39ebdb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingCustomerAttachmentRequestBuilder { + + private DownloadAccountingCustomerAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingCustomerAttachment sdk; + + public DownloadAccountingCustomerAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingCustomerAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingCustomerAttachmentRequestBuilder request(DownloadAccountingCustomerAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingCustomerAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentResponse.java new file mode 100644 index 00000000..df1740b1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingCustomerAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingCustomerAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingCustomerAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingCustomerAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingCustomerAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingCustomerAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingCustomerAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingCustomerAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingCustomerAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingCustomerAttachmentResponse 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; + } + DownloadAccountingCustomerAttachmentResponse other = (DownloadAccountingCustomerAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingCustomerAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingCustomerAttachmentResponse build() { + return new DownloadAccountingCustomerAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequest.java new file mode 100644 index 00000000..ad35e0fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingDirectCostAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a direct cost. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directCostId") + private String directCostId; + + public DownloadAccountingDirectCostAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String directCostId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directCostId, "directCostId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.directCostId = directCostId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct cost. + */ + public String directCostId() { + return directCostId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingDirectCostAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingDirectCostAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingDirectCostAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public DownloadAccountingDirectCostAttachmentRequest withDirectCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingDirectCostAttachmentRequest other = (DownloadAccountingDirectCostAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directCostId, other.directCostId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + directCostId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingDirectCostAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "directCostId", directCostId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String directCostId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a direct cost. + */ + public Builder directCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + public DownloadAccountingDirectCostAttachmentRequest build() { + return new DownloadAccountingDirectCostAttachmentRequest( + attachmentId, + companyId, + connectionId, + directCostId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequestBuilder.java new file mode 100644 index 00000000..ac7805e4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingDirectCostAttachmentRequestBuilder { + + private DownloadAccountingDirectCostAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingDirectCostAttachment sdk; + + public DownloadAccountingDirectCostAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingDirectCostAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingDirectCostAttachmentRequestBuilder request(DownloadAccountingDirectCostAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingDirectCostAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentResponse.java new file mode 100644 index 00000000..7586d22f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectCostAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingDirectCostAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingDirectCostAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingDirectCostAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingDirectCostAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingDirectCostAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingDirectCostAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingDirectCostAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingDirectCostAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingDirectCostAttachmentResponse 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; + } + DownloadAccountingDirectCostAttachmentResponse other = (DownloadAccountingDirectCostAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingDirectCostAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingDirectCostAttachmentResponse build() { + return new DownloadAccountingDirectCostAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.java new file mode 100644 index 00000000..dfc5608e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingDirectIncomeAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a direct income. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directIncomeId") + private String directIncomeId; + + public DownloadAccountingDirectIncomeAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String directIncomeId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.directIncomeId = directIncomeId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct income. + */ + public String directIncomeId() { + return directIncomeId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingDirectIncomeAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingDirectIncomeAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingDirectIncomeAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public DownloadAccountingDirectIncomeAttachmentRequest withDirectIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingDirectIncomeAttachmentRequest other = (DownloadAccountingDirectIncomeAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directIncomeId, other.directIncomeId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + directIncomeId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingDirectIncomeAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "directIncomeId", directIncomeId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String directIncomeId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a direct income. + */ + public Builder directIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + public DownloadAccountingDirectIncomeAttachmentRequest build() { + return new DownloadAccountingDirectIncomeAttachmentRequest( + attachmentId, + companyId, + connectionId, + directIncomeId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequestBuilder.java new file mode 100644 index 00000000..e8411368 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingDirectIncomeAttachmentRequestBuilder { + + private DownloadAccountingDirectIncomeAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingDirectIncomeAttachment sdk; + + public DownloadAccountingDirectIncomeAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingDirectIncomeAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingDirectIncomeAttachmentRequestBuilder request(DownloadAccountingDirectIncomeAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingDirectIncomeAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.java new file mode 100644 index 00000000..c9f3fba9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingDirectIncomeAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingDirectIncomeAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingDirectIncomeAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingDirectIncomeAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingDirectIncomeAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingDirectIncomeAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingDirectIncomeAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingDirectIncomeAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingDirectIncomeAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingDirectIncomeAttachmentResponse 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; + } + DownloadAccountingDirectIncomeAttachmentResponse other = (DownloadAccountingDirectIncomeAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingDirectIncomeAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingDirectIncomeAttachmentResponse build() { + return new DownloadAccountingDirectIncomeAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequest.java new file mode 100644 index 00000000..12f42a31 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingInvoiceAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for an invoice. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invoiceId") + private String invoiceId; + + public DownloadAccountingInvoiceAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String invoiceId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(invoiceId, "invoiceId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.invoiceId = invoiceId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for an invoice. + */ + public String invoiceId() { + return invoiceId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingInvoiceAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingInvoiceAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingInvoiceAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public DownloadAccountingInvoiceAttachmentRequest withInvoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingInvoiceAttachmentRequest other = (DownloadAccountingInvoiceAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.invoiceId, other.invoiceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + invoiceId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingInvoiceAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "invoiceId", invoiceId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String invoiceId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for an invoice. + */ + public Builder invoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + public DownloadAccountingInvoiceAttachmentRequest build() { + return new DownloadAccountingInvoiceAttachmentRequest( + attachmentId, + companyId, + connectionId, + invoiceId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequestBuilder.java new file mode 100644 index 00000000..8f8d0db3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingInvoiceAttachmentRequestBuilder { + + private DownloadAccountingInvoiceAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingInvoiceAttachment sdk; + + public DownloadAccountingInvoiceAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingInvoiceAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingInvoiceAttachmentRequestBuilder request(DownloadAccountingInvoiceAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingInvoiceAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentResponse.java new file mode 100644 index 00000000..e265e7e6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoiceAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingInvoiceAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingInvoiceAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingInvoiceAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingInvoiceAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingInvoiceAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingInvoiceAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingInvoiceAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingInvoiceAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingInvoiceAttachmentResponse 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; + } + DownloadAccountingInvoiceAttachmentResponse other = (DownloadAccountingInvoiceAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingInvoiceAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingInvoiceAttachmentResponse build() { + return new DownloadAccountingInvoiceAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequest.java new file mode 100644 index 00000000..65e19f91 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingInvoicePdfRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for an invoice. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invoiceId") + private String invoiceId; + + public DownloadAccountingInvoicePdfRequest( + String companyId, + String invoiceId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(invoiceId, "invoiceId"); + this.companyId = companyId; + this.invoiceId = invoiceId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for an invoice. + */ + public String invoiceId() { + return invoiceId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingInvoicePdfRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public DownloadAccountingInvoicePdfRequest withInvoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingInvoicePdfRequest other = (DownloadAccountingInvoicePdfRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.invoiceId, other.invoiceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + invoiceId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingInvoicePdfRequest.class, + "companyId", companyId, + "invoiceId", invoiceId); + } + + public final static class Builder { + + private String companyId; + + private String invoiceId; + + 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; + } + + /** + * Unique identifier for an invoice. + */ + public Builder invoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + public DownloadAccountingInvoicePdfRequest build() { + return new DownloadAccountingInvoicePdfRequest( + companyId, + invoiceId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequestBuilder.java new file mode 100644 index 00000000..6d8a4223 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingInvoicePdfRequestBuilder { + + private DownloadAccountingInvoicePdfRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingInvoicePdf sdk; + + public DownloadAccountingInvoicePdfRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingInvoicePdf sdk) { + this.sdk = sdk; + } + + public DownloadAccountingInvoicePdfRequestBuilder request(DownloadAccountingInvoicePdfRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingInvoicePdfResponse call() throws Exception { + return sdk.downloadPdf( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfResponse.java new file mode 100644 index 00000000..f9c55fc6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingInvoicePdfResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingInvoicePdfResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingInvoicePdfResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingInvoicePdfResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingInvoicePdfResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingInvoicePdfResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingInvoicePdfResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingInvoicePdfResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingInvoicePdfResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingInvoicePdfResponse 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; + } + DownloadAccountingInvoicePdfResponse other = (DownloadAccountingInvoicePdfResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingInvoicePdfResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingInvoicePdfResponse build() { + return new DownloadAccountingInvoicePdfResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequest.java new file mode 100644 index 00000000..c131d58d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadAccountingSupplierAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a supplier. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=supplierId") + private String supplierId; + + public DownloadAccountingSupplierAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String supplierId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(supplierId, "supplierId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.supplierId = supplierId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a supplier. + */ + public String supplierId() { + return supplierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public DownloadAccountingSupplierAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public DownloadAccountingSupplierAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public DownloadAccountingSupplierAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a supplier. + */ + public DownloadAccountingSupplierAttachmentRequest withSupplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadAccountingSupplierAttachmentRequest other = (DownloadAccountingSupplierAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.supplierId, other.supplierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + supplierId); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingSupplierAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "supplierId", supplierId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String supplierId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a supplier. + */ + public Builder supplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + public DownloadAccountingSupplierAttachmentRequest build() { + return new DownloadAccountingSupplierAttachmentRequest( + attachmentId, + companyId, + connectionId, + supplierId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequestBuilder.java new file mode 100644 index 00000000..8b504730 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadAccountingSupplierAttachmentRequestBuilder { + + private DownloadAccountingSupplierAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadAccountingSupplierAttachment sdk; + + public DownloadAccountingSupplierAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallDownloadAccountingSupplierAttachment sdk) { + this.sdk = sdk; + } + + public DownloadAccountingSupplierAttachmentRequestBuilder request(DownloadAccountingSupplierAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadAccountingSupplierAttachmentResponse call() throws Exception { + return sdk.downloadAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentResponse.java new file mode 100644 index 00000000..9e8a7874 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadAccountingSupplierAttachmentResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadAccountingSupplierAttachmentResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadAccountingSupplierAttachmentResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadAccountingSupplierAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadAccountingSupplierAttachmentResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadAccountingSupplierAttachmentResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingSupplierAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public DownloadAccountingSupplierAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadAccountingSupplierAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadAccountingSupplierAttachmentResponse 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; + } + DownloadAccountingSupplierAttachmentResponse other = (DownloadAccountingSupplierAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadAccountingSupplierAttachmentResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadAccountingSupplierAttachmentResponse build() { + return new DownloadAccountingSupplierAttachmentResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequest.java new file mode 100644 index 00000000..e443c991 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class DownloadExcelReportRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * The type of report you want to generate and download. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportType") + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + public DownloadExcelReportRequest( + String companyId, + io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(reportType, "reportType"); + this.companyId = companyId; + this.reportType = reportType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * The type of report you want to generate and download. + */ + public io.codat.lending.models.shared.ExcelReportTypes reportType() { + return reportType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public DownloadExcelReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * The type of report you want to generate and download. + */ + public DownloadExcelReportRequest withReportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadExcelReportRequest other = (DownloadExcelReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.reportType, other.reportType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + reportType); + } + + @Override + public String toString() { + return Utils.toString(DownloadExcelReportRequest.class, + "companyId", companyId, + "reportType", reportType); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + 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; + } + + /** + * The type of report you want to generate and download. + */ + public Builder reportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + public DownloadExcelReportRequest build() { + return new DownloadExcelReportRequest( + companyId, + reportType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequestBuilder.java new file mode 100644 index 00000000..9a452d6d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadExcelReportRequestBuilder { + + private DownloadExcelReportRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadExcelReport sdk; + + public DownloadExcelReportRequestBuilder(SDKMethodInterfaces.MethodCallDownloadExcelReport sdk) { + this.sdk = sdk; + } + + public DownloadExcelReportRequestBuilder request(DownloadExcelReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadExcelReportResponse call() throws Exception { + return sdk.download( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportResponse.java new file mode 100644 index 00000000..14292624 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadExcelReportResponse.java @@ -0,0 +1,268 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadExcelReportResponse { + + private Optional body; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadExcelReportResponse( + Optional body, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(body, "body"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.body = body; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + public Optional body() { + return body; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + public DownloadExcelReportResponse withBody(byte[] body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + public DownloadExcelReportResponse withBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * HTTP response content type for this operation + */ + public DownloadExcelReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public DownloadExcelReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public DownloadExcelReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadExcelReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadExcelReportResponse 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; + } + DownloadExcelReportResponse other = (DownloadExcelReportResponse) o; + return + java.util.Objects.deepEquals(this.body, other.body) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + body, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadExcelReportResponse.class, + "body", body, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional body = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + public Builder body(byte[] body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + public Builder body(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadExcelReportResponse build() { + return new DownloadExcelReportResponse( + body, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequest.java new file mode 100644 index 00000000..74d99a9b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequest.java @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DownloadFilesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Only download files uploaded on this date. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=date") + private Optional date; + + public DownloadFilesRequest( + String companyId, + Optional date) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(date, "date"); + this.companyId = companyId; + this.date = date; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Only download files uploaded on this date. + */ + public Optional date() { + return date; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public DownloadFilesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Only download files uploaded on this date. + */ + public DownloadFilesRequest withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * Only download files uploaded on this date. + */ + public DownloadFilesRequest withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DownloadFilesRequest other = (DownloadFilesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.date, other.date); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + date); + } + + @Override + public String toString() { + return Utils.toString(DownloadFilesRequest.class, + "companyId", companyId, + "date", date); + } + + public final static class Builder { + + private String companyId; + + private Optional date = Optional.empty(); + + 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; + } + + /** + * Only download files uploaded on this date. + */ + public Builder date(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * Only download files uploaded on this date. + */ + public Builder date(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + public DownloadFilesRequest build() { + return new DownloadFilesRequest( + companyId, + date); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequestBuilder.java new file mode 100644 index 00000000..ee2dcd3b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class DownloadFilesRequestBuilder { + + private DownloadFilesRequest request; + + private final SDKMethodInterfaces.MethodCallDownloadFiles sdk; + + public DownloadFilesRequestBuilder(SDKMethodInterfaces.MethodCallDownloadFiles sdk) { + this.sdk = sdk; + } + + public DownloadFilesRequestBuilder request(DownloadFilesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public DownloadFilesResponse call() throws Exception { + return sdk.download( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesResponse.java new file mode 100644 index 00000000..19b55994 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/DownloadFilesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class DownloadFilesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Success + */ + private Optional data; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public DownloadFilesResponse( + String contentType, + Optional data, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.data = data; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Success + */ + public Optional data() { + return data; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public DownloadFilesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Success + */ + public DownloadFilesResponse withData(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public DownloadFilesResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * The request made is not valid. + */ + public DownloadFilesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public DownloadFilesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DownloadFilesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DownloadFilesResponse 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; + } + DownloadFilesResponse other = (DownloadFilesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DownloadFilesResponse.class, + "contentType", contentType, + "data", data, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional data = Optional.empty(); + + private Optional errorMessage = 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 data(InputStream data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Success + */ + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DownloadFilesResponse build() { + return new DownloadFilesResponse( + contentType, + data, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequest.java new file mode 100644 index 00000000..ea69c74e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GenerateExcelReportRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * The type of report you want to generate and download. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportType") + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + public GenerateExcelReportRequest( + String companyId, + io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(reportType, "reportType"); + this.companyId = companyId; + this.reportType = reportType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * The type of report you want to generate and download. + */ + public io.codat.lending.models.shared.ExcelReportTypes reportType() { + return reportType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GenerateExcelReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * The type of report you want to generate and download. + */ + public GenerateExcelReportRequest withReportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateExcelReportRequest other = (GenerateExcelReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.reportType, other.reportType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + reportType); + } + + @Override + public String toString() { + return Utils.toString(GenerateExcelReportRequest.class, + "companyId", companyId, + "reportType", reportType); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + 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; + } + + /** + * The type of report you want to generate and download. + */ + public Builder reportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + public GenerateExcelReportRequest build() { + return new GenerateExcelReportRequest( + companyId, + reportType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequestBuilder.java new file mode 100644 index 00000000..be13bdd2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GenerateExcelReportRequestBuilder { + + private GenerateExcelReportRequest request; + + private final SDKMethodInterfaces.MethodCallGenerateExcelReport sdk; + + public GenerateExcelReportRequestBuilder(SDKMethodInterfaces.MethodCallGenerateExcelReport sdk) { + this.sdk = sdk; + } + + public GenerateExcelReportRequestBuilder request(GenerateExcelReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GenerateExcelReportResponse call() throws Exception { + return sdk.generate( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportResponse.java new file mode 100644 index 00000000..1d24cc0a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateExcelReportResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GenerateExcelReportResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional excelStatus; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GenerateExcelReportResponse( + String contentType, + Optional errorMessage, + Optional excelStatus, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(excelStatus, "excelStatus"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.excelStatus = excelStatus; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional excelStatus() { + return excelStatus; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GenerateExcelReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GenerateExcelReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GenerateExcelReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GenerateExcelReportResponse withExcelStatus(io.codat.lending.models.shared.ExcelStatus excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = Optional.ofNullable(excelStatus); + return this; + } + + /** + * OK + */ + public GenerateExcelReportResponse withExcelStatus(Optional excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = excelStatus; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GenerateExcelReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GenerateExcelReportResponse 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; + } + GenerateExcelReportResponse other = (GenerateExcelReportResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.excelStatus, other.excelStatus) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + excelStatus, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GenerateExcelReportResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "excelStatus", excelStatus, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional excelStatus = 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; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder excelStatus(io.codat.lending.models.shared.ExcelStatus excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = Optional.ofNullable(excelStatus); + return this; + } + + /** + * OK + */ + public Builder excelStatus(Optional excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = excelStatus; + 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 GenerateExcelReportResponse build() { + return new GenerateExcelReportResponse( + contentType, + errorMessage, + excelStatus, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequest.java new file mode 100644 index 00000000..bf256b45 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GenerateLoanSummaryRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Data source type. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sourceType") + private SourceType sourceType; + + public GenerateLoanSummaryRequest( + String companyId, + SourceType sourceType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(sourceType, "sourceType"); + this.companyId = companyId; + this.sourceType = sourceType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Data source type. + */ + public SourceType sourceType() { + return sourceType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GenerateLoanSummaryRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Data source type. + */ + public GenerateLoanSummaryRequest withSourceType(SourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateLoanSummaryRequest other = (GenerateLoanSummaryRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + sourceType); + } + + @Override + public String toString() { + return Utils.toString(GenerateLoanSummaryRequest.class, + "companyId", companyId, + "sourceType", sourceType); + } + + public final static class Builder { + + private String companyId; + + private SourceType sourceType; + + 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; + } + + /** + * Data source type. + */ + public Builder sourceType(SourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + public GenerateLoanSummaryRequest build() { + return new GenerateLoanSummaryRequest( + companyId, + sourceType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequestBuilder.java new file mode 100644 index 00000000..c6dadaac --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GenerateLoanSummaryRequestBuilder { + + private GenerateLoanSummaryRequest request; + + private final SDKMethodInterfaces.MethodCallGenerateLoanSummary sdk; + + public GenerateLoanSummaryRequestBuilder(SDKMethodInterfaces.MethodCallGenerateLoanSummary sdk) { + this.sdk = sdk; + } + + public GenerateLoanSummaryRequestBuilder request(GenerateLoanSummaryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GenerateLoanSummaryResponse call() throws Exception { + return sdk.generateLoanSummary( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryResponse.java new file mode 100644 index 00000000..2d713339 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanSummaryResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GenerateLoanSummaryResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GenerateLoanSummaryResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GenerateLoanSummaryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GenerateLoanSummaryResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GenerateLoanSummaryResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GenerateLoanSummaryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GenerateLoanSummaryResponse 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; + } + GenerateLoanSummaryResponse other = (GenerateLoanSummaryResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GenerateLoanSummaryResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GenerateLoanSummaryResponse build() { + return new GenerateLoanSummaryResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequest.java new file mode 100644 index 00000000..5ebf236d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GenerateLoanTransactionsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Data source type. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sourceType") + private QueryParamSourceType sourceType; + + public GenerateLoanTransactionsRequest( + String companyId, + QueryParamSourceType sourceType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(sourceType, "sourceType"); + this.companyId = companyId; + this.sourceType = sourceType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Data source type. + */ + public QueryParamSourceType sourceType() { + return sourceType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GenerateLoanTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Data source type. + */ + public GenerateLoanTransactionsRequest withSourceType(QueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateLoanTransactionsRequest other = (GenerateLoanTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + sourceType); + } + + @Override + public String toString() { + return Utils.toString(GenerateLoanTransactionsRequest.class, + "companyId", companyId, + "sourceType", sourceType); + } + + public final static class Builder { + + private String companyId; + + private QueryParamSourceType sourceType; + + 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; + } + + /** + * Data source type. + */ + public Builder sourceType(QueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + public GenerateLoanTransactionsRequest build() { + return new GenerateLoanTransactionsRequest( + companyId, + sourceType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequestBuilder.java new file mode 100644 index 00000000..ff9e6097 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GenerateLoanTransactionsRequestBuilder { + + private GenerateLoanTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallGenerateLoanTransactions sdk; + + public GenerateLoanTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallGenerateLoanTransactions sdk) { + this.sdk = sdk; + } + + public GenerateLoanTransactionsRequestBuilder request(GenerateLoanTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GenerateLoanTransactionsResponse call() throws Exception { + return sdk.generateLoanTransactions( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsResponse.java new file mode 100644 index 00000000..e214fdcd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GenerateLoanTransactionsResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GenerateLoanTransactionsResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GenerateLoanTransactionsResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GenerateLoanTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GenerateLoanTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GenerateLoanTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GenerateLoanTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GenerateLoanTransactionsResponse 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; + } + GenerateLoanTransactionsResponse other = (GenerateLoanTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GenerateLoanTransactionsResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GenerateLoanTransactionsResponse build() { + return new GenerateLoanTransactionsResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequest.java new file mode 100644 index 00000000..0b6c1fc2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingAccountRequest { + + /** + * 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; + + public GetAccountingAccountRequest( + String accountId, + String companyId) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(companyId, "companyId"); + this.accountId = accountId; + this.companyId = companyId; + } + + /** + * Unique identifier for an account. + */ + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account. + */ + public GetAccountingAccountRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingAccountRequest 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; + } + GetAccountingAccountRequest other = (GetAccountingAccountRequest) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAccountRequest.class, + "accountId", accountId, + "companyId", companyId); + } + + public final static class Builder { + + private String accountId; + + private String companyId; + + 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; + } + + public GetAccountingAccountRequest build() { + return new GetAccountingAccountRequest( + accountId, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequestBuilder.java new file mode 100644 index 00000000..1d25ab04 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingAccountRequestBuilder { + + private GetAccountingAccountRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingAccount sdk; + + public GetAccountingAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingAccount sdk) { + this.sdk = sdk; + } + + public GetAccountingAccountRequestBuilder request(GetAccountingAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingAccountResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountResponse.java new file mode 100644 index 00000000..ddac4d3e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingAccountResponse { + + /** + * Success + */ + private JsonNullable accountingAccount; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingAccountResponse( + JsonNullable accountingAccount, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAccount, "accountingAccount"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAccount = accountingAccount; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAccount() { + return accountingAccount; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingAccountResponse withAccountingAccount(io.codat.lending.models.shared.AccountingAccount accountingAccount) { + Utils.checkNotNull(accountingAccount, "accountingAccount"); + this.accountingAccount = JsonNullable.of(accountingAccount); + return this; + } + + /** + * Success + */ + public GetAccountingAccountResponse withAccountingAccount(JsonNullable accountingAccount) { + Utils.checkNotNull(accountingAccount, "accountingAccount"); + this.accountingAccount = accountingAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAccountResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAccountResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingAccountResponse 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; + } + GetAccountingAccountResponse other = (GetAccountingAccountResponse) o; + return + java.util.Objects.deepEquals(this.accountingAccount, other.accountingAccount) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAccountResponse.class, + "accountingAccount", accountingAccount, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAccount = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAccount(io.codat.lending.models.shared.AccountingAccount accountingAccount) { + Utils.checkNotNull(accountingAccount, "accountingAccount"); + this.accountingAccount = JsonNullable.of(accountingAccount); + return this; + } + + /** + * Success + */ + public Builder accountingAccount(JsonNullable accountingAccount) { + Utils.checkNotNull(accountingAccount, "accountingAccount"); + this.accountingAccount = accountingAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingAccountResponse build() { + return new GetAccountingAccountResponse( + accountingAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequest.java new file mode 100644 index 00000000..b516c29f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingAccountTransactionRequest { + + /** + * Unique identifier for an account transaction. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=accountTransactionId") + private String accountTransactionId; + + /** + * 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; + + public GetAccountingAccountTransactionRequest( + String accountTransactionId, + String companyId, + String connectionId) { + Utils.checkNotNull(accountTransactionId, "accountTransactionId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.accountTransactionId = accountTransactionId; + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for an account transaction. + */ + public String accountTransactionId() { + return accountTransactionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account transaction. + */ + public GetAccountingAccountTransactionRequest withAccountTransactionId(String accountTransactionId) { + Utils.checkNotNull(accountTransactionId, "accountTransactionId"); + this.accountTransactionId = accountTransactionId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingAccountTransactionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingAccountTransactionRequest 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; + } + GetAccountingAccountTransactionRequest other = (GetAccountingAccountTransactionRequest) o; + return + java.util.Objects.deepEquals(this.accountTransactionId, other.accountTransactionId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountTransactionId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAccountTransactionRequest.class, + "accountTransactionId", accountTransactionId, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String accountTransactionId; + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an account transaction. + */ + public Builder accountTransactionId(String accountTransactionId) { + Utils.checkNotNull(accountTransactionId, "accountTransactionId"); + this.accountTransactionId = accountTransactionId; + 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 GetAccountingAccountTransactionRequest build() { + return new GetAccountingAccountTransactionRequest( + accountTransactionId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequestBuilder.java new file mode 100644 index 00000000..0e5f994d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingAccountTransactionRequestBuilder { + + private GetAccountingAccountTransactionRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingAccountTransaction sdk; + + public GetAccountingAccountTransactionRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingAccountTransaction sdk) { + this.sdk = sdk; + } + + public GetAccountingAccountTransactionRequestBuilder request(GetAccountingAccountTransactionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingAccountTransactionResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionResponse.java new file mode 100644 index 00000000..e8714ec1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAccountTransactionResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingAccountTransactionResponse { + + /** + * Success + */ + private JsonNullable accountingAccountTransaction; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingAccountTransactionResponse( + JsonNullable accountingAccountTransaction, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAccountTransaction, "accountingAccountTransaction"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAccountTransaction = accountingAccountTransaction; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAccountTransaction() { + return accountingAccountTransaction; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingAccountTransactionResponse withAccountingAccountTransaction(io.codat.lending.models.shared.AccountingAccountTransaction accountingAccountTransaction) { + Utils.checkNotNull(accountingAccountTransaction, "accountingAccountTransaction"); + this.accountingAccountTransaction = JsonNullable.of(accountingAccountTransaction); + return this; + } + + /** + * Success + */ + public GetAccountingAccountTransactionResponse withAccountingAccountTransaction(JsonNullable accountingAccountTransaction) { + Utils.checkNotNull(accountingAccountTransaction, "accountingAccountTransaction"); + this.accountingAccountTransaction = accountingAccountTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingAccountTransactionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAccountTransactionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAccountTransactionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingAccountTransactionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingAccountTransactionResponse 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; + } + GetAccountingAccountTransactionResponse other = (GetAccountingAccountTransactionResponse) o; + return + java.util.Objects.deepEquals(this.accountingAccountTransaction, other.accountingAccountTransaction) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAccountTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAccountTransactionResponse.class, + "accountingAccountTransaction", accountingAccountTransaction, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAccountTransaction = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAccountTransaction(io.codat.lending.models.shared.AccountingAccountTransaction accountingAccountTransaction) { + Utils.checkNotNull(accountingAccountTransaction, "accountingAccountTransaction"); + this.accountingAccountTransaction = JsonNullable.of(accountingAccountTransaction); + return this; + } + + /** + * Success + */ + public Builder accountingAccountTransaction(JsonNullable accountingAccountTransaction) { + Utils.checkNotNull(accountingAccountTransaction, "accountingAccountTransaction"); + this.accountingAccountTransaction = accountingAccountTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingAccountTransactionResponse build() { + return new GetAccountingAccountTransactionResponse( + accountingAccountTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequest.java new file mode 100644 index 00000000..7cfd67a3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequest.java @@ -0,0 +1,270 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.time.LocalDate; +import java.util.Optional; + + +public class GetAccountingAgedCreditorsReportRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Number of periods to include in the report. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private Optional numberOfPeriods; + + /** + * The length of period in days. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLengthDays") + private Optional periodLengthDays; + + /** + * Date the report is generated up to. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private Optional reportDate; + + public GetAccountingAgedCreditorsReportRequest( + String companyId, + Optional numberOfPeriods, + Optional periodLengthDays, + Optional reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.numberOfPeriods = numberOfPeriods; + this.periodLengthDays = periodLengthDays; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Number of periods to include in the report. + */ + public Optional numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The length of period in days. + */ + public Optional periodLengthDays() { + return periodLengthDays; + } + + /** + * Date the report is generated up to. + */ + public Optional reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingAgedCreditorsReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Number of periods to include in the report. + */ + public GetAccountingAgedCreditorsReportRequest withNumberOfPeriods(int numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * Number of periods to include in the report. + */ + public GetAccountingAgedCreditorsReportRequest withNumberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The length of period in days. + */ + public GetAccountingAgedCreditorsReportRequest withPeriodLengthDays(int periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = Optional.ofNullable(periodLengthDays); + return this; + } + + /** + * The length of period in days. + */ + public GetAccountingAgedCreditorsReportRequest withPeriodLengthDays(Optional periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = periodLengthDays; + return this; + } + + /** + * Date the report is generated up to. + */ + public GetAccountingAgedCreditorsReportRequest withReportDate(LocalDate reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * Date the report is generated up to. + */ + public GetAccountingAgedCreditorsReportRequest withReportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingAgedCreditorsReportRequest other = (GetAccountingAgedCreditorsReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLengthDays, other.periodLengthDays) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + numberOfPeriods, + periodLengthDays, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAgedCreditorsReportRequest.class, + "companyId", companyId, + "numberOfPeriods", numberOfPeriods, + "periodLengthDays", periodLengthDays, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private Optional numberOfPeriods = Optional.empty(); + + private Optional periodLengthDays = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + 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; + } + + /** + * Number of periods to include in the report. + */ + public Builder numberOfPeriods(int numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * Number of periods to include in the report. + */ + public Builder numberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The length of period in days. + */ + public Builder periodLengthDays(int periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = Optional.ofNullable(periodLengthDays); + return this; + } + + /** + * The length of period in days. + */ + public Builder periodLengthDays(Optional periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = periodLengthDays; + return this; + } + + /** + * Date the report is generated up to. + */ + public Builder reportDate(LocalDate reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * Date the report is generated up to. + */ + public Builder reportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetAccountingAgedCreditorsReportRequest build() { + return new GetAccountingAgedCreditorsReportRequest( + companyId, + numberOfPeriods, + periodLengthDays, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequestBuilder.java new file mode 100644 index 00000000..0f8f01b9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingAgedCreditorsReportRequestBuilder { + + private GetAccountingAgedCreditorsReportRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingAgedCreditorsReport sdk; + + public GetAccountingAgedCreditorsReportRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingAgedCreditorsReport sdk) { + this.sdk = sdk; + } + + public GetAccountingAgedCreditorsReportRequestBuilder request(GetAccountingAgedCreditorsReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingAgedCreditorsReportResponse call() throws Exception { + return sdk.getAgedCreditors( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportResponse.java new file mode 100644 index 00000000..d3a174e0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedCreditorsReportResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingAgedCreditorsReportResponse { + + /** + * OK + */ + private Optional accountingAgedCreditorReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingAgedCreditorsReportResponse( + Optional accountingAgedCreditorReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAgedCreditorReport, "accountingAgedCreditorReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAgedCreditorReport = accountingAgedCreditorReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional accountingAgedCreditorReport() { + return accountingAgedCreditorReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetAccountingAgedCreditorsReportResponse withAccountingAgedCreditorReport(io.codat.lending.models.shared.AccountingAgedCreditorReport accountingAgedCreditorReport) { + Utils.checkNotNull(accountingAgedCreditorReport, "accountingAgedCreditorReport"); + this.accountingAgedCreditorReport = Optional.ofNullable(accountingAgedCreditorReport); + return this; + } + + /** + * OK + */ + public GetAccountingAgedCreditorsReportResponse withAccountingAgedCreditorReport(Optional accountingAgedCreditorReport) { + Utils.checkNotNull(accountingAgedCreditorReport, "accountingAgedCreditorReport"); + this.accountingAgedCreditorReport = accountingAgedCreditorReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingAgedCreditorsReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAgedCreditorsReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAgedCreditorsReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingAgedCreditorsReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingAgedCreditorsReportResponse 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; + } + GetAccountingAgedCreditorsReportResponse other = (GetAccountingAgedCreditorsReportResponse) o; + return + java.util.Objects.deepEquals(this.accountingAgedCreditorReport, other.accountingAgedCreditorReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAgedCreditorReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAgedCreditorsReportResponse.class, + "accountingAgedCreditorReport", accountingAgedCreditorReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingAgedCreditorReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder accountingAgedCreditorReport(io.codat.lending.models.shared.AccountingAgedCreditorReport accountingAgedCreditorReport) { + Utils.checkNotNull(accountingAgedCreditorReport, "accountingAgedCreditorReport"); + this.accountingAgedCreditorReport = Optional.ofNullable(accountingAgedCreditorReport); + return this; + } + + /** + * OK + */ + public Builder accountingAgedCreditorReport(Optional accountingAgedCreditorReport) { + Utils.checkNotNull(accountingAgedCreditorReport, "accountingAgedCreditorReport"); + this.accountingAgedCreditorReport = accountingAgedCreditorReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingAgedCreditorsReportResponse build() { + return new GetAccountingAgedCreditorsReportResponse( + accountingAgedCreditorReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequest.java new file mode 100644 index 00000000..04e2f3bc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequest.java @@ -0,0 +1,270 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.time.LocalDate; +import java.util.Optional; + + +public class GetAccountingAgedDebtorsReportRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Number of periods to include in the report. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private Optional numberOfPeriods; + + /** + * The length of period in days. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLengthDays") + private Optional periodLengthDays; + + /** + * Date the report is generated up to. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private Optional reportDate; + + public GetAccountingAgedDebtorsReportRequest( + String companyId, + Optional numberOfPeriods, + Optional periodLengthDays, + Optional reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.numberOfPeriods = numberOfPeriods; + this.periodLengthDays = periodLengthDays; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Number of periods to include in the report. + */ + public Optional numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The length of period in days. + */ + public Optional periodLengthDays() { + return periodLengthDays; + } + + /** + * Date the report is generated up to. + */ + public Optional reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingAgedDebtorsReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Number of periods to include in the report. + */ + public GetAccountingAgedDebtorsReportRequest withNumberOfPeriods(int numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * Number of periods to include in the report. + */ + public GetAccountingAgedDebtorsReportRequest withNumberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The length of period in days. + */ + public GetAccountingAgedDebtorsReportRequest withPeriodLengthDays(int periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = Optional.ofNullable(periodLengthDays); + return this; + } + + /** + * The length of period in days. + */ + public GetAccountingAgedDebtorsReportRequest withPeriodLengthDays(Optional periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = periodLengthDays; + return this; + } + + /** + * Date the report is generated up to. + */ + public GetAccountingAgedDebtorsReportRequest withReportDate(LocalDate reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * Date the report is generated up to. + */ + public GetAccountingAgedDebtorsReportRequest withReportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingAgedDebtorsReportRequest other = (GetAccountingAgedDebtorsReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLengthDays, other.periodLengthDays) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + numberOfPeriods, + periodLengthDays, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAgedDebtorsReportRequest.class, + "companyId", companyId, + "numberOfPeriods", numberOfPeriods, + "periodLengthDays", periodLengthDays, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private Optional numberOfPeriods = Optional.empty(); + + private Optional periodLengthDays = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + 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; + } + + /** + * Number of periods to include in the report. + */ + public Builder numberOfPeriods(int numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * Number of periods to include in the report. + */ + public Builder numberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The length of period in days. + */ + public Builder periodLengthDays(int periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = Optional.ofNullable(periodLengthDays); + return this; + } + + /** + * The length of period in days. + */ + public Builder periodLengthDays(Optional periodLengthDays) { + Utils.checkNotNull(periodLengthDays, "periodLengthDays"); + this.periodLengthDays = periodLengthDays; + return this; + } + + /** + * Date the report is generated up to. + */ + public Builder reportDate(LocalDate reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * Date the report is generated up to. + */ + public Builder reportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetAccountingAgedDebtorsReportRequest build() { + return new GetAccountingAgedDebtorsReportRequest( + companyId, + numberOfPeriods, + periodLengthDays, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequestBuilder.java new file mode 100644 index 00000000..ab39f8a9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingAgedDebtorsReportRequestBuilder { + + private GetAccountingAgedDebtorsReportRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingAgedDebtorsReport sdk; + + public GetAccountingAgedDebtorsReportRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingAgedDebtorsReport sdk) { + this.sdk = sdk; + } + + public GetAccountingAgedDebtorsReportRequestBuilder request(GetAccountingAgedDebtorsReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingAgedDebtorsReportResponse call() throws Exception { + return sdk.getAgedDebtors( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportResponse.java new file mode 100644 index 00000000..3d9f2cd1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingAgedDebtorsReportResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingAgedDebtorsReportResponse { + + /** + * OK + */ + private Optional accountingAgedDebtorReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingAgedDebtorsReportResponse( + Optional accountingAgedDebtorReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAgedDebtorReport, "accountingAgedDebtorReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAgedDebtorReport = accountingAgedDebtorReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional accountingAgedDebtorReport() { + return accountingAgedDebtorReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetAccountingAgedDebtorsReportResponse withAccountingAgedDebtorReport(io.codat.lending.models.shared.AccountingAgedDebtorReport accountingAgedDebtorReport) { + Utils.checkNotNull(accountingAgedDebtorReport, "accountingAgedDebtorReport"); + this.accountingAgedDebtorReport = Optional.ofNullable(accountingAgedDebtorReport); + return this; + } + + /** + * OK + */ + public GetAccountingAgedDebtorsReportResponse withAccountingAgedDebtorReport(Optional accountingAgedDebtorReport) { + Utils.checkNotNull(accountingAgedDebtorReport, "accountingAgedDebtorReport"); + this.accountingAgedDebtorReport = accountingAgedDebtorReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingAgedDebtorsReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAgedDebtorsReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingAgedDebtorsReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingAgedDebtorsReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingAgedDebtorsReportResponse 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; + } + GetAccountingAgedDebtorsReportResponse other = (GetAccountingAgedDebtorsReportResponse) o; + return + java.util.Objects.deepEquals(this.accountingAgedDebtorReport, other.accountingAgedDebtorReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAgedDebtorReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingAgedDebtorsReportResponse.class, + "accountingAgedDebtorReport", accountingAgedDebtorReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingAgedDebtorReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder accountingAgedDebtorReport(io.codat.lending.models.shared.AccountingAgedDebtorReport accountingAgedDebtorReport) { + Utils.checkNotNull(accountingAgedDebtorReport, "accountingAgedDebtorReport"); + this.accountingAgedDebtorReport = Optional.ofNullable(accountingAgedDebtorReport); + return this; + } + + /** + * OK + */ + public Builder accountingAgedDebtorReport(Optional accountingAgedDebtorReport) { + Utils.checkNotNull(accountingAgedDebtorReport, "accountingAgedDebtorReport"); + this.accountingAgedDebtorReport = accountingAgedDebtorReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingAgedDebtorsReportResponse build() { + return new GetAccountingAgedDebtorsReportResponse( + accountingAgedDebtorReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequest.java new file mode 100644 index 00000000..cfe7e9b5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequest.java @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetAccountingBalanceSheetRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Number of months defining the period of interest. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private int periodLength; + + /** + * Number of periods with `periodLength` to compare. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodsToCompare") + private int periodsToCompare; + + /** + * The month the report starts from. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=startMonth") + private Optional startMonth; + + public GetAccountingBalanceSheetRequest( + String companyId, + int periodLength, + int periodsToCompare, + Optional startMonth) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + Utils.checkNotNull(startMonth, "startMonth"); + this.companyId = companyId; + this.periodLength = periodLength; + this.periodsToCompare = periodsToCompare; + this.startMonth = startMonth; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Number of months defining the period of interest. + */ + public int periodLength() { + return periodLength; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public int periodsToCompare() { + return periodsToCompare; + } + + /** + * The month the report starts from. + */ + public Optional startMonth() { + return startMonth; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBalanceSheetRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Number of months defining the period of interest. + */ + public GetAccountingBalanceSheetRequest withPeriodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public GetAccountingBalanceSheetRequest withPeriodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingBalanceSheetRequest withStartMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingBalanceSheetRequest withStartMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingBalanceSheetRequest other = (GetAccountingBalanceSheetRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodsToCompare, other.periodsToCompare) && + java.util.Objects.deepEquals(this.startMonth, other.startMonth); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBalanceSheetRequest.class, + "companyId", companyId, + "periodLength", periodLength, + "periodsToCompare", periodsToCompare, + "startMonth", startMonth); + } + + public final static class Builder { + + private String companyId; + + private Integer periodLength; + + private Integer periodsToCompare; + + private Optional startMonth = Optional.empty(); + + 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; + } + + /** + * Number of months defining the period of interest. + */ + public Builder periodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public Builder periodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + public GetAccountingBalanceSheetRequest build() { + return new GetAccountingBalanceSheetRequest( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequestBuilder.java new file mode 100644 index 00000000..61b29601 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBalanceSheetRequestBuilder { + + private GetAccountingBalanceSheetRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBalanceSheet sdk; + + public GetAccountingBalanceSheetRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBalanceSheet sdk) { + this.sdk = sdk; + } + + public GetAccountingBalanceSheetRequestBuilder request(GetAccountingBalanceSheetRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBalanceSheetResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetResponse.java new file mode 100644 index 00000000..879a80cc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBalanceSheetResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingBalanceSheetResponse { + + /** + * Success + */ + private Optional accountingBalanceSheet; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBalanceSheetResponse( + Optional accountingBalanceSheet, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBalanceSheet, "accountingBalanceSheet"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBalanceSheet = accountingBalanceSheet; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBalanceSheet() { + return accountingBalanceSheet; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBalanceSheetResponse withAccountingBalanceSheet(io.codat.lending.models.shared.AccountingBalanceSheet accountingBalanceSheet) { + Utils.checkNotNull(accountingBalanceSheet, "accountingBalanceSheet"); + this.accountingBalanceSheet = Optional.ofNullable(accountingBalanceSheet); + return this; + } + + /** + * Success + */ + public GetAccountingBalanceSheetResponse withAccountingBalanceSheet(Optional accountingBalanceSheet) { + Utils.checkNotNull(accountingBalanceSheet, "accountingBalanceSheet"); + this.accountingBalanceSheet = accountingBalanceSheet; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBalanceSheetResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBalanceSheetResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBalanceSheetResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBalanceSheetResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBalanceSheetResponse 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; + } + GetAccountingBalanceSheetResponse other = (GetAccountingBalanceSheetResponse) o; + return + java.util.Objects.deepEquals(this.accountingBalanceSheet, other.accountingBalanceSheet) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBalanceSheet, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBalanceSheetResponse.class, + "accountingBalanceSheet", accountingBalanceSheet, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBalanceSheet = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBalanceSheet(io.codat.lending.models.shared.AccountingBalanceSheet accountingBalanceSheet) { + Utils.checkNotNull(accountingBalanceSheet, "accountingBalanceSheet"); + this.accountingBalanceSheet = Optional.ofNullable(accountingBalanceSheet); + return this; + } + + /** + * Success + */ + public Builder accountingBalanceSheet(Optional accountingBalanceSheet) { + Utils.checkNotNull(accountingBalanceSheet, "accountingBalanceSheet"); + this.accountingBalanceSheet = accountingBalanceSheet; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBalanceSheetResponse build() { + return new GetAccountingBalanceSheetResponse( + accountingBalanceSheet, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequest.java new file mode 100644 index 00000000..d2645a82 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingBankAccountRequest { + + /** + * 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; + + public GetAccountingBankAccountRequest( + 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. + */ + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account. + */ + public GetAccountingBankAccountRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBankAccountRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingBankAccountRequest 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; + } + GetAccountingBankAccountRequest other = (GetAccountingBankAccountRequest) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBankAccountRequest.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 GetAccountingBankAccountRequest build() { + return new GetAccountingBankAccountRequest( + accountId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequestBuilder.java new file mode 100644 index 00000000..d6b31655 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBankAccountRequestBuilder { + + private GetAccountingBankAccountRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBankAccount sdk; + + public GetAccountingBankAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBankAccount sdk) { + this.sdk = sdk; + } + + public GetAccountingBankAccountRequestBuilder request(GetAccountingBankAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBankAccountResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountResponse.java new file mode 100644 index 00000000..3f4cdb91 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBankAccountResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingBankAccountResponse { + + /** + * Success + */ + private JsonNullable accountingBankAccount; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBankAccountResponse( + JsonNullable accountingBankAccount, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBankAccount = accountingBankAccount; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingBankAccount() { + return accountingBankAccount; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBankAccountResponse withAccountingBankAccount(io.codat.lending.models.shared.AccountingBankAccount accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = JsonNullable.of(accountingBankAccount); + return this; + } + + /** + * Success + */ + public GetAccountingBankAccountResponse withAccountingBankAccount(JsonNullable accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = accountingBankAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBankAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBankAccountResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBankAccountResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBankAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBankAccountResponse 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; + } + GetAccountingBankAccountResponse other = (GetAccountingBankAccountResponse) o; + return + java.util.Objects.deepEquals(this.accountingBankAccount, other.accountingBankAccount) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBankAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBankAccountResponse.class, + "accountingBankAccount", accountingBankAccount, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingBankAccount = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBankAccount(io.codat.lending.models.shared.AccountingBankAccount accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = JsonNullable.of(accountingBankAccount); + return this; + } + + /** + * Success + */ + public Builder accountingBankAccount(JsonNullable accountingBankAccount) { + Utils.checkNotNull(accountingBankAccount, "accountingBankAccount"); + this.accountingBankAccount = accountingBankAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBankAccountResponse build() { + return new GetAccountingBankAccountResponse( + accountingBankAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequest.java new file mode 100644 index 00000000..29c1becf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingBillAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * Unique identifier for a bill. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billId") + private String billId; + + /** + * 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; + + public GetAccountingBillAttachmentRequest( + String attachmentId, + String billId, + String companyId, + String connectionId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(billId, "billId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.attachmentId = attachmentId; + this.billId = billId; + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a bill. + */ + public String billId() { + return billId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingBillAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a bill. + */ + public GetAccountingBillAttachmentRequest withBillId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBillAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingBillAttachmentRequest 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; + } + GetAccountingBillAttachmentRequest other = (GetAccountingBillAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.billId, other.billId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + billId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillAttachmentRequest.class, + "attachmentId", attachmentId, + "billId", billId, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String attachmentId; + + private String billId; + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a bill. + */ + public Builder billId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + 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 GetAccountingBillAttachmentRequest build() { + return new GetAccountingBillAttachmentRequest( + attachmentId, + billId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequestBuilder.java new file mode 100644 index 00000000..5fae8543 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBillAttachmentRequestBuilder { + + private GetAccountingBillAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBillAttachment sdk; + + public GetAccountingBillAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBillAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingBillAttachmentRequestBuilder request(GetAccountingBillAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBillAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentResponse.java new file mode 100644 index 00000000..eb7ee1e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingBillAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBillAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBillAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingBillAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBillAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBillAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBillAttachmentResponse 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; + } + GetAccountingBillAttachmentResponse other = (GetAccountingBillAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBillAttachmentResponse build() { + return new GetAccountingBillAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequest.java new file mode 100644 index 00000000..ab973ca3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingBillCreditNoteRequest { + + /** + * Unique identifier for a bill credit note. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billCreditNoteId") + private String billCreditNoteId; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetAccountingBillCreditNoteRequest( + String billCreditNoteId, + String companyId) { + Utils.checkNotNull(billCreditNoteId, "billCreditNoteId"); + Utils.checkNotNull(companyId, "companyId"); + this.billCreditNoteId = billCreditNoteId; + this.companyId = companyId; + } + + /** + * Unique identifier for a bill credit note. + */ + public String billCreditNoteId() { + return billCreditNoteId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bill credit note. + */ + public GetAccountingBillCreditNoteRequest withBillCreditNoteId(String billCreditNoteId) { + Utils.checkNotNull(billCreditNoteId, "billCreditNoteId"); + this.billCreditNoteId = billCreditNoteId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBillCreditNoteRequest 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; + } + GetAccountingBillCreditNoteRequest other = (GetAccountingBillCreditNoteRequest) o; + return + java.util.Objects.deepEquals(this.billCreditNoteId, other.billCreditNoteId) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + billCreditNoteId, + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillCreditNoteRequest.class, + "billCreditNoteId", billCreditNoteId, + "companyId", companyId); + } + + public final static class Builder { + + private String billCreditNoteId; + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bill credit note. + */ + public Builder billCreditNoteId(String billCreditNoteId) { + Utils.checkNotNull(billCreditNoteId, "billCreditNoteId"); + this.billCreditNoteId = billCreditNoteId; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public GetAccountingBillCreditNoteRequest build() { + return new GetAccountingBillCreditNoteRequest( + billCreditNoteId, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequestBuilder.java new file mode 100644 index 00000000..5f131f79 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBillCreditNoteRequestBuilder { + + private GetAccountingBillCreditNoteRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBillCreditNote sdk; + + public GetAccountingBillCreditNoteRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBillCreditNote sdk) { + this.sdk = sdk; + } + + public GetAccountingBillCreditNoteRequestBuilder request(GetAccountingBillCreditNoteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBillCreditNoteResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteResponse.java new file mode 100644 index 00000000..bd787a71 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillCreditNoteResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingBillCreditNoteResponse { + + /** + * Success + */ + private JsonNullable accountingBillCreditNote; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBillCreditNoteResponse( + JsonNullable accountingBillCreditNote, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBillCreditNote, "accountingBillCreditNote"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBillCreditNote = accountingBillCreditNote; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingBillCreditNote() { + return accountingBillCreditNote; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBillCreditNoteResponse withAccountingBillCreditNote(io.codat.lending.models.shared.AccountingBillCreditNote accountingBillCreditNote) { + Utils.checkNotNull(accountingBillCreditNote, "accountingBillCreditNote"); + this.accountingBillCreditNote = JsonNullable.of(accountingBillCreditNote); + return this; + } + + /** + * Success + */ + public GetAccountingBillCreditNoteResponse withAccountingBillCreditNote(JsonNullable accountingBillCreditNote) { + Utils.checkNotNull(accountingBillCreditNote, "accountingBillCreditNote"); + this.accountingBillCreditNote = accountingBillCreditNote; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBillCreditNoteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillCreditNoteResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillCreditNoteResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBillCreditNoteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBillCreditNoteResponse 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; + } + GetAccountingBillCreditNoteResponse other = (GetAccountingBillCreditNoteResponse) o; + return + java.util.Objects.deepEquals(this.accountingBillCreditNote, other.accountingBillCreditNote) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBillCreditNote, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillCreditNoteResponse.class, + "accountingBillCreditNote", accountingBillCreditNote, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingBillCreditNote = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBillCreditNote(io.codat.lending.models.shared.AccountingBillCreditNote accountingBillCreditNote) { + Utils.checkNotNull(accountingBillCreditNote, "accountingBillCreditNote"); + this.accountingBillCreditNote = JsonNullable.of(accountingBillCreditNote); + return this; + } + + /** + * Success + */ + public Builder accountingBillCreditNote(JsonNullable accountingBillCreditNote) { + Utils.checkNotNull(accountingBillCreditNote, "accountingBillCreditNote"); + this.accountingBillCreditNote = accountingBillCreditNote; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBillCreditNoteResponse build() { + return new GetAccountingBillCreditNoteResponse( + accountingBillCreditNote, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequest.java new file mode 100644 index 00000000..f08f510e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingBillPaymentRequest { + + /** + * Unique identifier for a bill payment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billPaymentId") + private String billPaymentId; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetAccountingBillPaymentRequest( + String billPaymentId, + String companyId) { + Utils.checkNotNull(billPaymentId, "billPaymentId"); + Utils.checkNotNull(companyId, "companyId"); + this.billPaymentId = billPaymentId; + this.companyId = companyId; + } + + /** + * Unique identifier for a bill payment. + */ + public String billPaymentId() { + return billPaymentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bill payment. + */ + public GetAccountingBillPaymentRequest withBillPaymentId(String billPaymentId) { + Utils.checkNotNull(billPaymentId, "billPaymentId"); + this.billPaymentId = billPaymentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBillPaymentRequest 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; + } + GetAccountingBillPaymentRequest other = (GetAccountingBillPaymentRequest) o; + return + java.util.Objects.deepEquals(this.billPaymentId, other.billPaymentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + billPaymentId, + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillPaymentRequest.class, + "billPaymentId", billPaymentId, + "companyId", companyId); + } + + public final static class Builder { + + private String billPaymentId; + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bill payment. + */ + public Builder billPaymentId(String billPaymentId) { + Utils.checkNotNull(billPaymentId, "billPaymentId"); + this.billPaymentId = billPaymentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public GetAccountingBillPaymentRequest build() { + return new GetAccountingBillPaymentRequest( + billPaymentId, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequestBuilder.java new file mode 100644 index 00000000..af389422 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBillPaymentRequestBuilder { + + private GetAccountingBillPaymentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBillPayment sdk; + + public GetAccountingBillPaymentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBillPayment sdk) { + this.sdk = sdk; + } + + public GetAccountingBillPaymentRequestBuilder request(GetAccountingBillPaymentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBillPaymentResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentResponse.java new file mode 100644 index 00000000..bf28b57a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillPaymentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingBillPaymentResponse { + + /** + * Success + */ + private JsonNullable accountingBillPayment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBillPaymentResponse( + JsonNullable accountingBillPayment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBillPayment, "accountingBillPayment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBillPayment = accountingBillPayment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingBillPayment() { + return accountingBillPayment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBillPaymentResponse withAccountingBillPayment(io.codat.lending.models.shared.AccountingBillPayment accountingBillPayment) { + Utils.checkNotNull(accountingBillPayment, "accountingBillPayment"); + this.accountingBillPayment = JsonNullable.of(accountingBillPayment); + return this; + } + + /** + * Success + */ + public GetAccountingBillPaymentResponse withAccountingBillPayment(JsonNullable accountingBillPayment) { + Utils.checkNotNull(accountingBillPayment, "accountingBillPayment"); + this.accountingBillPayment = accountingBillPayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBillPaymentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillPaymentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillPaymentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBillPaymentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBillPaymentResponse 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; + } + GetAccountingBillPaymentResponse other = (GetAccountingBillPaymentResponse) o; + return + java.util.Objects.deepEquals(this.accountingBillPayment, other.accountingBillPayment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBillPayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillPaymentResponse.class, + "accountingBillPayment", accountingBillPayment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingBillPayment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBillPayment(io.codat.lending.models.shared.AccountingBillPayment accountingBillPayment) { + Utils.checkNotNull(accountingBillPayment, "accountingBillPayment"); + this.accountingBillPayment = JsonNullable.of(accountingBillPayment); + return this; + } + + /** + * Success + */ + public Builder accountingBillPayment(JsonNullable accountingBillPayment) { + Utils.checkNotNull(accountingBillPayment, "accountingBillPayment"); + this.accountingBillPayment = accountingBillPayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBillPaymentResponse build() { + return new GetAccountingBillPaymentResponse( + accountingBillPayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequest.java new file mode 100644 index 00000000..7da22b2e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingBillRequest { + + /** + * Unique identifier for a bill. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billId") + private String billId; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetAccountingBillRequest( + String billId, + String companyId) { + Utils.checkNotNull(billId, "billId"); + Utils.checkNotNull(companyId, "companyId"); + this.billId = billId; + this.companyId = companyId; + } + + /** + * Unique identifier for a bill. + */ + public String billId() { + return billId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bill. + */ + public GetAccountingBillRequest withBillId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingBillRequest 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; + } + GetAccountingBillRequest other = (GetAccountingBillRequest) o; + return + java.util.Objects.deepEquals(this.billId, other.billId) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + billId, + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillRequest.class, + "billId", billId, + "companyId", companyId); + } + + public final static class Builder { + + private String billId; + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bill. + */ + public Builder billId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public GetAccountingBillRequest build() { + return new GetAccountingBillRequest( + billId, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequestBuilder.java new file mode 100644 index 00000000..ca24a610 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingBillRequestBuilder { + + private GetAccountingBillRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingBill sdk; + + public GetAccountingBillRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingBill sdk) { + this.sdk = sdk; + } + + public GetAccountingBillRequestBuilder request(GetAccountingBillRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingBillResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillResponse.java new file mode 100644 index 00000000..9ac25a99 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingBillResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingBillResponse { + + /** + * Success + */ + private JsonNullable accountingBill; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingBillResponse( + JsonNullable accountingBill, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBill, "accountingBill"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBill = accountingBill; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingBill() { + return accountingBill; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingBillResponse withAccountingBill(io.codat.lending.models.shared.AccountingBill accountingBill) { + Utils.checkNotNull(accountingBill, "accountingBill"); + this.accountingBill = JsonNullable.of(accountingBill); + return this; + } + + /** + * Success + */ + public GetAccountingBillResponse withAccountingBill(JsonNullable accountingBill) { + Utils.checkNotNull(accountingBill, "accountingBill"); + this.accountingBill = accountingBill; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingBillResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingBillResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingBillResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingBillResponse 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; + } + GetAccountingBillResponse other = (GetAccountingBillResponse) o; + return + java.util.Objects.deepEquals(this.accountingBill, other.accountingBill) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBill, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingBillResponse.class, + "accountingBill", accountingBill, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingBill = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBill(io.codat.lending.models.shared.AccountingBill accountingBill) { + Utils.checkNotNull(accountingBill, "accountingBill"); + this.accountingBill = JsonNullable.of(accountingBill); + return this; + } + + /** + * Success + */ + public Builder accountingBill(JsonNullable accountingBill) { + Utils.checkNotNull(accountingBill, "accountingBill"); + this.accountingBill = accountingBill; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingBillResponse build() { + return new GetAccountingBillResponse( + accountingBill, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequest.java new file mode 100644 index 00000000..85230edb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequest.java @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetAccountingCashFlowStatementRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Number of months defining the period of interest. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private int periodLength; + + /** + * Number of periods with `periodLength` to compare. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodsToCompare") + private int periodsToCompare; + + /** + * The month the report starts from. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=startMonth") + private Optional startMonth; + + public GetAccountingCashFlowStatementRequest( + String companyId, + int periodLength, + int periodsToCompare, + Optional startMonth) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + Utils.checkNotNull(startMonth, "startMonth"); + this.companyId = companyId; + this.periodLength = periodLength; + this.periodsToCompare = periodsToCompare; + this.startMonth = startMonth; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Number of months defining the period of interest. + */ + public int periodLength() { + return periodLength; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public int periodsToCompare() { + return periodsToCompare; + } + + /** + * The month the report starts from. + */ + public Optional startMonth() { + return startMonth; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingCashFlowStatementRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Number of months defining the period of interest. + */ + public GetAccountingCashFlowStatementRequest withPeriodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public GetAccountingCashFlowStatementRequest withPeriodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingCashFlowStatementRequest withStartMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingCashFlowStatementRequest withStartMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingCashFlowStatementRequest other = (GetAccountingCashFlowStatementRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodsToCompare, other.periodsToCompare) && + java.util.Objects.deepEquals(this.startMonth, other.startMonth); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCashFlowStatementRequest.class, + "companyId", companyId, + "periodLength", periodLength, + "periodsToCompare", periodsToCompare, + "startMonth", startMonth); + } + + public final static class Builder { + + private String companyId; + + private Integer periodLength; + + private Integer periodsToCompare; + + private Optional startMonth = Optional.empty(); + + 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; + } + + /** + * Number of months defining the period of interest. + */ + public Builder periodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public Builder periodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + public GetAccountingCashFlowStatementRequest build() { + return new GetAccountingCashFlowStatementRequest( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequestBuilder.java new file mode 100644 index 00000000..4652caca --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingCashFlowStatementRequestBuilder { + + private GetAccountingCashFlowStatementRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingCashFlowStatement sdk; + + public GetAccountingCashFlowStatementRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingCashFlowStatement sdk) { + this.sdk = sdk; + } + + public GetAccountingCashFlowStatementRequestBuilder request(GetAccountingCashFlowStatementRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingCashFlowStatementResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementResponse.java new file mode 100644 index 00000000..b9df0ec3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCashFlowStatementResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingCashFlowStatementResponse { + + /** + * Success + */ + private Optional accountingCashFlowStatement; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingCashFlowStatementResponse( + Optional accountingCashFlowStatement, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCashFlowStatement, "accountingCashFlowStatement"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCashFlowStatement = accountingCashFlowStatement; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCashFlowStatement() { + return accountingCashFlowStatement; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingCashFlowStatementResponse withAccountingCashFlowStatement(io.codat.lending.models.shared.AccountingCashFlowStatement accountingCashFlowStatement) { + Utils.checkNotNull(accountingCashFlowStatement, "accountingCashFlowStatement"); + this.accountingCashFlowStatement = Optional.ofNullable(accountingCashFlowStatement); + return this; + } + + /** + * Success + */ + public GetAccountingCashFlowStatementResponse withAccountingCashFlowStatement(Optional accountingCashFlowStatement) { + Utils.checkNotNull(accountingCashFlowStatement, "accountingCashFlowStatement"); + this.accountingCashFlowStatement = accountingCashFlowStatement; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingCashFlowStatementResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCashFlowStatementResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCashFlowStatementResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingCashFlowStatementResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingCashFlowStatementResponse 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; + } + GetAccountingCashFlowStatementResponse other = (GetAccountingCashFlowStatementResponse) o; + return + java.util.Objects.deepEquals(this.accountingCashFlowStatement, other.accountingCashFlowStatement) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCashFlowStatement, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCashFlowStatementResponse.class, + "accountingCashFlowStatement", accountingCashFlowStatement, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCashFlowStatement = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCashFlowStatement(io.codat.lending.models.shared.AccountingCashFlowStatement accountingCashFlowStatement) { + Utils.checkNotNull(accountingCashFlowStatement, "accountingCashFlowStatement"); + this.accountingCashFlowStatement = Optional.ofNullable(accountingCashFlowStatement); + return this; + } + + /** + * Success + */ + public Builder accountingCashFlowStatement(Optional accountingCashFlowStatement) { + Utils.checkNotNull(accountingCashFlowStatement, "accountingCashFlowStatement"); + this.accountingCashFlowStatement = accountingCashFlowStatement; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingCashFlowStatementResponse build() { + return new GetAccountingCashFlowStatementResponse( + accountingCashFlowStatement, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequest.java new file mode 100644 index 00000000..9bebc35b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingCreditNoteRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a credit note. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=creditNoteId") + private String creditNoteId; + + public GetAccountingCreditNoteRequest( + String companyId, + String creditNoteId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(creditNoteId, "creditNoteId"); + this.companyId = companyId; + this.creditNoteId = creditNoteId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a credit note. + */ + public String creditNoteId() { + return creditNoteId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingCreditNoteRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a credit note. + */ + public GetAccountingCreditNoteRequest withCreditNoteId(String creditNoteId) { + Utils.checkNotNull(creditNoteId, "creditNoteId"); + this.creditNoteId = creditNoteId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingCreditNoteRequest other = (GetAccountingCreditNoteRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.creditNoteId, other.creditNoteId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + creditNoteId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCreditNoteRequest.class, + "companyId", companyId, + "creditNoteId", creditNoteId); + } + + public final static class Builder { + + private String companyId; + + private String creditNoteId; + + 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; + } + + /** + * Unique identifier for a credit note. + */ + public Builder creditNoteId(String creditNoteId) { + Utils.checkNotNull(creditNoteId, "creditNoteId"); + this.creditNoteId = creditNoteId; + return this; + } + + public GetAccountingCreditNoteRequest build() { + return new GetAccountingCreditNoteRequest( + companyId, + creditNoteId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequestBuilder.java new file mode 100644 index 00000000..ade1726c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingCreditNoteRequestBuilder { + + private GetAccountingCreditNoteRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingCreditNote sdk; + + public GetAccountingCreditNoteRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingCreditNote sdk) { + this.sdk = sdk; + } + + public GetAccountingCreditNoteRequestBuilder request(GetAccountingCreditNoteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingCreditNoteResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteResponse.java new file mode 100644 index 00000000..4339d823 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCreditNoteResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingCreditNoteResponse { + + /** + * Success + */ + private JsonNullable accountingCreditNote; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingCreditNoteResponse( + JsonNullable accountingCreditNote, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreditNote, "accountingCreditNote"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreditNote = accountingCreditNote; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingCreditNote() { + return accountingCreditNote; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingCreditNoteResponse withAccountingCreditNote(io.codat.lending.models.shared.AccountingCreditNote accountingCreditNote) { + Utils.checkNotNull(accountingCreditNote, "accountingCreditNote"); + this.accountingCreditNote = JsonNullable.of(accountingCreditNote); + return this; + } + + /** + * Success + */ + public GetAccountingCreditNoteResponse withAccountingCreditNote(JsonNullable accountingCreditNote) { + Utils.checkNotNull(accountingCreditNote, "accountingCreditNote"); + this.accountingCreditNote = accountingCreditNote; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingCreditNoteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCreditNoteResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCreditNoteResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingCreditNoteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingCreditNoteResponse 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; + } + GetAccountingCreditNoteResponse other = (GetAccountingCreditNoteResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreditNote, other.accountingCreditNote) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreditNote, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCreditNoteResponse.class, + "accountingCreditNote", accountingCreditNote, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingCreditNote = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreditNote(io.codat.lending.models.shared.AccountingCreditNote accountingCreditNote) { + Utils.checkNotNull(accountingCreditNote, "accountingCreditNote"); + this.accountingCreditNote = JsonNullable.of(accountingCreditNote); + return this; + } + + /** + * Success + */ + public Builder accountingCreditNote(JsonNullable accountingCreditNote) { + Utils.checkNotNull(accountingCreditNote, "accountingCreditNote"); + this.accountingCreditNote = accountingCreditNote; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingCreditNoteResponse build() { + return new GetAccountingCreditNoteResponse( + accountingCreditNote, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequest.java new file mode 100644 index 00000000..2bc548a5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingCustomerAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a customer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=customerId") + private String customerId; + + public GetAccountingCustomerAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String customerId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(customerId, "customerId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.customerId = customerId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a customer. + */ + public String customerId() { + return customerId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingCustomerAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingCustomerAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingCustomerAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public GetAccountingCustomerAttachmentRequest withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingCustomerAttachmentRequest other = (GetAccountingCustomerAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.customerId, other.customerId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + customerId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCustomerAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "customerId", customerId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String customerId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a customer. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + public GetAccountingCustomerAttachmentRequest build() { + return new GetAccountingCustomerAttachmentRequest( + attachmentId, + companyId, + connectionId, + customerId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequestBuilder.java new file mode 100644 index 00000000..5253614c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingCustomerAttachmentRequestBuilder { + + private GetAccountingCustomerAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingCustomerAttachment sdk; + + public GetAccountingCustomerAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingCustomerAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingCustomerAttachmentRequestBuilder request(GetAccountingCustomerAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingCustomerAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentResponse.java new file mode 100644 index 00000000..d0c05ecc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingCustomerAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingCustomerAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingCustomerAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingCustomerAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingCustomerAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCustomerAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCustomerAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingCustomerAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingCustomerAttachmentResponse 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; + } + GetAccountingCustomerAttachmentResponse other = (GetAccountingCustomerAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCustomerAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingCustomerAttachmentResponse build() { + return new GetAccountingCustomerAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequest.java new file mode 100644 index 00000000..7205f826 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingCustomerRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a customer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=customerId") + private String customerId; + + public GetAccountingCustomerRequest( + String companyId, + String customerId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(customerId, "customerId"); + this.companyId = companyId; + this.customerId = customerId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a customer. + */ + public String customerId() { + return customerId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingCustomerRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public GetAccountingCustomerRequest withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingCustomerRequest other = (GetAccountingCustomerRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.customerId, other.customerId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + customerId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCustomerRequest.class, + "companyId", companyId, + "customerId", customerId); + } + + public final static class Builder { + + private String companyId; + + private String customerId; + + 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; + } + + /** + * Unique identifier for a customer. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + public GetAccountingCustomerRequest build() { + return new GetAccountingCustomerRequest( + companyId, + customerId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequestBuilder.java new file mode 100644 index 00000000..49100d72 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingCustomerRequestBuilder { + + private GetAccountingCustomerRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingCustomer sdk; + + public GetAccountingCustomerRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingCustomer sdk) { + this.sdk = sdk; + } + + public GetAccountingCustomerRequestBuilder request(GetAccountingCustomerRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingCustomerResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerResponse.java new file mode 100644 index 00000000..8fa47ee0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingCustomerResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingCustomerResponse { + + /** + * Success + */ + private JsonNullable accountingCustomer; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingCustomerResponse( + JsonNullable accountingCustomer, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCustomer, "accountingCustomer"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCustomer = accountingCustomer; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingCustomer() { + return accountingCustomer; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingCustomerResponse withAccountingCustomer(io.codat.lending.models.shared.AccountingCustomer accountingCustomer) { + Utils.checkNotNull(accountingCustomer, "accountingCustomer"); + this.accountingCustomer = JsonNullable.of(accountingCustomer); + return this; + } + + /** + * Success + */ + public GetAccountingCustomerResponse withAccountingCustomer(JsonNullable accountingCustomer) { + Utils.checkNotNull(accountingCustomer, "accountingCustomer"); + this.accountingCustomer = accountingCustomer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingCustomerResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCustomerResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingCustomerResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingCustomerResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingCustomerResponse 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; + } + GetAccountingCustomerResponse other = (GetAccountingCustomerResponse) o; + return + java.util.Objects.deepEquals(this.accountingCustomer, other.accountingCustomer) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCustomer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingCustomerResponse.class, + "accountingCustomer", accountingCustomer, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingCustomer = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCustomer(io.codat.lending.models.shared.AccountingCustomer accountingCustomer) { + Utils.checkNotNull(accountingCustomer, "accountingCustomer"); + this.accountingCustomer = JsonNullable.of(accountingCustomer); + return this; + } + + /** + * Success + */ + public Builder accountingCustomer(JsonNullable accountingCustomer) { + Utils.checkNotNull(accountingCustomer, "accountingCustomer"); + this.accountingCustomer = accountingCustomer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingCustomerResponse build() { + return new GetAccountingCustomerResponse( + accountingCustomer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequest.java new file mode 100644 index 00000000..f0b7a579 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingDirectCostAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a direct cost. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directCostId") + private String directCostId; + + public GetAccountingDirectCostAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String directCostId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directCostId, "directCostId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.directCostId = directCostId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct cost. + */ + public String directCostId() { + return directCostId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingDirectCostAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingDirectCostAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingDirectCostAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public GetAccountingDirectCostAttachmentRequest withDirectCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingDirectCostAttachmentRequest other = (GetAccountingDirectCostAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directCostId, other.directCostId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + directCostId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectCostAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "directCostId", directCostId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String directCostId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a direct cost. + */ + public Builder directCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + public GetAccountingDirectCostAttachmentRequest build() { + return new GetAccountingDirectCostAttachmentRequest( + attachmentId, + companyId, + connectionId, + directCostId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequestBuilder.java new file mode 100644 index 00000000..2f7d6b3b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingDirectCostAttachmentRequestBuilder { + + private GetAccountingDirectCostAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingDirectCostAttachment sdk; + + public GetAccountingDirectCostAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingDirectCostAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingDirectCostAttachmentRequestBuilder request(GetAccountingDirectCostAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingDirectCostAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentResponse.java new file mode 100644 index 00000000..2c6a4af0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingDirectCostAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingDirectCostAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingDirectCostAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingDirectCostAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingDirectCostAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectCostAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectCostAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingDirectCostAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingDirectCostAttachmentResponse 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; + } + GetAccountingDirectCostAttachmentResponse other = (GetAccountingDirectCostAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectCostAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingDirectCostAttachmentResponse build() { + return new GetAccountingDirectCostAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequest.java new file mode 100644 index 00000000..f62aae58 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingDirectCostRequest { + + /** + * 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; + + /** + * Unique identifier for a direct cost. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directCostId") + private String directCostId; + + public GetAccountingDirectCostRequest( + String companyId, + String connectionId, + String directCostId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directCostId, "directCostId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.directCostId = directCostId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct cost. + */ + public String directCostId() { + return directCostId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingDirectCostRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingDirectCostRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public GetAccountingDirectCostRequest withDirectCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingDirectCostRequest other = (GetAccountingDirectCostRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directCostId, other.directCostId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + directCostId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectCostRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "directCostId", directCostId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String directCostId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public Builder directCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + public GetAccountingDirectCostRequest build() { + return new GetAccountingDirectCostRequest( + companyId, + connectionId, + directCostId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequestBuilder.java new file mode 100644 index 00000000..d7f4fb6d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingDirectCostRequestBuilder { + + private GetAccountingDirectCostRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingDirectCost sdk; + + public GetAccountingDirectCostRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingDirectCost sdk) { + this.sdk = sdk; + } + + public GetAccountingDirectCostRequestBuilder request(GetAccountingDirectCostRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingDirectCostResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostResponse.java new file mode 100644 index 00000000..08f80c48 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectCostResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingDirectCostResponse { + + /** + * Success + */ + private JsonNullable accountingDirectCost; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingDirectCostResponse( + JsonNullable accountingDirectCost, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingDirectCost, "accountingDirectCost"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingDirectCost = accountingDirectCost; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingDirectCost() { + return accountingDirectCost; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingDirectCostResponse withAccountingDirectCost(io.codat.lending.models.shared.AccountingDirectCost accountingDirectCost) { + Utils.checkNotNull(accountingDirectCost, "accountingDirectCost"); + this.accountingDirectCost = JsonNullable.of(accountingDirectCost); + return this; + } + + /** + * Success + */ + public GetAccountingDirectCostResponse withAccountingDirectCost(JsonNullable accountingDirectCost) { + Utils.checkNotNull(accountingDirectCost, "accountingDirectCost"); + this.accountingDirectCost = accountingDirectCost; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingDirectCostResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectCostResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectCostResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingDirectCostResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingDirectCostResponse 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; + } + GetAccountingDirectCostResponse other = (GetAccountingDirectCostResponse) o; + return + java.util.Objects.deepEquals(this.accountingDirectCost, other.accountingDirectCost) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingDirectCost, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectCostResponse.class, + "accountingDirectCost", accountingDirectCost, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingDirectCost = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingDirectCost(io.codat.lending.models.shared.AccountingDirectCost accountingDirectCost) { + Utils.checkNotNull(accountingDirectCost, "accountingDirectCost"); + this.accountingDirectCost = JsonNullable.of(accountingDirectCost); + return this; + } + + /** + * Success + */ + public Builder accountingDirectCost(JsonNullable accountingDirectCost) { + Utils.checkNotNull(accountingDirectCost, "accountingDirectCost"); + this.accountingDirectCost = accountingDirectCost; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingDirectCostResponse build() { + return new GetAccountingDirectCostResponse( + accountingDirectCost, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequest.java new file mode 100644 index 00000000..94a49b71 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequest.java @@ -0,0 +1,273 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetAccountingDirectIncomeAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a direct income. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directIncomeId") + private String directIncomeId; + + /** + * Time limit for the push operation to complete before it is timed out. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=timeoutInMinutes") + private Optional timeoutInMinutes; + + public GetAccountingDirectIncomeAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String directIncomeId, + Optional timeoutInMinutes) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directIncomeId, "directIncomeId"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.directIncomeId = directIncomeId; + this.timeoutInMinutes = timeoutInMinutes; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct income. + */ + public String directIncomeId() { + return directIncomeId; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Optional timeoutInMinutes() { + return timeoutInMinutes; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingDirectIncomeAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingDirectIncomeAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingDirectIncomeAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public GetAccountingDirectIncomeAttachmentRequest withDirectIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public GetAccountingDirectIncomeAttachmentRequest withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public GetAccountingDirectIncomeAttachmentRequest withTimeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingDirectIncomeAttachmentRequest other = (GetAccountingDirectIncomeAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directIncomeId, other.directIncomeId) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + directIncomeId, + timeoutInMinutes); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectIncomeAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "directIncomeId", directIncomeId, + "timeoutInMinutes", timeoutInMinutes); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String directIncomeId; + + private Optional timeoutInMinutes = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a direct income. + */ + public Builder directIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = Optional.ofNullable(timeoutInMinutes); + return this; + } + + /** + * Time limit for the push operation to complete before it is timed out. + */ + public Builder timeoutInMinutes(Optional timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + public GetAccountingDirectIncomeAttachmentRequest build() { + return new GetAccountingDirectIncomeAttachmentRequest( + attachmentId, + companyId, + connectionId, + directIncomeId, + timeoutInMinutes); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequestBuilder.java new file mode 100644 index 00000000..4a2b05c0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingDirectIncomeAttachmentRequestBuilder { + + private GetAccountingDirectIncomeAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingDirectIncomeAttachment sdk; + + public GetAccountingDirectIncomeAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingDirectIncomeAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingDirectIncomeAttachmentRequestBuilder request(GetAccountingDirectIncomeAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingDirectIncomeAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentResponse.java new file mode 100644 index 00000000..dc27455a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingDirectIncomeAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingDirectIncomeAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingDirectIncomeAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingDirectIncomeAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingDirectIncomeAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectIncomeAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectIncomeAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingDirectIncomeAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingDirectIncomeAttachmentResponse 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; + } + GetAccountingDirectIncomeAttachmentResponse other = (GetAccountingDirectIncomeAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectIncomeAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingDirectIncomeAttachmentResponse build() { + return new GetAccountingDirectIncomeAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequest.java new file mode 100644 index 00000000..939133e7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingDirectIncomeRequest { + + /** + * 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; + + /** + * Unique identifier for a direct income. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directIncomeId") + private String directIncomeId; + + public GetAccountingDirectIncomeRequest( + String companyId, + String connectionId, + String directIncomeId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.directIncomeId = directIncomeId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct income. + */ + public String directIncomeId() { + return directIncomeId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingDirectIncomeRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingDirectIncomeRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public GetAccountingDirectIncomeRequest withDirectIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingDirectIncomeRequest other = (GetAccountingDirectIncomeRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directIncomeId, other.directIncomeId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + directIncomeId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectIncomeRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "directIncomeId", directIncomeId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String directIncomeId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public Builder directIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + public GetAccountingDirectIncomeRequest build() { + return new GetAccountingDirectIncomeRequest( + companyId, + connectionId, + directIncomeId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequestBuilder.java new file mode 100644 index 00000000..9043a0cc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingDirectIncomeRequestBuilder { + + private GetAccountingDirectIncomeRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingDirectIncome sdk; + + public GetAccountingDirectIncomeRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingDirectIncome sdk) { + this.sdk = sdk; + } + + public GetAccountingDirectIncomeRequestBuilder request(GetAccountingDirectIncomeRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingDirectIncomeResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeResponse.java new file mode 100644 index 00000000..1062340f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingDirectIncomeResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingDirectIncomeResponse { + + /** + * Success + */ + private JsonNullable accountingDirectIncome; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingDirectIncomeResponse( + JsonNullable accountingDirectIncome, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingDirectIncome, "accountingDirectIncome"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingDirectIncome = accountingDirectIncome; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingDirectIncome() { + return accountingDirectIncome; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingDirectIncomeResponse withAccountingDirectIncome(io.codat.lending.models.shared.AccountingDirectIncome accountingDirectIncome) { + Utils.checkNotNull(accountingDirectIncome, "accountingDirectIncome"); + this.accountingDirectIncome = JsonNullable.of(accountingDirectIncome); + return this; + } + + /** + * Success + */ + public GetAccountingDirectIncomeResponse withAccountingDirectIncome(JsonNullable accountingDirectIncome) { + Utils.checkNotNull(accountingDirectIncome, "accountingDirectIncome"); + this.accountingDirectIncome = accountingDirectIncome; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingDirectIncomeResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectIncomeResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingDirectIncomeResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingDirectIncomeResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingDirectIncomeResponse 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; + } + GetAccountingDirectIncomeResponse other = (GetAccountingDirectIncomeResponse) o; + return + java.util.Objects.deepEquals(this.accountingDirectIncome, other.accountingDirectIncome) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingDirectIncome, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingDirectIncomeResponse.class, + "accountingDirectIncome", accountingDirectIncome, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingDirectIncome = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingDirectIncome(io.codat.lending.models.shared.AccountingDirectIncome accountingDirectIncome) { + Utils.checkNotNull(accountingDirectIncome, "accountingDirectIncome"); + this.accountingDirectIncome = JsonNullable.of(accountingDirectIncome); + return this; + } + + /** + * Success + */ + public Builder accountingDirectIncome(JsonNullable accountingDirectIncome) { + Utils.checkNotNull(accountingDirectIncome, "accountingDirectIncome"); + this.accountingDirectIncome = accountingDirectIncome; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingDirectIncomeResponse build() { + return new GetAccountingDirectIncomeResponse( + accountingDirectIncome, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequest.java new file mode 100644 index 00000000..d3f08c12 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingInvoiceAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for an invoice. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invoiceId") + private String invoiceId; + + public GetAccountingInvoiceAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String invoiceId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(invoiceId, "invoiceId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.invoiceId = invoiceId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for an invoice. + */ + public String invoiceId() { + return invoiceId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingInvoiceAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingInvoiceAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingInvoiceAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public GetAccountingInvoiceAttachmentRequest withInvoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingInvoiceAttachmentRequest other = (GetAccountingInvoiceAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.invoiceId, other.invoiceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + invoiceId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingInvoiceAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "invoiceId", invoiceId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String invoiceId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for an invoice. + */ + public Builder invoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + public GetAccountingInvoiceAttachmentRequest build() { + return new GetAccountingInvoiceAttachmentRequest( + attachmentId, + companyId, + connectionId, + invoiceId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequestBuilder.java new file mode 100644 index 00000000..ba675f1a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingInvoiceAttachmentRequestBuilder { + + private GetAccountingInvoiceAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingInvoiceAttachment sdk; + + public GetAccountingInvoiceAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingInvoiceAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingInvoiceAttachmentRequestBuilder request(GetAccountingInvoiceAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingInvoiceAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentResponse.java new file mode 100644 index 00000000..e6b76652 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingInvoiceAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingInvoiceAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingInvoiceAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingInvoiceAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingInvoiceAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingInvoiceAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingInvoiceAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingInvoiceAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingInvoiceAttachmentResponse 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; + } + GetAccountingInvoiceAttachmentResponse other = (GetAccountingInvoiceAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingInvoiceAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingInvoiceAttachmentResponse build() { + return new GetAccountingInvoiceAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequest.java new file mode 100644 index 00000000..052631f5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingInvoiceRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for an invoice. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invoiceId") + private String invoiceId; + + public GetAccountingInvoiceRequest( + String companyId, + String invoiceId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(invoiceId, "invoiceId"); + this.companyId = companyId; + this.invoiceId = invoiceId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for an invoice. + */ + public String invoiceId() { + return invoiceId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingInvoiceRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public GetAccountingInvoiceRequest withInvoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingInvoiceRequest other = (GetAccountingInvoiceRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.invoiceId, other.invoiceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + invoiceId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingInvoiceRequest.class, + "companyId", companyId, + "invoiceId", invoiceId); + } + + public final static class Builder { + + private String companyId; + + private String invoiceId; + + 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; + } + + /** + * Unique identifier for an invoice. + */ + public Builder invoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + public GetAccountingInvoiceRequest build() { + return new GetAccountingInvoiceRequest( + companyId, + invoiceId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequestBuilder.java new file mode 100644 index 00000000..3b40e889 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingInvoiceRequestBuilder { + + private GetAccountingInvoiceRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingInvoice sdk; + + public GetAccountingInvoiceRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingInvoice sdk) { + this.sdk = sdk; + } + + public GetAccountingInvoiceRequestBuilder request(GetAccountingInvoiceRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingInvoiceResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceResponse.java new file mode 100644 index 00000000..6faa17d8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingInvoiceResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingInvoiceResponse { + + /** + * Success + */ + private JsonNullable accountingInvoice; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingInvoiceResponse( + JsonNullable accountingInvoice, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingInvoice, "accountingInvoice"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingInvoice = accountingInvoice; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingInvoice() { + return accountingInvoice; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingInvoiceResponse withAccountingInvoice(io.codat.lending.models.shared.AccountingInvoice accountingInvoice) { + Utils.checkNotNull(accountingInvoice, "accountingInvoice"); + this.accountingInvoice = JsonNullable.of(accountingInvoice); + return this; + } + + /** + * Success + */ + public GetAccountingInvoiceResponse withAccountingInvoice(JsonNullable accountingInvoice) { + Utils.checkNotNull(accountingInvoice, "accountingInvoice"); + this.accountingInvoice = accountingInvoice; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingInvoiceResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingInvoiceResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingInvoiceResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingInvoiceResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingInvoiceResponse 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; + } + GetAccountingInvoiceResponse other = (GetAccountingInvoiceResponse) o; + return + java.util.Objects.deepEquals(this.accountingInvoice, other.accountingInvoice) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingInvoice, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingInvoiceResponse.class, + "accountingInvoice", accountingInvoice, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingInvoice = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingInvoice(io.codat.lending.models.shared.AccountingInvoice accountingInvoice) { + Utils.checkNotNull(accountingInvoice, "accountingInvoice"); + this.accountingInvoice = JsonNullable.of(accountingInvoice); + return this; + } + + /** + * Success + */ + public Builder accountingInvoice(JsonNullable accountingInvoice) { + Utils.checkNotNull(accountingInvoice, "accountingInvoice"); + this.accountingInvoice = accountingInvoice; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingInvoiceResponse build() { + return new GetAccountingInvoiceResponse( + accountingInvoice, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequest.java new file mode 100644 index 00000000..02051d0b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingJournalEntryRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a journal entry. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=journalEntryId") + private String journalEntryId; + + public GetAccountingJournalEntryRequest( + String companyId, + String journalEntryId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(journalEntryId, "journalEntryId"); + this.companyId = companyId; + this.journalEntryId = journalEntryId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a journal entry. + */ + public String journalEntryId() { + return journalEntryId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingJournalEntryRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a journal entry. + */ + public GetAccountingJournalEntryRequest withJournalEntryId(String journalEntryId) { + Utils.checkNotNull(journalEntryId, "journalEntryId"); + this.journalEntryId = journalEntryId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingJournalEntryRequest other = (GetAccountingJournalEntryRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.journalEntryId, other.journalEntryId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + journalEntryId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingJournalEntryRequest.class, + "companyId", companyId, + "journalEntryId", journalEntryId); + } + + public final static class Builder { + + private String companyId; + + private String journalEntryId; + + 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; + } + + /** + * Unique identifier for a journal entry. + */ + public Builder journalEntryId(String journalEntryId) { + Utils.checkNotNull(journalEntryId, "journalEntryId"); + this.journalEntryId = journalEntryId; + return this; + } + + public GetAccountingJournalEntryRequest build() { + return new GetAccountingJournalEntryRequest( + companyId, + journalEntryId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequestBuilder.java new file mode 100644 index 00000000..18d8d54d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingJournalEntryRequestBuilder { + + private GetAccountingJournalEntryRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingJournalEntry sdk; + + public GetAccountingJournalEntryRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingJournalEntry sdk) { + this.sdk = sdk; + } + + public GetAccountingJournalEntryRequestBuilder request(GetAccountingJournalEntryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingJournalEntryResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryResponse.java new file mode 100644 index 00000000..249ca5a0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalEntryResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingJournalEntryResponse { + + /** + * Success + */ + private JsonNullable accountingJournalEntry; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingJournalEntryResponse( + JsonNullable accountingJournalEntry, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingJournalEntry, "accountingJournalEntry"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingJournalEntry = accountingJournalEntry; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingJournalEntry() { + return accountingJournalEntry; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingJournalEntryResponse withAccountingJournalEntry(io.codat.lending.models.shared.AccountingJournalEntry accountingJournalEntry) { + Utils.checkNotNull(accountingJournalEntry, "accountingJournalEntry"); + this.accountingJournalEntry = JsonNullable.of(accountingJournalEntry); + return this; + } + + /** + * Success + */ + public GetAccountingJournalEntryResponse withAccountingJournalEntry(JsonNullable accountingJournalEntry) { + Utils.checkNotNull(accountingJournalEntry, "accountingJournalEntry"); + this.accountingJournalEntry = accountingJournalEntry; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingJournalEntryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingJournalEntryResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingJournalEntryResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingJournalEntryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingJournalEntryResponse 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; + } + GetAccountingJournalEntryResponse other = (GetAccountingJournalEntryResponse) o; + return + java.util.Objects.deepEquals(this.accountingJournalEntry, other.accountingJournalEntry) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingJournalEntry, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingJournalEntryResponse.class, + "accountingJournalEntry", accountingJournalEntry, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingJournalEntry = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingJournalEntry(io.codat.lending.models.shared.AccountingJournalEntry accountingJournalEntry) { + Utils.checkNotNull(accountingJournalEntry, "accountingJournalEntry"); + this.accountingJournalEntry = JsonNullable.of(accountingJournalEntry); + return this; + } + + /** + * Success + */ + public Builder accountingJournalEntry(JsonNullable accountingJournalEntry) { + Utils.checkNotNull(accountingJournalEntry, "accountingJournalEntry"); + this.accountingJournalEntry = accountingJournalEntry; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingJournalEntryResponse build() { + return new GetAccountingJournalEntryResponse( + accountingJournalEntry, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequest.java new file mode 100644 index 00000000..2e85f5e5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingJournalRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a journal. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=journalId") + private String journalId; + + public GetAccountingJournalRequest( + String companyId, + String journalId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(journalId, "journalId"); + this.companyId = companyId; + this.journalId = journalId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a journal. + */ + public String journalId() { + return journalId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingJournalRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a journal. + */ + public GetAccountingJournalRequest withJournalId(String journalId) { + Utils.checkNotNull(journalId, "journalId"); + this.journalId = journalId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingJournalRequest other = (GetAccountingJournalRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.journalId, other.journalId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + journalId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingJournalRequest.class, + "companyId", companyId, + "journalId", journalId); + } + + public final static class Builder { + + private String companyId; + + private String journalId; + + 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; + } + + /** + * Unique identifier for a journal. + */ + public Builder journalId(String journalId) { + Utils.checkNotNull(journalId, "journalId"); + this.journalId = journalId; + return this; + } + + public GetAccountingJournalRequest build() { + return new GetAccountingJournalRequest( + companyId, + journalId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequestBuilder.java new file mode 100644 index 00000000..ff8600c9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingJournalRequestBuilder { + + private GetAccountingJournalRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingJournal sdk; + + public GetAccountingJournalRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingJournal sdk) { + this.sdk = sdk; + } + + public GetAccountingJournalRequestBuilder request(GetAccountingJournalRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingJournalResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalResponse.java new file mode 100644 index 00000000..b735f35d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingJournalResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingJournalResponse { + + /** + * Success + */ + private JsonNullable accountingJournal; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingJournalResponse( + JsonNullable accountingJournal, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingJournal, "accountingJournal"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingJournal = accountingJournal; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingJournal() { + return accountingJournal; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingJournalResponse withAccountingJournal(io.codat.lending.models.shared.AccountingJournal accountingJournal) { + Utils.checkNotNull(accountingJournal, "accountingJournal"); + this.accountingJournal = JsonNullable.of(accountingJournal); + return this; + } + + /** + * Success + */ + public GetAccountingJournalResponse withAccountingJournal(JsonNullable accountingJournal) { + Utils.checkNotNull(accountingJournal, "accountingJournal"); + this.accountingJournal = accountingJournal; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingJournalResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingJournalResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingJournalResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingJournalResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingJournalResponse 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; + } + GetAccountingJournalResponse other = (GetAccountingJournalResponse) o; + return + java.util.Objects.deepEquals(this.accountingJournal, other.accountingJournal) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingJournal, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingJournalResponse.class, + "accountingJournal", accountingJournal, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingJournal = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingJournal(io.codat.lending.models.shared.AccountingJournal accountingJournal) { + Utils.checkNotNull(accountingJournal, "accountingJournal"); + this.accountingJournal = JsonNullable.of(accountingJournal); + return this; + } + + /** + * Success + */ + public Builder accountingJournal(JsonNullable accountingJournal) { + Utils.checkNotNull(accountingJournal, "accountingJournal"); + this.accountingJournal = accountingJournal; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingJournalResponse build() { + return new GetAccountingJournalResponse( + accountingJournal, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequest.java new file mode 100644 index 00000000..c349af58 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingPaymentRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a payment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=paymentId") + private String paymentId; + + public GetAccountingPaymentRequest( + String companyId, + String paymentId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(paymentId, "paymentId"); + this.companyId = companyId; + this.paymentId = paymentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a payment. + */ + public String paymentId() { + return paymentId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingPaymentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a payment. + */ + public GetAccountingPaymentRequest withPaymentId(String paymentId) { + Utils.checkNotNull(paymentId, "paymentId"); + this.paymentId = paymentId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingPaymentRequest other = (GetAccountingPaymentRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.paymentId, other.paymentId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + paymentId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingPaymentRequest.class, + "companyId", companyId, + "paymentId", paymentId); + } + + public final static class Builder { + + private String companyId; + + private String paymentId; + + 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; + } + + /** + * Unique identifier for a payment. + */ + public Builder paymentId(String paymentId) { + Utils.checkNotNull(paymentId, "paymentId"); + this.paymentId = paymentId; + return this; + } + + public GetAccountingPaymentRequest build() { + return new GetAccountingPaymentRequest( + companyId, + paymentId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequestBuilder.java new file mode 100644 index 00000000..131c8a50 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingPaymentRequestBuilder { + + private GetAccountingPaymentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingPayment sdk; + + public GetAccountingPaymentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingPayment sdk) { + this.sdk = sdk; + } + + public GetAccountingPaymentRequestBuilder request(GetAccountingPaymentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingPaymentResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentResponse.java new file mode 100644 index 00000000..855bf91a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingPaymentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingPaymentResponse { + + /** + * Success + */ + private JsonNullable accountingPayment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingPaymentResponse( + JsonNullable accountingPayment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingPayment = accountingPayment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingPayment() { + return accountingPayment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingPaymentResponse withAccountingPayment(io.codat.lending.models.shared.AccountingPayment accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = JsonNullable.of(accountingPayment); + return this; + } + + /** + * Success + */ + public GetAccountingPaymentResponse withAccountingPayment(JsonNullable accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = accountingPayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingPaymentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingPaymentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingPaymentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingPaymentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingPaymentResponse 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; + } + GetAccountingPaymentResponse other = (GetAccountingPaymentResponse) o; + return + java.util.Objects.deepEquals(this.accountingPayment, other.accountingPayment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingPayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingPaymentResponse.class, + "accountingPayment", accountingPayment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingPayment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingPayment(io.codat.lending.models.shared.AccountingPayment accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = JsonNullable.of(accountingPayment); + return this; + } + + /** + * Success + */ + public Builder accountingPayment(JsonNullable accountingPayment) { + Utils.checkNotNull(accountingPayment, "accountingPayment"); + this.accountingPayment = accountingPayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingPaymentResponse build() { + return new GetAccountingPaymentResponse( + accountingPayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequest.java new file mode 100644 index 00000000..64b8b3a0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingProfileRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetAccountingProfileRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingProfileRequest 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; + } + GetAccountingProfileRequest other = (GetAccountingProfileRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingProfileRequest.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 GetAccountingProfileRequest build() { + return new GetAccountingProfileRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequestBuilder.java new file mode 100644 index 00000000..3d8a9d5a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingProfileRequestBuilder { + + private GetAccountingProfileRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingProfile sdk; + + public GetAccountingProfileRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingProfile sdk) { + this.sdk = sdk; + } + + public GetAccountingProfileRequestBuilder request(GetAccountingProfileRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingProfileResponse call() throws Exception { + return sdk.getAccountingProfile( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileResponse.java new file mode 100644 index 00000000..ad79139c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfileResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingProfileResponse { + + /** + * Success + */ + private Optional accountingCompanyInfo; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingProfileResponse( + Optional accountingCompanyInfo, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCompanyInfo, "accountingCompanyInfo"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCompanyInfo = accountingCompanyInfo; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCompanyInfo() { + return accountingCompanyInfo; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingProfileResponse withAccountingCompanyInfo(io.codat.lending.models.shared.AccountingCompanyInfo accountingCompanyInfo) { + Utils.checkNotNull(accountingCompanyInfo, "accountingCompanyInfo"); + this.accountingCompanyInfo = Optional.ofNullable(accountingCompanyInfo); + return this; + } + + /** + * Success + */ + public GetAccountingProfileResponse withAccountingCompanyInfo(Optional accountingCompanyInfo) { + Utils.checkNotNull(accountingCompanyInfo, "accountingCompanyInfo"); + this.accountingCompanyInfo = accountingCompanyInfo; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingProfileResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingProfileResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingProfileResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingProfileResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingProfileResponse 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; + } + GetAccountingProfileResponse other = (GetAccountingProfileResponse) o; + return + java.util.Objects.deepEquals(this.accountingCompanyInfo, other.accountingCompanyInfo) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCompanyInfo, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingProfileResponse.class, + "accountingCompanyInfo", accountingCompanyInfo, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCompanyInfo = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCompanyInfo(io.codat.lending.models.shared.AccountingCompanyInfo accountingCompanyInfo) { + Utils.checkNotNull(accountingCompanyInfo, "accountingCompanyInfo"); + this.accountingCompanyInfo = Optional.ofNullable(accountingCompanyInfo); + return this; + } + + /** + * Success + */ + public Builder accountingCompanyInfo(Optional accountingCompanyInfo) { + Utils.checkNotNull(accountingCompanyInfo, "accountingCompanyInfo"); + this.accountingCompanyInfo = accountingCompanyInfo; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingProfileResponse build() { + return new GetAccountingProfileResponse( + accountingCompanyInfo, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequest.java new file mode 100644 index 00000000..9f677f63 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequest.java @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetAccountingProfitAndLossRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Number of months defining the period of interest. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private int periodLength; + + /** + * Number of periods with `periodLength` to compare. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodsToCompare") + private int periodsToCompare; + + /** + * The month the report starts from. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=startMonth") + private Optional startMonth; + + public GetAccountingProfitAndLossRequest( + String companyId, + int periodLength, + int periodsToCompare, + Optional startMonth) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + Utils.checkNotNull(startMonth, "startMonth"); + this.companyId = companyId; + this.periodLength = periodLength; + this.periodsToCompare = periodsToCompare; + this.startMonth = startMonth; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Number of months defining the period of interest. + */ + public int periodLength() { + return periodLength; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public int periodsToCompare() { + return periodsToCompare; + } + + /** + * The month the report starts from. + */ + public Optional startMonth() { + return startMonth; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingProfitAndLossRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Number of months defining the period of interest. + */ + public GetAccountingProfitAndLossRequest withPeriodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public GetAccountingProfitAndLossRequest withPeriodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingProfitAndLossRequest withStartMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public GetAccountingProfitAndLossRequest withStartMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingProfitAndLossRequest other = (GetAccountingProfitAndLossRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodsToCompare, other.periodsToCompare) && + java.util.Objects.deepEquals(this.startMonth, other.startMonth); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingProfitAndLossRequest.class, + "companyId", companyId, + "periodLength", periodLength, + "periodsToCompare", periodsToCompare, + "startMonth", startMonth); + } + + public final static class Builder { + + private String companyId; + + private Integer periodLength; + + private Integer periodsToCompare; + + private Optional startMonth = Optional.empty(); + + 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; + } + + /** + * Number of months defining the period of interest. + */ + public Builder periodLength(int periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * Number of periods with `periodLength` to compare. + */ + public Builder periodsToCompare(int periodsToCompare) { + Utils.checkNotNull(periodsToCompare, "periodsToCompare"); + this.periodsToCompare = periodsToCompare; + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(String startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = Optional.ofNullable(startMonth); + return this; + } + + /** + * The month the report starts from. + */ + public Builder startMonth(Optional startMonth) { + Utils.checkNotNull(startMonth, "startMonth"); + this.startMonth = startMonth; + return this; + } + + public GetAccountingProfitAndLossRequest build() { + return new GetAccountingProfitAndLossRequest( + companyId, + periodLength, + periodsToCompare, + startMonth); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequestBuilder.java new file mode 100644 index 00000000..9d7851c2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingProfitAndLossRequestBuilder { + + private GetAccountingProfitAndLossRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingProfitAndLoss sdk; + + public GetAccountingProfitAndLossRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingProfitAndLoss sdk) { + this.sdk = sdk; + } + + public GetAccountingProfitAndLossRequestBuilder request(GetAccountingProfitAndLossRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingProfitAndLossResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossResponse.java new file mode 100644 index 00000000..af64050e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingProfitAndLossResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAccountingProfitAndLossResponse { + + /** + * Success + */ + private Optional accountingProfitAndLossReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingProfitAndLossResponse( + Optional accountingProfitAndLossReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingProfitAndLossReport, "accountingProfitAndLossReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingProfitAndLossReport = accountingProfitAndLossReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingProfitAndLossReport() { + return accountingProfitAndLossReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingProfitAndLossResponse withAccountingProfitAndLossReport(io.codat.lending.models.shared.AccountingProfitAndLossReport accountingProfitAndLossReport) { + Utils.checkNotNull(accountingProfitAndLossReport, "accountingProfitAndLossReport"); + this.accountingProfitAndLossReport = Optional.ofNullable(accountingProfitAndLossReport); + return this; + } + + /** + * Success + */ + public GetAccountingProfitAndLossResponse withAccountingProfitAndLossReport(Optional accountingProfitAndLossReport) { + Utils.checkNotNull(accountingProfitAndLossReport, "accountingProfitAndLossReport"); + this.accountingProfitAndLossReport = accountingProfitAndLossReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingProfitAndLossResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingProfitAndLossResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingProfitAndLossResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingProfitAndLossResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingProfitAndLossResponse 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; + } + GetAccountingProfitAndLossResponse other = (GetAccountingProfitAndLossResponse) o; + return + java.util.Objects.deepEquals(this.accountingProfitAndLossReport, other.accountingProfitAndLossReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingProfitAndLossReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingProfitAndLossResponse.class, + "accountingProfitAndLossReport", accountingProfitAndLossReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingProfitAndLossReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingProfitAndLossReport(io.codat.lending.models.shared.AccountingProfitAndLossReport accountingProfitAndLossReport) { + Utils.checkNotNull(accountingProfitAndLossReport, "accountingProfitAndLossReport"); + this.accountingProfitAndLossReport = Optional.ofNullable(accountingProfitAndLossReport); + return this; + } + + /** + * Success + */ + public Builder accountingProfitAndLossReport(Optional accountingProfitAndLossReport) { + Utils.checkNotNull(accountingProfitAndLossReport, "accountingProfitAndLossReport"); + this.accountingProfitAndLossReport = accountingProfitAndLossReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingProfitAndLossResponse build() { + return new GetAccountingProfitAndLossResponse( + accountingProfitAndLossReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequest.java new file mode 100644 index 00000000..5623a0d5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequest.java @@ -0,0 +1,214 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingSupplierAttachmentRequest { + + /** + * Unique identifier for an attachment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=attachmentId") + private String attachmentId; + + /** + * 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; + + /** + * Unique identifier for a supplier. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=supplierId") + private String supplierId; + + public GetAccountingSupplierAttachmentRequest( + String attachmentId, + String companyId, + String connectionId, + String supplierId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(supplierId, "supplierId"); + this.attachmentId = attachmentId; + this.companyId = companyId; + this.connectionId = connectionId; + this.supplierId = supplierId; + } + + /** + * Unique identifier for an attachment. + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a supplier. + */ + public String supplierId() { + return supplierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an attachment. + */ + public GetAccountingSupplierAttachmentRequest withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetAccountingSupplierAttachmentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingSupplierAttachmentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a supplier. + */ + public GetAccountingSupplierAttachmentRequest withSupplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingSupplierAttachmentRequest other = (GetAccountingSupplierAttachmentRequest) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.supplierId, other.supplierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + companyId, + connectionId, + supplierId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingSupplierAttachmentRequest.class, + "attachmentId", attachmentId, + "companyId", companyId, + "connectionId", connectionId, + "supplierId", supplierId); + } + + public final static class Builder { + + private String attachmentId; + + private String companyId; + + private String connectionId; + + private String supplierId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for an attachment. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + 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; + } + + /** + * Unique identifier for a supplier. + */ + public Builder supplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + public GetAccountingSupplierAttachmentRequest build() { + return new GetAccountingSupplierAttachmentRequest( + attachmentId, + companyId, + connectionId, + supplierId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequestBuilder.java new file mode 100644 index 00000000..42a57f5f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingSupplierAttachmentRequestBuilder { + + private GetAccountingSupplierAttachmentRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingSupplierAttachment sdk; + + public GetAccountingSupplierAttachmentRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingSupplierAttachment sdk) { + this.sdk = sdk; + } + + public GetAccountingSupplierAttachmentRequestBuilder request(GetAccountingSupplierAttachmentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingSupplierAttachmentResponse call() throws Exception { + return sdk.getAttachment( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentResponse.java new file mode 100644 index 00000000..fe10e239 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierAttachmentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingSupplierAttachmentResponse { + + /** + * Success + */ + private JsonNullable accountingAttachment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingSupplierAttachmentResponse( + JsonNullable accountingAttachment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAttachment = accountingAttachment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingAttachment() { + return accountingAttachment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingSupplierAttachmentResponse withAccountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public GetAccountingSupplierAttachmentResponse withAccountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingSupplierAttachmentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingSupplierAttachmentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingSupplierAttachmentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingSupplierAttachmentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingSupplierAttachmentResponse 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; + } + GetAccountingSupplierAttachmentResponse other = (GetAccountingSupplierAttachmentResponse) o; + return + java.util.Objects.deepEquals(this.accountingAttachment, other.accountingAttachment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingSupplierAttachmentResponse.class, + "accountingAttachment", accountingAttachment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingAttachment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAttachment(io.codat.lending.models.shared.AccountingAttachment accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = JsonNullable.of(accountingAttachment); + return this; + } + + /** + * Success + */ + public Builder accountingAttachment(JsonNullable accountingAttachment) { + Utils.checkNotNull(accountingAttachment, "accountingAttachment"); + this.accountingAttachment = accountingAttachment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingSupplierAttachmentResponse build() { + return new GetAccountingSupplierAttachmentResponse( + accountingAttachment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequest.java new file mode 100644 index 00000000..a28de775 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingSupplierRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for a supplier. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=supplierId") + private String supplierId; + + public GetAccountingSupplierRequest( + String companyId, + String supplierId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(supplierId, "supplierId"); + this.companyId = companyId; + this.supplierId = supplierId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a supplier. + */ + public String supplierId() { + return supplierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingSupplierRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a supplier. + */ + public GetAccountingSupplierRequest withSupplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingSupplierRequest other = (GetAccountingSupplierRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.supplierId, other.supplierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + supplierId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingSupplierRequest.class, + "companyId", companyId, + "supplierId", supplierId); + } + + public final static class Builder { + + private String companyId; + + private String supplierId; + + 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; + } + + /** + * Unique identifier for a supplier. + */ + public Builder supplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + public GetAccountingSupplierRequest build() { + return new GetAccountingSupplierRequest( + companyId, + supplierId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequestBuilder.java new file mode 100644 index 00000000..7aa38852 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingSupplierRequestBuilder { + + private GetAccountingSupplierRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingSupplier sdk; + + public GetAccountingSupplierRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingSupplier sdk) { + this.sdk = sdk; + } + + public GetAccountingSupplierRequestBuilder request(GetAccountingSupplierRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingSupplierResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierResponse.java new file mode 100644 index 00000000..3b7c876b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingSupplierResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingSupplierResponse { + + /** + * Success + */ + private JsonNullable accountingSupplier; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingSupplierResponse( + JsonNullable accountingSupplier, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingSupplier = accountingSupplier; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingSupplier() { + return accountingSupplier; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingSupplierResponse withAccountingSupplier(io.codat.lending.models.shared.AccountingSupplier accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = JsonNullable.of(accountingSupplier); + return this; + } + + /** + * Success + */ + public GetAccountingSupplierResponse withAccountingSupplier(JsonNullable accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = accountingSupplier; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingSupplierResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingSupplierResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingSupplierResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingSupplierResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingSupplierResponse 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; + } + GetAccountingSupplierResponse other = (GetAccountingSupplierResponse) o; + return + java.util.Objects.deepEquals(this.accountingSupplier, other.accountingSupplier) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingSupplier, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingSupplierResponse.class, + "accountingSupplier", accountingSupplier, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingSupplier = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingSupplier(io.codat.lending.models.shared.AccountingSupplier accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = JsonNullable.of(accountingSupplier); + return this; + } + + /** + * Success + */ + public Builder accountingSupplier(JsonNullable accountingSupplier) { + Utils.checkNotNull(accountingSupplier, "accountingSupplier"); + this.accountingSupplier = accountingSupplier; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingSupplierResponse build() { + return new GetAccountingSupplierResponse( + accountingSupplier, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequest.java new file mode 100644 index 00000000..26f95e18 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetAccountingTransferRequest { + + /** + * 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; + + /** + * Unique identifier for a transfer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=transferId") + private String transferId; + + public GetAccountingTransferRequest( + String companyId, + String connectionId, + String transferId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(transferId, "transferId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.transferId = transferId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a transfer. + */ + public String transferId() { + return transferId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetAccountingTransferRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetAccountingTransferRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a transfer. + */ + public GetAccountingTransferRequest withTransferId(String transferId) { + Utils.checkNotNull(transferId, "transferId"); + this.transferId = transferId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingTransferRequest other = (GetAccountingTransferRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.transferId, other.transferId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + transferId); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingTransferRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "transferId", transferId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String transferId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a transfer. + */ + public Builder transferId(String transferId) { + Utils.checkNotNull(transferId, "transferId"); + this.transferId = transferId; + return this; + } + + public GetAccountingTransferRequest build() { + return new GetAccountingTransferRequest( + companyId, + connectionId, + transferId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequestBuilder.java new file mode 100644 index 00000000..9a553441 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetAccountingTransferRequestBuilder { + + private GetAccountingTransferRequest request; + + private final SDKMethodInterfaces.MethodCallGetAccountingTransfer sdk; + + public GetAccountingTransferRequestBuilder(SDKMethodInterfaces.MethodCallGetAccountingTransfer sdk) { + this.sdk = sdk; + } + + public GetAccountingTransferRequestBuilder request(GetAccountingTransferRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetAccountingTransferResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferResponse.java new file mode 100644 index 00000000..3b1aed1b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetAccountingTransferResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetAccountingTransferResponse { + + /** + * Success + */ + private JsonNullable accountingTransfer; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetAccountingTransferResponse( + JsonNullable accountingTransfer, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingTransfer = accountingTransfer; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable accountingTransfer() { + return accountingTransfer; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetAccountingTransferResponse withAccountingTransfer(io.codat.lending.models.shared.AccountingTransfer accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = JsonNullable.of(accountingTransfer); + return this; + } + + /** + * Success + */ + public GetAccountingTransferResponse withAccountingTransfer(JsonNullable accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = accountingTransfer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetAccountingTransferResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingTransferResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetAccountingTransferResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAccountingTransferResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAccountingTransferResponse 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; + } + GetAccountingTransferResponse other = (GetAccountingTransferResponse) o; + return + java.util.Objects.deepEquals(this.accountingTransfer, other.accountingTransfer) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingTransfer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingTransferResponse.class, + "accountingTransfer", accountingTransfer, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable accountingTransfer = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingTransfer(io.codat.lending.models.shared.AccountingTransfer accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = JsonNullable.of(accountingTransfer); + return this; + } + + /** + * Success + */ + public Builder accountingTransfer(JsonNullable accountingTransfer) { + Utils.checkNotNull(accountingTransfer, "accountingTransfer"); + this.accountingTransfer = accountingTransfer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetAccountingTransferResponse build() { + return new GetAccountingTransferResponse( + accountingTransfer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequest.java new file mode 100644 index 00000000..8f1ad2ba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetBankingAccountRequest { + + /** + * 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; + + public GetBankingAccountRequest( + 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. + */ + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account. + */ + public GetBankingAccountRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public GetBankingAccountRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetBankingAccountRequest 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; + } + GetBankingAccountRequest other = (GetBankingAccountRequest) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetBankingAccountRequest.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 GetBankingAccountRequest build() { + return new GetBankingAccountRequest( + accountId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequestBuilder.java new file mode 100644 index 00000000..7f610837 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetBankingAccountRequestBuilder { + + private GetBankingAccountRequest request; + + private final SDKMethodInterfaces.MethodCallGetBankingAccount sdk; + + public GetBankingAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetBankingAccount sdk) { + this.sdk = sdk; + } + + public GetBankingAccountRequestBuilder request(GetBankingAccountRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetBankingAccountResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountResponse.java new file mode 100644 index 00000000..dae74e1b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingAccountResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetBankingAccountResponse { + + /** + * Success + */ + private JsonNullable bankingAccount; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetBankingAccountResponse( + JsonNullable bankingAccount, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingAccount, "bankingAccount"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingAccount = bankingAccount; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable bankingAccount() { + return bankingAccount; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetBankingAccountResponse withBankingAccount(io.codat.lending.models.shared.BankingAccount bankingAccount) { + Utils.checkNotNull(bankingAccount, "bankingAccount"); + this.bankingAccount = JsonNullable.of(bankingAccount); + return this; + } + + /** + * Success + */ + public GetBankingAccountResponse withBankingAccount(JsonNullable bankingAccount) { + Utils.checkNotNull(bankingAccount, "bankingAccount"); + this.bankingAccount = bankingAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetBankingAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingAccountResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingAccountResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetBankingAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBankingAccountResponse 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; + } + GetBankingAccountResponse other = (GetBankingAccountResponse) o; + return + java.util.Objects.deepEquals(this.bankingAccount, other.bankingAccount) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBankingAccountResponse.class, + "bankingAccount", bankingAccount, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable bankingAccount = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingAccount(io.codat.lending.models.shared.BankingAccount bankingAccount) { + Utils.checkNotNull(bankingAccount, "bankingAccount"); + this.bankingAccount = JsonNullable.of(bankingAccount); + return this; + } + + /** + * Success + */ + public Builder bankingAccount(JsonNullable bankingAccount) { + Utils.checkNotNull(bankingAccount, "bankingAccount"); + this.bankingAccount = bankingAccount; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetBankingAccountResponse build() { + return new GetBankingAccountResponse( + bankingAccount, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequest.java new file mode 100644 index 00000000..1420e9f2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetBankingTransactionCategoryRequest { + + /** + * 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; + + /** + * The unique identifier for a banking transaction category + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=transactionCategoryId") + private String transactionCategoryId; + + public GetBankingTransactionCategoryRequest( + String companyId, + String connectionId, + String transactionCategoryId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(transactionCategoryId, "transactionCategoryId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.transactionCategoryId = transactionCategoryId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * The unique identifier for a banking transaction category + */ + public String transactionCategoryId() { + return transactionCategoryId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetBankingTransactionCategoryRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetBankingTransactionCategoryRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The unique identifier for a banking transaction category + */ + public GetBankingTransactionCategoryRequest withTransactionCategoryId(String transactionCategoryId) { + Utils.checkNotNull(transactionCategoryId, "transactionCategoryId"); + this.transactionCategoryId = transactionCategoryId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBankingTransactionCategoryRequest other = (GetBankingTransactionCategoryRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.transactionCategoryId, other.transactionCategoryId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + transactionCategoryId); + } + + @Override + public String toString() { + return Utils.toString(GetBankingTransactionCategoryRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "transactionCategoryId", transactionCategoryId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String transactionCategoryId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The unique identifier for a banking transaction category + */ + public Builder transactionCategoryId(String transactionCategoryId) { + Utils.checkNotNull(transactionCategoryId, "transactionCategoryId"); + this.transactionCategoryId = transactionCategoryId; + return this; + } + + public GetBankingTransactionCategoryRequest build() { + return new GetBankingTransactionCategoryRequest( + companyId, + connectionId, + transactionCategoryId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequestBuilder.java new file mode 100644 index 00000000..a6642f7a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetBankingTransactionCategoryRequestBuilder { + + private GetBankingTransactionCategoryRequest request; + + private final SDKMethodInterfaces.MethodCallGetBankingTransactionCategory sdk; + + public GetBankingTransactionCategoryRequestBuilder(SDKMethodInterfaces.MethodCallGetBankingTransactionCategory sdk) { + this.sdk = sdk; + } + + public GetBankingTransactionCategoryRequestBuilder request(GetBankingTransactionCategoryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetBankingTransactionCategoryResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryResponse.java new file mode 100644 index 00000000..f95e81e5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionCategoryResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetBankingTransactionCategoryResponse { + + /** + * Success + */ + private JsonNullable bankingTransactionCategory; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetBankingTransactionCategoryResponse( + JsonNullable bankingTransactionCategory, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingTransactionCategory, "bankingTransactionCategory"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingTransactionCategory = bankingTransactionCategory; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable bankingTransactionCategory() { + return bankingTransactionCategory; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetBankingTransactionCategoryResponse withBankingTransactionCategory(io.codat.lending.models.shared.BankingTransactionCategory bankingTransactionCategory) { + Utils.checkNotNull(bankingTransactionCategory, "bankingTransactionCategory"); + this.bankingTransactionCategory = JsonNullable.of(bankingTransactionCategory); + return this; + } + + /** + * Success + */ + public GetBankingTransactionCategoryResponse withBankingTransactionCategory(JsonNullable bankingTransactionCategory) { + Utils.checkNotNull(bankingTransactionCategory, "bankingTransactionCategory"); + this.bankingTransactionCategory = bankingTransactionCategory; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetBankingTransactionCategoryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingTransactionCategoryResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingTransactionCategoryResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetBankingTransactionCategoryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBankingTransactionCategoryResponse 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; + } + GetBankingTransactionCategoryResponse other = (GetBankingTransactionCategoryResponse) o; + return + java.util.Objects.deepEquals(this.bankingTransactionCategory, other.bankingTransactionCategory) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingTransactionCategory, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBankingTransactionCategoryResponse.class, + "bankingTransactionCategory", bankingTransactionCategory, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable bankingTransactionCategory = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingTransactionCategory(io.codat.lending.models.shared.BankingTransactionCategory bankingTransactionCategory) { + Utils.checkNotNull(bankingTransactionCategory, "bankingTransactionCategory"); + this.bankingTransactionCategory = JsonNullable.of(bankingTransactionCategory); + return this; + } + + /** + * Success + */ + public Builder bankingTransactionCategory(JsonNullable bankingTransactionCategory) { + Utils.checkNotNull(bankingTransactionCategory, "bankingTransactionCategory"); + this.bankingTransactionCategory = bankingTransactionCategory; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetBankingTransactionCategoryResponse build() { + return new GetBankingTransactionCategoryResponse( + bankingTransactionCategory, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequest.java new file mode 100644 index 00000000..2303b033 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetBankingTransactionRequest { + + /** + * 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; + + /** + * The unique identifier for a transaction + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=transactionId") + private String transactionId; + + public GetBankingTransactionRequest( + String companyId, + String connectionId, + String transactionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(transactionId, "transactionId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.transactionId = transactionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * The unique identifier for a transaction + */ + public String transactionId() { + return transactionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetBankingTransactionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetBankingTransactionRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The unique identifier for a transaction + */ + public GetBankingTransactionRequest withTransactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBankingTransactionRequest other = (GetBankingTransactionRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.transactionId, other.transactionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + transactionId); + } + + @Override + public String toString() { + return Utils.toString(GetBankingTransactionRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "transactionId", transactionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String transactionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The unique identifier for a transaction + */ + public Builder transactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + public GetBankingTransactionRequest build() { + return new GetBankingTransactionRequest( + companyId, + connectionId, + transactionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequestBuilder.java new file mode 100644 index 00000000..a55a28e9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetBankingTransactionRequestBuilder { + + private GetBankingTransactionRequest request; + + private final SDKMethodInterfaces.MethodCallGetBankingTransaction sdk; + + public GetBankingTransactionRequestBuilder(SDKMethodInterfaces.MethodCallGetBankingTransaction sdk) { + this.sdk = sdk; + } + + public GetBankingTransactionRequestBuilder request(GetBankingTransactionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetBankingTransactionResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionResponse.java new file mode 100644 index 00000000..1d619121 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetBankingTransactionResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetBankingTransactionResponse { + + /** + * Success + */ + private JsonNullable bankingTransaction; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetBankingTransactionResponse( + JsonNullable bankingTransaction, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingTransaction, "bankingTransaction"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingTransaction = bankingTransaction; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public JsonNullable bankingTransaction() { + return bankingTransaction; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public GetBankingTransactionResponse withBankingTransaction(io.codat.lending.models.shared.BankingTransaction bankingTransaction) { + Utils.checkNotNull(bankingTransaction, "bankingTransaction"); + this.bankingTransaction = JsonNullable.of(bankingTransaction); + return this; + } + + /** + * Success + */ + public GetBankingTransactionResponse withBankingTransaction(JsonNullable bankingTransaction) { + Utils.checkNotNull(bankingTransaction, "bankingTransaction"); + this.bankingTransaction = bankingTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetBankingTransactionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingTransactionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetBankingTransactionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetBankingTransactionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBankingTransactionResponse 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; + } + GetBankingTransactionResponse other = (GetBankingTransactionResponse) o; + return + java.util.Objects.deepEquals(this.bankingTransaction, other.bankingTransaction) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBankingTransactionResponse.class, + "bankingTransaction", bankingTransaction, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable bankingTransaction = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingTransaction(io.codat.lending.models.shared.BankingTransaction bankingTransaction) { + Utils.checkNotNull(bankingTransaction, "bankingTransaction"); + this.bankingTransaction = JsonNullable.of(bankingTransaction); + return this; + } + + /** + * Success + */ + public Builder bankingTransaction(JsonNullable bankingTransaction) { + Utils.checkNotNull(bankingTransaction, "bankingTransaction"); + this.bankingTransaction = bankingTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetBankingTransactionResponse build() { + return new GetBankingTransactionResponse( + bankingTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequest.java new file mode 100644 index 00000000..59f67638 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequest.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCategorizedBalanceSheetStatementRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private Optional numberOfPeriods; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCategorizedBalanceSheetStatementRequest( + String companyId, + Optional numberOfPeriods, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.numberOfPeriods = numberOfPeriods; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Optional numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCategorizedBalanceSheetStatementRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public GetCategorizedBalanceSheetStatementRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public GetCategorizedBalanceSheetStatementRequest withNumberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCategorizedBalanceSheetStatementRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCategorizedBalanceSheetStatementRequest other = (GetCategorizedBalanceSheetStatementRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + numberOfPeriods, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedBalanceSheetStatementRequest.class, + "companyId", companyId, + "numberOfPeriods", numberOfPeriods, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private Optional numberOfPeriods = Optional.empty(); + + private String reportDate; + + 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; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Builder numberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCategorizedBalanceSheetStatementRequest build() { + return new GetCategorizedBalanceSheetStatementRequest( + companyId, + numberOfPeriods, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequestBuilder.java new file mode 100644 index 00000000..f45a47e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCategorizedBalanceSheetStatementRequestBuilder { + + private GetCategorizedBalanceSheetStatementRequest request; + + private final SDKMethodInterfaces.MethodCallGetCategorizedBalanceSheetStatement sdk; + + public GetCategorizedBalanceSheetStatementRequestBuilder(SDKMethodInterfaces.MethodCallGetCategorizedBalanceSheetStatement sdk) { + this.sdk = sdk; + } + + public GetCategorizedBalanceSheetStatementRequestBuilder request(GetCategorizedBalanceSheetStatementRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCategorizedBalanceSheetStatementResponse call() throws Exception { + return sdk.getCategorizedAccounts( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementResponse.java new file mode 100644 index 00000000..098c8ac9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBalanceSheetStatementResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCategorizedBalanceSheetStatementResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional enhancedFinancialReport; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCategorizedBalanceSheetStatementResponse( + String contentType, + Optional enhancedFinancialReport, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.enhancedFinancialReport = enhancedFinancialReport; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional enhancedFinancialReport() { + return enhancedFinancialReport; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCategorizedBalanceSheetStatementResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetCategorizedBalanceSheetStatementResponse withEnhancedFinancialReport(io.codat.lending.models.shared.EnhancedFinancialReport enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = Optional.ofNullable(enhancedFinancialReport); + return this; + } + + /** + * OK + */ + public GetCategorizedBalanceSheetStatementResponse withEnhancedFinancialReport(Optional enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = enhancedFinancialReport; + return this; + } + + /** + * The request made is not valid. + */ + public GetCategorizedBalanceSheetStatementResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCategorizedBalanceSheetStatementResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCategorizedBalanceSheetStatementResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCategorizedBalanceSheetStatementResponse 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; + } + GetCategorizedBalanceSheetStatementResponse other = (GetCategorizedBalanceSheetStatementResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.enhancedFinancialReport, other.enhancedFinancialReport) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + enhancedFinancialReport, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedBalanceSheetStatementResponse.class, + "contentType", contentType, + "enhancedFinancialReport", enhancedFinancialReport, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional enhancedFinancialReport = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder enhancedFinancialReport(io.codat.lending.models.shared.EnhancedFinancialReport enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = Optional.ofNullable(enhancedFinancialReport); + return this; + } + + /** + * OK + */ + public Builder enhancedFinancialReport(Optional enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = enhancedFinancialReport; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCategorizedBalanceSheetStatementResponse build() { + return new GetCategorizedBalanceSheetStatementResponse( + contentType, + enhancedFinancialReport, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequest.java new file mode 100644 index 00000000..6f37b38c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequest.java @@ -0,0 +1,289 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCategorizedBankStatementRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public GetCategorizedBankStatementRequest( + String companyId, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCategorizedBankStatementRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public GetCategorizedBankStatementRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public GetCategorizedBankStatementRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public GetCategorizedBankStatementRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public GetCategorizedBankStatementRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public GetCategorizedBankStatementRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public GetCategorizedBankStatementRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCategorizedBankStatementRequest other = (GetCategorizedBankStatementRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedBankStatementRequest.class, + "companyId", companyId, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public GetCategorizedBankStatementRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new GetCategorizedBankStatementRequest( + companyId, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequestBuilder.java new file mode 100644 index 00000000..d31d03c0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCategorizedBankStatementRequestBuilder { + + private GetCategorizedBankStatementRequest request; + + private final SDKMethodInterfaces.MethodCallGetCategorizedBankStatement sdk; + + public GetCategorizedBankStatementRequestBuilder(SDKMethodInterfaces.MethodCallGetCategorizedBankStatement sdk) { + this.sdk = sdk; + } + + public GetCategorizedBankStatementRequestBuilder request(GetCategorizedBankStatementRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCategorizedBankStatementResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementResponse.java new file mode 100644 index 00000000..a7cbb33d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedBankStatementResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCategorizedBankStatementResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional enhancedCashFlowTransactions; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCategorizedBankStatementResponse( + String contentType, + Optional enhancedCashFlowTransactions, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(enhancedCashFlowTransactions, "enhancedCashFlowTransactions"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.enhancedCashFlowTransactions = enhancedCashFlowTransactions; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional enhancedCashFlowTransactions() { + return enhancedCashFlowTransactions; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCategorizedBankStatementResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetCategorizedBankStatementResponse withEnhancedCashFlowTransactions(io.codat.lending.models.shared.EnhancedCashFlowTransactions enhancedCashFlowTransactions) { + Utils.checkNotNull(enhancedCashFlowTransactions, "enhancedCashFlowTransactions"); + this.enhancedCashFlowTransactions = Optional.ofNullable(enhancedCashFlowTransactions); + return this; + } + + /** + * OK + */ + public GetCategorizedBankStatementResponse withEnhancedCashFlowTransactions(Optional enhancedCashFlowTransactions) { + Utils.checkNotNull(enhancedCashFlowTransactions, "enhancedCashFlowTransactions"); + this.enhancedCashFlowTransactions = enhancedCashFlowTransactions; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetCategorizedBankStatementResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetCategorizedBankStatementResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCategorizedBankStatementResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCategorizedBankStatementResponse 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; + } + GetCategorizedBankStatementResponse other = (GetCategorizedBankStatementResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.enhancedCashFlowTransactions, other.enhancedCashFlowTransactions) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + enhancedCashFlowTransactions, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedBankStatementResponse.class, + "contentType", contentType, + "enhancedCashFlowTransactions", enhancedCashFlowTransactions, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional enhancedCashFlowTransactions = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder enhancedCashFlowTransactions(io.codat.lending.models.shared.EnhancedCashFlowTransactions enhancedCashFlowTransactions) { + Utils.checkNotNull(enhancedCashFlowTransactions, "enhancedCashFlowTransactions"); + this.enhancedCashFlowTransactions = Optional.ofNullable(enhancedCashFlowTransactions); + return this; + } + + /** + * OK + */ + public Builder enhancedCashFlowTransactions(Optional enhancedCashFlowTransactions) { + Utils.checkNotNull(enhancedCashFlowTransactions, "enhancedCashFlowTransactions"); + this.enhancedCashFlowTransactions = enhancedCashFlowTransactions; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCategorizedBankStatementResponse build() { + return new GetCategorizedBankStatementResponse( + contentType, + enhancedCashFlowTransactions, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequest.java new file mode 100644 index 00000000..7a8eff2e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequest.java @@ -0,0 +1,211 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCategorizedProfitAndLossStatementRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private Optional numberOfPeriods; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private Optional reportDate; + + public GetCategorizedProfitAndLossStatementRequest( + String companyId, + Optional numberOfPeriods, + Optional reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.numberOfPeriods = numberOfPeriods; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Optional numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Optional reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCategorizedProfitAndLossStatementRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public GetCategorizedProfitAndLossStatementRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public GetCategorizedProfitAndLossStatementRequest withNumberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCategorizedProfitAndLossStatementRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCategorizedProfitAndLossStatementRequest withReportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCategorizedProfitAndLossStatementRequest other = (GetCategorizedProfitAndLossStatementRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + numberOfPeriods, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedProfitAndLossStatementRequest.class, + "companyId", companyId, + "numberOfPeriods", numberOfPeriods, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private Optional numberOfPeriods = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + 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; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = Optional.ofNullable(numberOfPeriods); + return this; + } + + /** + * The number of periods to return. If not provided, 12 periods will be used as the default value. + */ + public Builder numberOfPeriods(Optional numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCategorizedProfitAndLossStatementRequest build() { + return new GetCategorizedProfitAndLossStatementRequest( + companyId, + numberOfPeriods, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequestBuilder.java new file mode 100644 index 00000000..4bcbbbc2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCategorizedProfitAndLossStatementRequestBuilder { + + private GetCategorizedProfitAndLossStatementRequest request; + + private final SDKMethodInterfaces.MethodCallGetCategorizedProfitAndLossStatement sdk; + + public GetCategorizedProfitAndLossStatementRequestBuilder(SDKMethodInterfaces.MethodCallGetCategorizedProfitAndLossStatement sdk) { + this.sdk = sdk; + } + + public GetCategorizedProfitAndLossStatementRequestBuilder request(GetCategorizedProfitAndLossStatementRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCategorizedProfitAndLossStatementResponse call() throws Exception { + return sdk.getCategorizedAccounts( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementResponse.java new file mode 100644 index 00000000..2610f742 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCategorizedProfitAndLossStatementResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCategorizedProfitAndLossStatementResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional enhancedFinancialReport; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCategorizedProfitAndLossStatementResponse( + String contentType, + Optional enhancedFinancialReport, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.enhancedFinancialReport = enhancedFinancialReport; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional enhancedFinancialReport() { + return enhancedFinancialReport; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCategorizedProfitAndLossStatementResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetCategorizedProfitAndLossStatementResponse withEnhancedFinancialReport(io.codat.lending.models.shared.EnhancedFinancialReport enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = Optional.ofNullable(enhancedFinancialReport); + return this; + } + + /** + * OK + */ + public GetCategorizedProfitAndLossStatementResponse withEnhancedFinancialReport(Optional enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = enhancedFinancialReport; + return this; + } + + /** + * The request made is not valid. + */ + public GetCategorizedProfitAndLossStatementResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCategorizedProfitAndLossStatementResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCategorizedProfitAndLossStatementResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCategorizedProfitAndLossStatementResponse 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; + } + GetCategorizedProfitAndLossStatementResponse other = (GetCategorizedProfitAndLossStatementResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.enhancedFinancialReport, other.enhancedFinancialReport) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + enhancedFinancialReport, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCategorizedProfitAndLossStatementResponse.class, + "contentType", contentType, + "enhancedFinancialReport", enhancedFinancialReport, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional enhancedFinancialReport = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder enhancedFinancialReport(io.codat.lending.models.shared.EnhancedFinancialReport enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = Optional.ofNullable(enhancedFinancialReport); + return this; + } + + /** + * OK + */ + public Builder enhancedFinancialReport(Optional enhancedFinancialReport) { + Utils.checkNotNull(enhancedFinancialReport, "enhancedFinancialReport"); + this.enhancedFinancialReport = enhancedFinancialReport; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCategorizedProfitAndLossStatementResponse build() { + return new GetCategorizedProfitAndLossStatementResponse( + contentType, + enhancedFinancialReport, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequest.java new file mode 100644 index 00000000..783ee275 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceCustomerRequest { + + /** + * 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; + + /** + * Unique identifier for a customer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=customerId") + private String customerId; + + public GetCommerceCustomerRequest( + String companyId, + String connectionId, + String customerId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(customerId, "customerId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.customerId = customerId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a customer. + */ + public String customerId() { + return customerId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceCustomerRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceCustomerRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public GetCommerceCustomerRequest withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceCustomerRequest other = (GetCommerceCustomerRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.customerId, other.customerId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + customerId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceCustomerRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "customerId", customerId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String customerId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + public GetCommerceCustomerRequest build() { + return new GetCommerceCustomerRequest( + companyId, + connectionId, + customerId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequestBuilder.java new file mode 100644 index 00000000..4895b0cc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceCustomerRequestBuilder { + + private GetCommerceCustomerRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceCustomer sdk; + + public GetCommerceCustomerRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceCustomer sdk) { + this.sdk = sdk; + } + + public GetCommerceCustomerRequestBuilder request(GetCommerceCustomerRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceCustomerResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerResponse.java new file mode 100644 index 00000000..02cf2469 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceCustomerResponse { + + /** + * OK + */ + private JsonNullable commerceCustomer; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceCustomerResponse( + JsonNullable commerceCustomer, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceCustomer, "commerceCustomer"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceCustomer = commerceCustomer; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceCustomer() { + return commerceCustomer; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceCustomerResponse withCommerceCustomer(io.codat.lending.models.shared.CommerceCustomer commerceCustomer) { + Utils.checkNotNull(commerceCustomer, "commerceCustomer"); + this.commerceCustomer = JsonNullable.of(commerceCustomer); + return this; + } + + /** + * OK + */ + public GetCommerceCustomerResponse withCommerceCustomer(JsonNullable commerceCustomer) { + Utils.checkNotNull(commerceCustomer, "commerceCustomer"); + this.commerceCustomer = commerceCustomer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceCustomerResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceCustomerResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceCustomerResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceCustomerResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceCustomerResponse 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; + } + GetCommerceCustomerResponse other = (GetCommerceCustomerResponse) o; + return + java.util.Objects.deepEquals(this.commerceCustomer, other.commerceCustomer) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceCustomer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceCustomerResponse.class, + "commerceCustomer", commerceCustomer, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceCustomer = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceCustomer(io.codat.lending.models.shared.CommerceCustomer commerceCustomer) { + Utils.checkNotNull(commerceCustomer, "commerceCustomer"); + this.commerceCustomer = JsonNullable.of(commerceCustomer); + return this; + } + + /** + * OK + */ + public Builder commerceCustomer(JsonNullable commerceCustomer) { + Utils.checkNotNull(commerceCustomer, "commerceCustomer"); + this.commerceCustomer = commerceCustomer; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceCustomerResponse build() { + return new GetCommerceCustomerResponse( + commerceCustomer, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequest.java new file mode 100644 index 00000000..f32b5d9d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequest.java @@ -0,0 +1,353 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCommerceCustomerRetentionMetricsRequest { + + /** + * 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; + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDisplayNames") + private Optional includeDisplayNames; + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private long numberOfPeriods; + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private long periodLength; + + /** + * The period unit of time returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodUnit") + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCommerceCustomerRetentionMetricsRequest( + String companyId, + String connectionId, + Optional includeDisplayNames, + long numberOfPeriods, + long periodLength, + io.codat.lending.models.shared.PeriodUnit periodUnit, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodUnit, "periodUnit"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.connectionId = connectionId; + this.includeDisplayNames = includeDisplayNames; + this.numberOfPeriods = numberOfPeriods; + this.periodLength = periodLength; + this.periodUnit = periodUnit; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Optional includeDisplayNames() { + return includeDisplayNames; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public long numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public long periodLength() { + return periodLength; + } + + /** + * The period unit of time returned. + */ + public io.codat.lending.models.shared.PeriodUnit periodUnit() { + return periodUnit; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceCustomerRetentionMetricsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceCustomerRetentionMetricsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceCustomerRetentionMetricsRequest withIncludeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceCustomerRetentionMetricsRequest withIncludeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public GetCommerceCustomerRetentionMetricsRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public GetCommerceCustomerRetentionMetricsRequest withPeriodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public GetCommerceCustomerRetentionMetricsRequest withPeriodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCommerceCustomerRetentionMetricsRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceCustomerRetentionMetricsRequest other = (GetCommerceCustomerRetentionMetricsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.includeDisplayNames, other.includeDisplayNames) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodUnit, other.periodUnit) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceCustomerRetentionMetricsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "includeDisplayNames", includeDisplayNames, + "numberOfPeriods", numberOfPeriods, + "periodLength", periodLength, + "periodUnit", periodUnit, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional includeDisplayNames = Optional.empty(); + + private Long numberOfPeriods; + + private Long periodLength; + + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + private String reportDate; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public Builder periodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public Builder periodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCommerceCustomerRetentionMetricsRequest build() { + return new GetCommerceCustomerRetentionMetricsRequest( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequestBuilder.java new file mode 100644 index 00000000..91981502 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceCustomerRetentionMetricsRequestBuilder { + + private GetCommerceCustomerRetentionMetricsRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceCustomerRetentionMetrics sdk; + + public GetCommerceCustomerRetentionMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceCustomerRetentionMetrics sdk) { + this.sdk = sdk; + } + + public GetCommerceCustomerRetentionMetricsRequestBuilder request(GetCommerceCustomerRetentionMetricsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceCustomerRetentionMetricsResponse call() throws Exception { + return sdk.getCustomerRetention( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsResponse.java new file mode 100644 index 00000000..e5f8b252 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceCustomerRetentionMetricsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceCustomerRetentionMetricsResponse { + + /** + * OK + */ + private Optional commerceReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceCustomerRetentionMetricsResponse( + Optional commerceReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceReport, "commerceReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceReport = commerceReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceReport() { + return commerceReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceCustomerRetentionMetricsResponse withCommerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public GetCommerceCustomerRetentionMetricsResponse withCommerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceCustomerRetentionMetricsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceCustomerRetentionMetricsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceCustomerRetentionMetricsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceCustomerRetentionMetricsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceCustomerRetentionMetricsResponse 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; + } + GetCommerceCustomerRetentionMetricsResponse other = (GetCommerceCustomerRetentionMetricsResponse) o; + return + java.util.Objects.deepEquals(this.commerceReport, other.commerceReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceCustomerRetentionMetricsResponse.class, + "commerceReport", commerceReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public Builder commerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceCustomerRetentionMetricsResponse build() { + return new GetCommerceCustomerRetentionMetricsResponse( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequest.java new file mode 100644 index 00000000..73559ee4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceDisputeRequest { + + /** + * 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; + + /** + * Unique identifier for a dispute. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=disputeId") + private String disputeId; + + public GetCommerceDisputeRequest( + String companyId, + String connectionId, + String disputeId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(disputeId, "disputeId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.disputeId = disputeId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a dispute. + */ + public String disputeId() { + return disputeId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceDisputeRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceDisputeRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a dispute. + */ + public GetCommerceDisputeRequest withDisputeId(String disputeId) { + Utils.checkNotNull(disputeId, "disputeId"); + this.disputeId = disputeId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceDisputeRequest other = (GetCommerceDisputeRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.disputeId, other.disputeId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + disputeId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceDisputeRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "disputeId", disputeId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String disputeId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a dispute. + */ + public Builder disputeId(String disputeId) { + Utils.checkNotNull(disputeId, "disputeId"); + this.disputeId = disputeId; + return this; + } + + public GetCommerceDisputeRequest build() { + return new GetCommerceDisputeRequest( + companyId, + connectionId, + disputeId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequestBuilder.java new file mode 100644 index 00000000..25a1663d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceDisputeRequestBuilder { + + private GetCommerceDisputeRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceDispute sdk; + + public GetCommerceDisputeRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceDispute sdk) { + this.sdk = sdk; + } + + public GetCommerceDisputeRequestBuilder request(GetCommerceDisputeRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceDisputeResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeResponse.java new file mode 100644 index 00000000..d021b059 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceDisputeResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceDisputeResponse { + + /** + * OK + */ + private JsonNullable commerceDispute; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceDisputeResponse( + JsonNullable commerceDispute, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceDispute, "commerceDispute"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceDispute = commerceDispute; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceDispute() { + return commerceDispute; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceDisputeResponse withCommerceDispute(io.codat.lending.models.shared.CommerceDispute commerceDispute) { + Utils.checkNotNull(commerceDispute, "commerceDispute"); + this.commerceDispute = JsonNullable.of(commerceDispute); + return this; + } + + /** + * OK + */ + public GetCommerceDisputeResponse withCommerceDispute(JsonNullable commerceDispute) { + Utils.checkNotNull(commerceDispute, "commerceDispute"); + this.commerceDispute = commerceDispute; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceDisputeResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceDisputeResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceDisputeResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceDisputeResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceDisputeResponse 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; + } + GetCommerceDisputeResponse other = (GetCommerceDisputeResponse) o; + return + java.util.Objects.deepEquals(this.commerceDispute, other.commerceDispute) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceDispute, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceDisputeResponse.class, + "commerceDispute", commerceDispute, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceDispute = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceDispute(io.codat.lending.models.shared.CommerceDispute commerceDispute) { + Utils.checkNotNull(commerceDispute, "commerceDispute"); + this.commerceDispute = JsonNullable.of(commerceDispute); + return this; + } + + /** + * OK + */ + public Builder commerceDispute(JsonNullable commerceDispute) { + Utils.checkNotNull(commerceDispute, "commerceDispute"); + this.commerceDispute = commerceDispute; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceDisputeResponse build() { + return new GetCommerceDisputeResponse( + commerceDispute, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequest.java new file mode 100644 index 00000000..292a35ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequest.java @@ -0,0 +1,353 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCommerceLifetimeValueMetricsRequest { + + /** + * 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; + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDisplayNames") + private Optional includeDisplayNames; + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private long numberOfPeriods; + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private long periodLength; + + /** + * The period unit of time returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodUnit") + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCommerceLifetimeValueMetricsRequest( + String companyId, + String connectionId, + Optional includeDisplayNames, + long numberOfPeriods, + long periodLength, + io.codat.lending.models.shared.PeriodUnit periodUnit, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodUnit, "periodUnit"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.connectionId = connectionId; + this.includeDisplayNames = includeDisplayNames; + this.numberOfPeriods = numberOfPeriods; + this.periodLength = periodLength; + this.periodUnit = periodUnit; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Optional includeDisplayNames() { + return includeDisplayNames; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public long numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public long periodLength() { + return periodLength; + } + + /** + * The period unit of time returned. + */ + public io.codat.lending.models.shared.PeriodUnit periodUnit() { + return periodUnit; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceLifetimeValueMetricsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceLifetimeValueMetricsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceLifetimeValueMetricsRequest withIncludeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceLifetimeValueMetricsRequest withIncludeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public GetCommerceLifetimeValueMetricsRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public GetCommerceLifetimeValueMetricsRequest withPeriodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public GetCommerceLifetimeValueMetricsRequest withPeriodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCommerceLifetimeValueMetricsRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceLifetimeValueMetricsRequest other = (GetCommerceLifetimeValueMetricsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.includeDisplayNames, other.includeDisplayNames) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodUnit, other.periodUnit) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceLifetimeValueMetricsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "includeDisplayNames", includeDisplayNames, + "numberOfPeriods", numberOfPeriods, + "periodLength", periodLength, + "periodUnit", periodUnit, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional includeDisplayNames = Optional.empty(); + + private Long numberOfPeriods; + + private Long periodLength; + + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + private String reportDate; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public Builder periodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public Builder periodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCommerceLifetimeValueMetricsRequest build() { + return new GetCommerceLifetimeValueMetricsRequest( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequestBuilder.java new file mode 100644 index 00000000..37e97516 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceLifetimeValueMetricsRequestBuilder { + + private GetCommerceLifetimeValueMetricsRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceLifetimeValueMetrics sdk; + + public GetCommerceLifetimeValueMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceLifetimeValueMetrics sdk) { + this.sdk = sdk; + } + + public GetCommerceLifetimeValueMetricsRequestBuilder request(GetCommerceLifetimeValueMetricsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceLifetimeValueMetricsResponse call() throws Exception { + return sdk.getLifetimeValue( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsResponse.java new file mode 100644 index 00000000..90b0d1de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLifetimeValueMetricsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceLifetimeValueMetricsResponse { + + /** + * OK + */ + private Optional commerceReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceLifetimeValueMetricsResponse( + Optional commerceReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceReport, "commerceReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceReport = commerceReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceReport() { + return commerceReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceLifetimeValueMetricsResponse withCommerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public GetCommerceLifetimeValueMetricsResponse withCommerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceLifetimeValueMetricsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceLifetimeValueMetricsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceLifetimeValueMetricsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceLifetimeValueMetricsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceLifetimeValueMetricsResponse 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; + } + GetCommerceLifetimeValueMetricsResponse other = (GetCommerceLifetimeValueMetricsResponse) o; + return + java.util.Objects.deepEquals(this.commerceReport, other.commerceReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceLifetimeValueMetricsResponse.class, + "commerceReport", commerceReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public Builder commerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceLifetimeValueMetricsResponse build() { + return new GetCommerceLifetimeValueMetricsResponse( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequest.java new file mode 100644 index 00000000..fde0bfba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceLocationRequest { + + /** + * 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; + + /** + * Unique identifier for a location. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=locationId") + private String locationId; + + public GetCommerceLocationRequest( + String companyId, + String connectionId, + String locationId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(locationId, "locationId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.locationId = locationId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a location. + */ + public String locationId() { + return locationId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceLocationRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceLocationRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a location. + */ + public GetCommerceLocationRequest withLocationId(String locationId) { + Utils.checkNotNull(locationId, "locationId"); + this.locationId = locationId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceLocationRequest other = (GetCommerceLocationRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.locationId, other.locationId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + locationId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceLocationRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "locationId", locationId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String locationId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a location. + */ + public Builder locationId(String locationId) { + Utils.checkNotNull(locationId, "locationId"); + this.locationId = locationId; + return this; + } + + public GetCommerceLocationRequest build() { + return new GetCommerceLocationRequest( + companyId, + connectionId, + locationId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequestBuilder.java new file mode 100644 index 00000000..885c9a2c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceLocationRequestBuilder { + + private GetCommerceLocationRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceLocation sdk; + + public GetCommerceLocationRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceLocation sdk) { + this.sdk = sdk; + } + + public GetCommerceLocationRequestBuilder request(GetCommerceLocationRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceLocationResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationResponse.java new file mode 100644 index 00000000..aa4af55a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceLocationResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceLocationResponse { + + /** + * OK + */ + private JsonNullable commerceLocation; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceLocationResponse( + JsonNullable commerceLocation, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceLocation, "commerceLocation"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceLocation = commerceLocation; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceLocation() { + return commerceLocation; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceLocationResponse withCommerceLocation(io.codat.lending.models.shared.CommerceLocation commerceLocation) { + Utils.checkNotNull(commerceLocation, "commerceLocation"); + this.commerceLocation = JsonNullable.of(commerceLocation); + return this; + } + + /** + * OK + */ + public GetCommerceLocationResponse withCommerceLocation(JsonNullable commerceLocation) { + Utils.checkNotNull(commerceLocation, "commerceLocation"); + this.commerceLocation = commerceLocation; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceLocationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceLocationResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceLocationResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceLocationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceLocationResponse 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; + } + GetCommerceLocationResponse other = (GetCommerceLocationResponse) o; + return + java.util.Objects.deepEquals(this.commerceLocation, other.commerceLocation) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceLocation, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceLocationResponse.class, + "commerceLocation", commerceLocation, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceLocation = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceLocation(io.codat.lending.models.shared.CommerceLocation commerceLocation) { + Utils.checkNotNull(commerceLocation, "commerceLocation"); + this.commerceLocation = JsonNullable.of(commerceLocation); + return this; + } + + /** + * OK + */ + public Builder commerceLocation(JsonNullable commerceLocation) { + Utils.checkNotNull(commerceLocation, "commerceLocation"); + this.commerceLocation = commerceLocation; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceLocationResponse build() { + return new GetCommerceLocationResponse( + commerceLocation, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequest.java new file mode 100644 index 00000000..48c6822e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceOrderRequest { + + /** + * 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; + + /** + * Unique identifier for an order. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=orderId") + private String orderId; + + public GetCommerceOrderRequest( + String companyId, + String connectionId, + String orderId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderId, "orderId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderId = orderId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for an order. + */ + public String orderId() { + return orderId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceOrderRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceOrderRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an order. + */ + public GetCommerceOrderRequest withOrderId(String orderId) { + Utils.checkNotNull(orderId, "orderId"); + this.orderId = orderId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceOrderRequest other = (GetCommerceOrderRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderId, other.orderId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceOrderRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderId", orderId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String orderId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an order. + */ + public Builder orderId(String orderId) { + Utils.checkNotNull(orderId, "orderId"); + this.orderId = orderId; + return this; + } + + public GetCommerceOrderRequest build() { + return new GetCommerceOrderRequest( + companyId, + connectionId, + orderId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequestBuilder.java new file mode 100644 index 00000000..7d2715ca --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceOrderRequestBuilder { + + private GetCommerceOrderRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceOrder sdk; + + public GetCommerceOrderRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceOrder sdk) { + this.sdk = sdk; + } + + public GetCommerceOrderRequestBuilder request(GetCommerceOrderRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceOrderResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderResponse.java new file mode 100644 index 00000000..26679ba5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrderResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceOrderResponse { + + /** + * OK + */ + private JsonNullable commerceOrder; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceOrderResponse( + JsonNullable commerceOrder, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceOrder, "commerceOrder"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceOrder = commerceOrder; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceOrder() { + return commerceOrder; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceOrderResponse withCommerceOrder(io.codat.lending.models.shared.CommerceOrder commerceOrder) { + Utils.checkNotNull(commerceOrder, "commerceOrder"); + this.commerceOrder = JsonNullable.of(commerceOrder); + return this; + } + + /** + * OK + */ + public GetCommerceOrderResponse withCommerceOrder(JsonNullable commerceOrder) { + Utils.checkNotNull(commerceOrder, "commerceOrder"); + this.commerceOrder = commerceOrder; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceOrderResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceOrderResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceOrderResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceOrderResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceOrderResponse 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; + } + GetCommerceOrderResponse other = (GetCommerceOrderResponse) o; + return + java.util.Objects.deepEquals(this.commerceOrder, other.commerceOrder) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceOrder, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceOrderResponse.class, + "commerceOrder", commerceOrder, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceOrder = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceOrder(io.codat.lending.models.shared.CommerceOrder commerceOrder) { + Utils.checkNotNull(commerceOrder, "commerceOrder"); + this.commerceOrder = JsonNullable.of(commerceOrder); + return this; + } + + /** + * OK + */ + public Builder commerceOrder(JsonNullable commerceOrder) { + Utils.checkNotNull(commerceOrder, "commerceOrder"); + this.commerceOrder = commerceOrder; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceOrderResponse build() { + return new GetCommerceOrderResponse( + commerceOrder, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequest.java new file mode 100644 index 00000000..495cb474 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequest.java @@ -0,0 +1,353 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCommerceOrdersReportRequest { + + /** + * 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; + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDisplayNames") + private Optional includeDisplayNames; + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private long numberOfPeriods; + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private long periodLength; + + /** + * The period unit of time returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodUnit") + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCommerceOrdersReportRequest( + String companyId, + String connectionId, + Optional includeDisplayNames, + long numberOfPeriods, + long periodLength, + io.codat.lending.models.shared.PeriodUnit periodUnit, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodUnit, "periodUnit"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.connectionId = connectionId; + this.includeDisplayNames = includeDisplayNames; + this.numberOfPeriods = numberOfPeriods; + this.periodLength = periodLength; + this.periodUnit = periodUnit; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Optional includeDisplayNames() { + return includeDisplayNames; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public long numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public long periodLength() { + return periodLength; + } + + /** + * The period unit of time returned. + */ + public io.codat.lending.models.shared.PeriodUnit periodUnit() { + return periodUnit; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceOrdersReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceOrdersReportRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceOrdersReportRequest withIncludeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceOrdersReportRequest withIncludeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public GetCommerceOrdersReportRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public GetCommerceOrdersReportRequest withPeriodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public GetCommerceOrdersReportRequest withPeriodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCommerceOrdersReportRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceOrdersReportRequest other = (GetCommerceOrdersReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.includeDisplayNames, other.includeDisplayNames) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodUnit, other.periodUnit) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceOrdersReportRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "includeDisplayNames", includeDisplayNames, + "numberOfPeriods", numberOfPeriods, + "periodLength", periodLength, + "periodUnit", periodUnit, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional includeDisplayNames = Optional.empty(); + + private Long numberOfPeriods; + + private Long periodLength; + + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + private String reportDate; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public Builder periodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public Builder periodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCommerceOrdersReportRequest build() { + return new GetCommerceOrdersReportRequest( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequestBuilder.java new file mode 100644 index 00000000..28a5803a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceOrdersReportRequestBuilder { + + private GetCommerceOrdersReportRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceOrdersReport sdk; + + public GetCommerceOrdersReportRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceOrdersReport sdk) { + this.sdk = sdk; + } + + public GetCommerceOrdersReportRequestBuilder request(GetCommerceOrdersReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceOrdersReportResponse call() throws Exception { + return sdk.getOrders( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportResponse.java new file mode 100644 index 00000000..d94f4abe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceOrdersReportResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceOrdersReportResponse { + + /** + * OK + */ + private Optional commerceReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceOrdersReportResponse( + Optional commerceReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceReport, "commerceReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceReport = commerceReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceReport() { + return commerceReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceOrdersReportResponse withCommerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public GetCommerceOrdersReportResponse withCommerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceOrdersReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceOrdersReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceOrdersReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceOrdersReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceOrdersReportResponse 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; + } + GetCommerceOrdersReportResponse other = (GetCommerceOrdersReportResponse) o; + return + java.util.Objects.deepEquals(this.commerceReport, other.commerceReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceOrdersReportResponse.class, + "commerceReport", commerceReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public Builder commerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceOrdersReportResponse build() { + return new GetCommerceOrdersReportResponse( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequest.java new file mode 100644 index 00000000..e8977327 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommercePaymentMethodRequest { + + /** + * 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; + + /** + * Unique identifier for a payment method. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=paymentMethodId") + private String paymentMethodId; + + public GetCommercePaymentMethodRequest( + String companyId, + String connectionId, + String paymentMethodId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.paymentMethodId = paymentMethodId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a payment method. + */ + public String paymentMethodId() { + return paymentMethodId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommercePaymentMethodRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommercePaymentMethodRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a payment method. + */ + public GetCommercePaymentMethodRequest withPaymentMethodId(String paymentMethodId) { + Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + this.paymentMethodId = paymentMethodId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommercePaymentMethodRequest other = (GetCommercePaymentMethodRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.paymentMethodId, other.paymentMethodId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + paymentMethodId); + } + + @Override + public String toString() { + return Utils.toString(GetCommercePaymentMethodRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "paymentMethodId", paymentMethodId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String paymentMethodId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a payment method. + */ + public Builder paymentMethodId(String paymentMethodId) { + Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + this.paymentMethodId = paymentMethodId; + return this; + } + + public GetCommercePaymentMethodRequest build() { + return new GetCommercePaymentMethodRequest( + companyId, + connectionId, + paymentMethodId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequestBuilder.java new file mode 100644 index 00000000..8b847cfd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommercePaymentMethodRequestBuilder { + + private GetCommercePaymentMethodRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommercePaymentMethod sdk; + + public GetCommercePaymentMethodRequestBuilder(SDKMethodInterfaces.MethodCallGetCommercePaymentMethod sdk) { + this.sdk = sdk; + } + + public GetCommercePaymentMethodRequestBuilder request(GetCommercePaymentMethodRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommercePaymentMethodResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodResponse.java new file mode 100644 index 00000000..06b50e14 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentMethodResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommercePaymentMethodResponse { + + /** + * OK + */ + private JsonNullable commercePaymentMethod; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommercePaymentMethodResponse( + JsonNullable commercePaymentMethod, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commercePaymentMethod, "commercePaymentMethod"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commercePaymentMethod = commercePaymentMethod; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commercePaymentMethod() { + return commercePaymentMethod; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommercePaymentMethodResponse withCommercePaymentMethod(io.codat.lending.models.shared.CommercePaymentMethod commercePaymentMethod) { + Utils.checkNotNull(commercePaymentMethod, "commercePaymentMethod"); + this.commercePaymentMethod = JsonNullable.of(commercePaymentMethod); + return this; + } + + /** + * OK + */ + public GetCommercePaymentMethodResponse withCommercePaymentMethod(JsonNullable commercePaymentMethod) { + Utils.checkNotNull(commercePaymentMethod, "commercePaymentMethod"); + this.commercePaymentMethod = commercePaymentMethod; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommercePaymentMethodResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommercePaymentMethodResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommercePaymentMethodResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommercePaymentMethodResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommercePaymentMethodResponse 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; + } + GetCommercePaymentMethodResponse other = (GetCommercePaymentMethodResponse) o; + return + java.util.Objects.deepEquals(this.commercePaymentMethod, other.commercePaymentMethod) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commercePaymentMethod, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommercePaymentMethodResponse.class, + "commercePaymentMethod", commercePaymentMethod, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commercePaymentMethod = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commercePaymentMethod(io.codat.lending.models.shared.CommercePaymentMethod commercePaymentMethod) { + Utils.checkNotNull(commercePaymentMethod, "commercePaymentMethod"); + this.commercePaymentMethod = JsonNullable.of(commercePaymentMethod); + return this; + } + + /** + * OK + */ + public Builder commercePaymentMethod(JsonNullable commercePaymentMethod) { + Utils.checkNotNull(commercePaymentMethod, "commercePaymentMethod"); + this.commercePaymentMethod = commercePaymentMethod; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommercePaymentMethodResponse build() { + return new GetCommercePaymentMethodResponse( + commercePaymentMethod, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequest.java new file mode 100644 index 00000000..09463a7b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommercePaymentRequest { + + /** + * 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; + + /** + * Unique identifier for a payment. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=paymentId") + private String paymentId; + + public GetCommercePaymentRequest( + String companyId, + String connectionId, + String paymentId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(paymentId, "paymentId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.paymentId = paymentId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a payment. + */ + public String paymentId() { + return paymentId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommercePaymentRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommercePaymentRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a payment. + */ + public GetCommercePaymentRequest withPaymentId(String paymentId) { + Utils.checkNotNull(paymentId, "paymentId"); + this.paymentId = paymentId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommercePaymentRequest other = (GetCommercePaymentRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.paymentId, other.paymentId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + paymentId); + } + + @Override + public String toString() { + return Utils.toString(GetCommercePaymentRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "paymentId", paymentId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String paymentId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a payment. + */ + public Builder paymentId(String paymentId) { + Utils.checkNotNull(paymentId, "paymentId"); + this.paymentId = paymentId; + return this; + } + + public GetCommercePaymentRequest build() { + return new GetCommercePaymentRequest( + companyId, + connectionId, + paymentId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequestBuilder.java new file mode 100644 index 00000000..7218edae --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommercePaymentRequestBuilder { + + private GetCommercePaymentRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommercePayment sdk; + + public GetCommercePaymentRequestBuilder(SDKMethodInterfaces.MethodCallGetCommercePayment sdk) { + this.sdk = sdk; + } + + public GetCommercePaymentRequestBuilder request(GetCommercePaymentRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommercePaymentResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentResponse.java new file mode 100644 index 00000000..12595c79 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommercePaymentResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommercePaymentResponse { + + /** + * OK + */ + private JsonNullable commercePayment; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommercePaymentResponse( + JsonNullable commercePayment, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commercePayment, "commercePayment"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commercePayment = commercePayment; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commercePayment() { + return commercePayment; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommercePaymentResponse withCommercePayment(io.codat.lending.models.shared.CommercePayment commercePayment) { + Utils.checkNotNull(commercePayment, "commercePayment"); + this.commercePayment = JsonNullable.of(commercePayment); + return this; + } + + /** + * OK + */ + public GetCommercePaymentResponse withCommercePayment(JsonNullable commercePayment) { + Utils.checkNotNull(commercePayment, "commercePayment"); + this.commercePayment = commercePayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommercePaymentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommercePaymentResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommercePaymentResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommercePaymentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommercePaymentResponse 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; + } + GetCommercePaymentResponse other = (GetCommercePaymentResponse) o; + return + java.util.Objects.deepEquals(this.commercePayment, other.commercePayment) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commercePayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommercePaymentResponse.class, + "commercePayment", commercePayment, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commercePayment = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commercePayment(io.codat.lending.models.shared.CommercePayment commercePayment) { + Utils.checkNotNull(commercePayment, "commercePayment"); + this.commercePayment = JsonNullable.of(commercePayment); + return this; + } + + /** + * OK + */ + public Builder commercePayment(JsonNullable commercePayment) { + Utils.checkNotNull(commercePayment, "commercePayment"); + this.commercePayment = commercePayment; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommercePaymentResponse build() { + return new GetCommercePaymentResponse( + commercePayment, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequest.java new file mode 100644 index 00000000..74b82949 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceProductCategoryRequest { + + /** + * 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; + + /** + * Unique identifier for a product. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=productId") + private String productId; + + public GetCommerceProductCategoryRequest( + String companyId, + String connectionId, + String productId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(productId, "productId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.productId = productId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a product. + */ + public String productId() { + return productId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceProductCategoryRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceProductCategoryRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a product. + */ + public GetCommerceProductCategoryRequest withProductId(String productId) { + Utils.checkNotNull(productId, "productId"); + this.productId = productId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceProductCategoryRequest other = (GetCommerceProductCategoryRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.productId, other.productId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + productId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProductCategoryRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "productId", productId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String productId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a product. + */ + public Builder productId(String productId) { + Utils.checkNotNull(productId, "productId"); + this.productId = productId; + return this; + } + + public GetCommerceProductCategoryRequest build() { + return new GetCommerceProductCategoryRequest( + companyId, + connectionId, + productId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequestBuilder.java new file mode 100644 index 00000000..684ae88e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceProductCategoryRequestBuilder { + + private GetCommerceProductCategoryRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceProductCategory sdk; + + public GetCommerceProductCategoryRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceProductCategory sdk) { + this.sdk = sdk; + } + + public GetCommerceProductCategoryRequestBuilder request(GetCommerceProductCategoryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceProductCategoryResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryResponse.java new file mode 100644 index 00000000..152443bc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductCategoryResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceProductCategoryResponse { + + /** + * OK + */ + private JsonNullable commerceProductCategory; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceProductCategoryResponse( + JsonNullable commerceProductCategory, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceProductCategory, "commerceProductCategory"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceProductCategory = commerceProductCategory; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceProductCategory() { + return commerceProductCategory; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceProductCategoryResponse withCommerceProductCategory(io.codat.lending.models.shared.CommerceProductCategory commerceProductCategory) { + Utils.checkNotNull(commerceProductCategory, "commerceProductCategory"); + this.commerceProductCategory = JsonNullable.of(commerceProductCategory); + return this; + } + + /** + * OK + */ + public GetCommerceProductCategoryResponse withCommerceProductCategory(JsonNullable commerceProductCategory) { + Utils.checkNotNull(commerceProductCategory, "commerceProductCategory"); + this.commerceProductCategory = commerceProductCategory; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceProductCategoryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProductCategoryResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProductCategoryResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceProductCategoryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceProductCategoryResponse 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; + } + GetCommerceProductCategoryResponse other = (GetCommerceProductCategoryResponse) o; + return + java.util.Objects.deepEquals(this.commerceProductCategory, other.commerceProductCategory) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceProductCategory, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProductCategoryResponse.class, + "commerceProductCategory", commerceProductCategory, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceProductCategory = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceProductCategory(io.codat.lending.models.shared.CommerceProductCategory commerceProductCategory) { + Utils.checkNotNull(commerceProductCategory, "commerceProductCategory"); + this.commerceProductCategory = JsonNullable.of(commerceProductCategory); + return this; + } + + /** + * OK + */ + public Builder commerceProductCategory(JsonNullable commerceProductCategory) { + Utils.checkNotNull(commerceProductCategory, "commerceProductCategory"); + this.commerceProductCategory = commerceProductCategory; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceProductCategoryResponse build() { + return new GetCommerceProductCategoryResponse( + commerceProductCategory, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequest.java new file mode 100644 index 00000000..64ac89b1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceProductRequest { + + /** + * 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; + + /** + * Unique identifier for a product. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=productId") + private String productId; + + public GetCommerceProductRequest( + String companyId, + String connectionId, + String productId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(productId, "productId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.productId = productId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a product. + */ + public String productId() { + return productId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceProductRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceProductRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a product. + */ + public GetCommerceProductRequest withProductId(String productId) { + Utils.checkNotNull(productId, "productId"); + this.productId = productId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceProductRequest other = (GetCommerceProductRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.productId, other.productId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + productId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProductRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "productId", productId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String productId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a product. + */ + public Builder productId(String productId) { + Utils.checkNotNull(productId, "productId"); + this.productId = productId; + return this; + } + + public GetCommerceProductRequest build() { + return new GetCommerceProductRequest( + companyId, + connectionId, + productId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequestBuilder.java new file mode 100644 index 00000000..243997ff --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceProductRequestBuilder { + + private GetCommerceProductRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceProduct sdk; + + public GetCommerceProductRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceProduct sdk) { + this.sdk = sdk; + } + + public GetCommerceProductRequestBuilder request(GetCommerceProductRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceProductResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductResponse.java new file mode 100644 index 00000000..5989fb88 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProductResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceProductResponse { + + /** + * OK + */ + private Optional commerceProduct; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceProductResponse( + Optional commerceProduct, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceProduct, "commerceProduct"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceProduct = commerceProduct; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceProduct() { + return commerceProduct; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceProductResponse withCommerceProduct(io.codat.lending.models.shared.CommerceProduct commerceProduct) { + Utils.checkNotNull(commerceProduct, "commerceProduct"); + this.commerceProduct = Optional.ofNullable(commerceProduct); + return this; + } + + /** + * OK + */ + public GetCommerceProductResponse withCommerceProduct(Optional commerceProduct) { + Utils.checkNotNull(commerceProduct, "commerceProduct"); + this.commerceProduct = commerceProduct; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceProductResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProductResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProductResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceProductResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceProductResponse 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; + } + GetCommerceProductResponse other = (GetCommerceProductResponse) o; + return + java.util.Objects.deepEquals(this.commerceProduct, other.commerceProduct) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceProduct, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProductResponse.class, + "commerceProduct", commerceProduct, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceProduct = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceProduct(io.codat.lending.models.shared.CommerceProduct commerceProduct) { + Utils.checkNotNull(commerceProduct, "commerceProduct"); + this.commerceProduct = Optional.ofNullable(commerceProduct); + return this; + } + + /** + * OK + */ + public Builder commerceProduct(Optional commerceProduct) { + Utils.checkNotNull(commerceProduct, "commerceProduct"); + this.commerceProduct = commerceProduct; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceProductResponse build() { + return new GetCommerceProductResponse( + commerceProduct, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequest.java new file mode 100644 index 00000000..692c649b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceProfileRequest { + + /** + * 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; + + public GetCommerceProfileRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceProfileRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceProfileRequest 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; + } + GetCommerceProfileRequest other = (GetCommerceProfileRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProfileRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCommerceProfileRequest build() { + return new GetCommerceProfileRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequestBuilder.java new file mode 100644 index 00000000..3ca4b93f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceProfileRequestBuilder { + + private GetCommerceProfileRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceProfile sdk; + + public GetCommerceProfileRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceProfile sdk) { + this.sdk = sdk; + } + + public GetCommerceProfileRequestBuilder request(GetCommerceProfileRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceProfileResponse call() throws Exception { + return sdk.getCommerceProfile( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileResponse.java new file mode 100644 index 00000000..45c13f18 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceProfileResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceProfileResponse { + + /** + * OK + */ + private JsonNullable commerceCompanyInfo; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceProfileResponse( + JsonNullable commerceCompanyInfo, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceCompanyInfo, "commerceCompanyInfo"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceCompanyInfo = commerceCompanyInfo; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceCompanyInfo() { + return commerceCompanyInfo; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceProfileResponse withCommerceCompanyInfo(io.codat.lending.models.shared.CommerceCompanyInfo commerceCompanyInfo) { + Utils.checkNotNull(commerceCompanyInfo, "commerceCompanyInfo"); + this.commerceCompanyInfo = JsonNullable.of(commerceCompanyInfo); + return this; + } + + /** + * OK + */ + public GetCommerceProfileResponse withCommerceCompanyInfo(JsonNullable commerceCompanyInfo) { + Utils.checkNotNull(commerceCompanyInfo, "commerceCompanyInfo"); + this.commerceCompanyInfo = commerceCompanyInfo; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceProfileResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProfileResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceProfileResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceProfileResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceProfileResponse 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; + } + GetCommerceProfileResponse other = (GetCommerceProfileResponse) o; + return + java.util.Objects.deepEquals(this.commerceCompanyInfo, other.commerceCompanyInfo) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceCompanyInfo, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceProfileResponse.class, + "commerceCompanyInfo", commerceCompanyInfo, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceCompanyInfo = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceCompanyInfo(io.codat.lending.models.shared.CommerceCompanyInfo commerceCompanyInfo) { + Utils.checkNotNull(commerceCompanyInfo, "commerceCompanyInfo"); + this.commerceCompanyInfo = JsonNullable.of(commerceCompanyInfo); + return this; + } + + /** + * OK + */ + public Builder commerceCompanyInfo(JsonNullable commerceCompanyInfo) { + Utils.checkNotNull(commerceCompanyInfo, "commerceCompanyInfo"); + this.commerceCompanyInfo = commerceCompanyInfo; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceProfileResponse build() { + return new GetCommerceProfileResponse( + commerceCompanyInfo, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequest.java new file mode 100644 index 00000000..38444659 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequest.java @@ -0,0 +1,353 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCommerceRefundsReportRequest { + + /** + * 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; + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDisplayNames") + private Optional includeDisplayNames; + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private long numberOfPeriods; + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private long periodLength; + + /** + * The period unit of time returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodUnit") + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCommerceRefundsReportRequest( + String companyId, + String connectionId, + Optional includeDisplayNames, + long numberOfPeriods, + long periodLength, + io.codat.lending.models.shared.PeriodUnit periodUnit, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodUnit, "periodUnit"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.connectionId = connectionId; + this.includeDisplayNames = includeDisplayNames; + this.numberOfPeriods = numberOfPeriods; + this.periodLength = periodLength; + this.periodUnit = periodUnit; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Optional includeDisplayNames() { + return includeDisplayNames; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public long numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public long periodLength() { + return periodLength; + } + + /** + * The period unit of time returned. + */ + public io.codat.lending.models.shared.PeriodUnit periodUnit() { + return periodUnit; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceRefundsReportRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceRefundsReportRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceRefundsReportRequest withIncludeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceRefundsReportRequest withIncludeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public GetCommerceRefundsReportRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public GetCommerceRefundsReportRequest withPeriodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public GetCommerceRefundsReportRequest withPeriodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCommerceRefundsReportRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceRefundsReportRequest other = (GetCommerceRefundsReportRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.includeDisplayNames, other.includeDisplayNames) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodUnit, other.periodUnit) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceRefundsReportRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "includeDisplayNames", includeDisplayNames, + "numberOfPeriods", numberOfPeriods, + "periodLength", periodLength, + "periodUnit", periodUnit, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional includeDisplayNames = Optional.empty(); + + private Long numberOfPeriods; + + private Long periodLength; + + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + private String reportDate; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public Builder periodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public Builder periodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCommerceRefundsReportRequest build() { + return new GetCommerceRefundsReportRequest( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequestBuilder.java new file mode 100644 index 00000000..ead7527e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceRefundsReportRequestBuilder { + + private GetCommerceRefundsReportRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceRefundsReport sdk; + + public GetCommerceRefundsReportRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceRefundsReport sdk) { + this.sdk = sdk; + } + + public GetCommerceRefundsReportRequestBuilder request(GetCommerceRefundsReportRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceRefundsReportResponse call() throws Exception { + return sdk.getRefunds( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportResponse.java new file mode 100644 index 00000000..6a41a89c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRefundsReportResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceRefundsReportResponse { + + /** + * OK + */ + private Optional commerceReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceRefundsReportResponse( + Optional commerceReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceReport, "commerceReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceReport = commerceReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceReport() { + return commerceReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceRefundsReportResponse withCommerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public GetCommerceRefundsReportResponse withCommerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceRefundsReportResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceRefundsReportResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceRefundsReportResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceRefundsReportResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceRefundsReportResponse 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; + } + GetCommerceRefundsReportResponse other = (GetCommerceRefundsReportResponse) o; + return + java.util.Objects.deepEquals(this.commerceReport, other.commerceReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceRefundsReportResponse.class, + "commerceReport", commerceReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public Builder commerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceRefundsReportResponse build() { + return new GetCommerceRefundsReportResponse( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequest.java new file mode 100644 index 00000000..fef23f52 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequest.java @@ -0,0 +1,353 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetCommerceRevenueMetricsRequest { + + /** + * 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; + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDisplayNames") + private Optional includeDisplayNames; + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=numberOfPeriods") + private long numberOfPeriods; + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodLength") + private long periodLength; + + /** + * The period unit of time returned. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=periodUnit") + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportDate") + private String reportDate; + + public GetCommerceRevenueMetricsRequest( + String companyId, + String connectionId, + Optional includeDisplayNames, + long numberOfPeriods, + long periodLength, + io.codat.lending.models.shared.PeriodUnit periodUnit, + String reportDate) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + Utils.checkNotNull(periodLength, "periodLength"); + Utils.checkNotNull(periodUnit, "periodUnit"); + Utils.checkNotNull(reportDate, "reportDate"); + this.companyId = companyId; + this.connectionId = connectionId; + this.includeDisplayNames = includeDisplayNames; + this.numberOfPeriods = numberOfPeriods; + this.periodLength = periodLength; + this.periodUnit = periodUnit; + this.reportDate = reportDate; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Optional includeDisplayNames() { + return includeDisplayNames; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public long numberOfPeriods() { + return numberOfPeriods; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public long periodLength() { + return periodLength; + } + + /** + * The period unit of time returned. + */ + public io.codat.lending.models.shared.PeriodUnit periodUnit() { + return periodUnit; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public String reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceRevenueMetricsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceRevenueMetricsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceRevenueMetricsRequest withIncludeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public GetCommerceRevenueMetricsRequest withIncludeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public GetCommerceRevenueMetricsRequest withNumberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public GetCommerceRevenueMetricsRequest withPeriodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public GetCommerceRevenueMetricsRequest withPeriodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public GetCommerceRevenueMetricsRequest withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceRevenueMetricsRequest other = (GetCommerceRevenueMetricsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.includeDisplayNames, other.includeDisplayNames) && + java.util.Objects.deepEquals(this.numberOfPeriods, other.numberOfPeriods) && + java.util.Objects.deepEquals(this.periodLength, other.periodLength) && + java.util.Objects.deepEquals(this.periodUnit, other.periodUnit) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceRevenueMetricsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "includeDisplayNames", includeDisplayNames, + "numberOfPeriods", numberOfPeriods, + "periodLength", periodLength, + "periodUnit", periodUnit, + "reportDate", reportDate); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional includeDisplayNames = Optional.empty(); + + private Long numberOfPeriods; + + private Long periodLength; + + private io.codat.lending.models.shared.PeriodUnit periodUnit; + + private String reportDate; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(boolean includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = Optional.ofNullable(includeDisplayNames); + return this; + } + + /** + * Shows the dimensionDisplayName and itemDisplayName in measures to make the report data human-readable. + */ + public Builder includeDisplayNames(Optional includeDisplayNames) { + Utils.checkNotNull(includeDisplayNames, "includeDisplayNames"); + this.includeDisplayNames = includeDisplayNames; + return this; + } + + /** + * The number of periods to return. There will be no pagination as a query parameter. + */ + public Builder numberOfPeriods(long numberOfPeriods) { + Utils.checkNotNull(numberOfPeriods, "numberOfPeriods"); + this.numberOfPeriods = numberOfPeriods; + return this; + } + + /** + * The number of months per period. E.g. 2 = 2 months per period. + */ + public Builder periodLength(long periodLength) { + Utils.checkNotNull(periodLength, "periodLength"); + this.periodLength = periodLength; + return this; + } + + /** + * The period unit of time returned. + */ + public Builder periodUnit(io.codat.lending.models.shared.PeriodUnit periodUnit) { + Utils.checkNotNull(periodUnit, "periodUnit"); + this.periodUnit = periodUnit; + return this; + } + + /** + * The date in which the report is created up to. Users must specify a specific date, however the response will be provided for the full month. + */ + public Builder reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public GetCommerceRevenueMetricsRequest build() { + return new GetCommerceRevenueMetricsRequest( + companyId, + connectionId, + includeDisplayNames, + numberOfPeriods, + periodLength, + periodUnit, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequestBuilder.java new file mode 100644 index 00000000..a1d70656 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceRevenueMetricsRequestBuilder { + + private GetCommerceRevenueMetricsRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceRevenueMetrics sdk; + + public GetCommerceRevenueMetricsRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceRevenueMetrics sdk) { + this.sdk = sdk; + } + + public GetCommerceRevenueMetricsRequestBuilder request(GetCommerceRevenueMetricsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceRevenueMetricsResponse call() throws Exception { + return sdk.getRevenue( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsResponse.java new file mode 100644 index 00000000..f9022a65 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceRevenueMetricsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCommerceRevenueMetricsResponse { + + /** + * OK + */ + private Optional commerceReport; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceRevenueMetricsResponse( + Optional commerceReport, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceReport, "commerceReport"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceReport = commerceReport; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceReport() { + return commerceReport; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceRevenueMetricsResponse withCommerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public GetCommerceRevenueMetricsResponse withCommerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceRevenueMetricsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceRevenueMetricsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public GetCommerceRevenueMetricsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceRevenueMetricsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceRevenueMetricsResponse 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; + } + GetCommerceRevenueMetricsResponse other = (GetCommerceRevenueMetricsResponse) o; + return + java.util.Objects.deepEquals(this.commerceReport, other.commerceReport) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceRevenueMetricsResponse.class, + "commerceReport", commerceReport, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceReport = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceReport(io.codat.lending.models.shared.CommerceReport commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = Optional.ofNullable(commerceReport); + return this; + } + + /** + * OK + */ + public Builder commerceReport(Optional commerceReport) { + Utils.checkNotNull(commerceReport, "commerceReport"); + this.commerceReport = commerceReport; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceRevenueMetricsResponse build() { + return new GetCommerceRevenueMetricsResponse( + commerceReport, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequest.java new file mode 100644 index 00000000..16903aae --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCommerceTransactionRequest { + + /** + * 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; + + /** + * Unique identifier for a transaction. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=transactionId") + private String transactionId; + + public GetCommerceTransactionRequest( + String companyId, + String connectionId, + String transactionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(transactionId, "transactionId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.transactionId = transactionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a transaction. + */ + public String transactionId() { + return transactionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCommerceTransactionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCommerceTransactionRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a transaction. + */ + public GetCommerceTransactionRequest withTransactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCommerceTransactionRequest other = (GetCommerceTransactionRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.transactionId, other.transactionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + transactionId); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceTransactionRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "transactionId", transactionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String transactionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a transaction. + */ + public Builder transactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + public GetCommerceTransactionRequest build() { + return new GetCommerceTransactionRequest( + companyId, + connectionId, + transactionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequestBuilder.java new file mode 100644 index 00000000..00d215fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCommerceTransactionRequestBuilder { + + private GetCommerceTransactionRequest request; + + private final SDKMethodInterfaces.MethodCallGetCommerceTransaction sdk; + + public GetCommerceTransactionRequestBuilder(SDKMethodInterfaces.MethodCallGetCommerceTransaction sdk) { + this.sdk = sdk; + } + + public GetCommerceTransactionRequestBuilder request(GetCommerceTransactionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCommerceTransactionResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionResponse.java new file mode 100644 index 00000000..0d47b3fa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCommerceTransactionResponse.java @@ -0,0 +1,287 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class GetCommerceTransactionResponse { + + /** + * OK + */ + private JsonNullable commerceTransaction; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCommerceTransactionResponse( + JsonNullable commerceTransaction, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceTransaction, "commerceTransaction"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceTransaction = commerceTransaction; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public JsonNullable commerceTransaction() { + return commerceTransaction; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCommerceTransactionResponse withCommerceTransaction(io.codat.lending.models.shared.CommerceTransaction commerceTransaction) { + Utils.checkNotNull(commerceTransaction, "commerceTransaction"); + this.commerceTransaction = JsonNullable.of(commerceTransaction); + return this; + } + + /** + * OK + */ + public GetCommerceTransactionResponse withCommerceTransaction(JsonNullable commerceTransaction) { + Utils.checkNotNull(commerceTransaction, "commerceTransaction"); + this.commerceTransaction = commerceTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCommerceTransactionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceTransactionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCommerceTransactionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCommerceTransactionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCommerceTransactionResponse 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; + } + GetCommerceTransactionResponse other = (GetCommerceTransactionResponse) o; + return + java.util.Objects.deepEquals(this.commerceTransaction, other.commerceTransaction) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCommerceTransactionResponse.class, + "commerceTransaction", commerceTransaction, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private JsonNullable commerceTransaction = JsonNullable.undefined(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceTransaction(io.codat.lending.models.shared.CommerceTransaction commerceTransaction) { + Utils.checkNotNull(commerceTransaction, "commerceTransaction"); + this.commerceTransaction = JsonNullable.of(commerceTransaction); + return this; + } + + /** + * OK + */ + public Builder commerceTransaction(JsonNullable commerceTransaction) { + Utils.checkNotNull(commerceTransaction, "commerceTransaction"); + this.commerceTransaction = commerceTransaction; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCommerceTransactionResponse build() { + return new GetCommerceTransactionResponse( + commerceTransaction, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequest.java new file mode 100644 index 00000000..8cec7611 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCompanyRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetCompanyRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCompanyRequest 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; + } + GetCompanyRequest other = (GetCompanyRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetCompanyRequest.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 GetCompanyRequest build() { + return new GetCompanyRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequestBuilder.java new file mode 100644 index 00000000..0cb2444e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCompanyRequestBuilder { + + private GetCompanyRequest request; + + private final SDKMethodInterfaces.MethodCallGetCompany sdk; + + public GetCompanyRequestBuilder(SDKMethodInterfaces.MethodCallGetCompany sdk) { + this.sdk = sdk; + } + + public GetCompanyRequestBuilder request(GetCompanyRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCompanyResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyResponse.java new file mode 100644 index 00000000..eeb242b0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCompanyResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCompanyResponse { + + /** + * OK + */ + private Optional company; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCompanyResponse( + Optional company, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(company, "company"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.company = company; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional company() { + return company; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetCompanyResponse withCompany(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public GetCompanyResponse withCompany(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetCompanyResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCompanyResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCompanyResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCompanyResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanyResponse 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; + } + GetCompanyResponse other = (GetCompanyResponse) o; + return + java.util.Objects.deepEquals(this.company, other.company) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCompanyResponse.class, + "company", company, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional company = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder company(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public Builder company(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetCompanyResponse build() { + return new GetCompanyResponse( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequest.java new file mode 100644 index 00000000..c3fe4e8d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetConnectionRequest { + + /** + * 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; + + public GetConnectionRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetConnectionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetConnectionRequest 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; + } + GetConnectionRequest other = (GetConnectionRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetConnectionRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetConnectionRequest build() { + return new GetConnectionRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequestBuilder.java new file mode 100644 index 00000000..7bd4ba49 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetConnectionRequestBuilder { + + private GetConnectionRequest request; + + private final SDKMethodInterfaces.MethodCallGetConnection sdk; + + public GetConnectionRequestBuilder(SDKMethodInterfaces.MethodCallGetConnection sdk) { + this.sdk = sdk; + } + + public GetConnectionRequestBuilder request(GetConnectionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetConnectionResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionResponse.java new file mode 100644 index 00000000..9b41de16 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetConnectionResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetConnectionResponse { + + /** + * OK + */ + private Optional connection; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetConnectionResponse( + Optional connection, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(connection, "connection"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.connection = connection; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional connection() { + return connection; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public GetConnectionResponse withConnection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public GetConnectionResponse withConnection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public GetConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetConnectionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetConnectionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetConnectionResponse 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; + } + GetConnectionResponse other = (GetConnectionResponse) o; + return + java.util.Objects.deepEquals(this.connection, other.connection) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetConnectionResponse.class, + "connection", connection, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional connection = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder connection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public Builder connection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetConnectionResponse build() { + return new GetConnectionResponse( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequest.java new file mode 100644 index 00000000..b07c05f3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +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; + + 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. + */ + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + 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 + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.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/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequestBuilder.java new file mode 100644 index 00000000..14de0879 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateBankTransactionsModelRequestBuilder { + + private GetCreateBankTransactionsModelRequest request; + + 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 GetCreateBankTransactionsModelResponse call() throws Exception { + return sdk.getCreateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelResponse.java new file mode 100644 index 00000000..dfd7505e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateBankTransactionsModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateBankTransactionsModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * 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; + + public GetCreateBankTransactionsModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * Success + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + 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; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateBankTransactionsModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateBankTransactionsModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Success + */ + public GetCreateBankTransactionsModelResponse withPushOption(io.codat.lending.models.shared.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 + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateBankTransactionsModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Success + */ + public Builder pushOption(io.codat.lending.models.shared.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, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequest.java new file mode 100644 index 00000000..9db8b5b0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateChartOfAccountsModelRequest { + + /** + * 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; + + public GetCreateChartOfAccountsModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateChartOfAccountsModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateChartOfAccountsModelRequest 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; + } + GetCreateChartOfAccountsModelRequest other = (GetCreateChartOfAccountsModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateChartOfAccountsModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateChartOfAccountsModelRequest build() { + return new GetCreateChartOfAccountsModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequestBuilder.java new file mode 100644 index 00000000..676bc70c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateChartOfAccountsModelRequestBuilder { + + private GetCreateChartOfAccountsModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateChartOfAccountsModel sdk; + + public GetCreateChartOfAccountsModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateChartOfAccountsModel sdk) { + this.sdk = sdk; + } + + public GetCreateChartOfAccountsModelRequestBuilder request(GetCreateChartOfAccountsModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateChartOfAccountsModelResponse call() throws Exception { + return sdk.getCreateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelResponse.java new file mode 100644 index 00000000..1cef0df6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateChartOfAccountsModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateChartOfAccountsModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateChartOfAccountsModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateChartOfAccountsModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateChartOfAccountsModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateChartOfAccountsModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateChartOfAccountsModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreateChartOfAccountsModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateChartOfAccountsModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateChartOfAccountsModelResponse 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; + } + GetCreateChartOfAccountsModelResponse other = (GetCreateChartOfAccountsModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateChartOfAccountsModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreateChartOfAccountsModelResponse build() { + return new GetCreateChartOfAccountsModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequest.java new file mode 100644 index 00000000..17abeed2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateDirectCostsModelRequest { + + /** + * 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; + + public GetCreateDirectCostsModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateDirectCostsModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateDirectCostsModelRequest 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; + } + GetCreateDirectCostsModelRequest other = (GetCreateDirectCostsModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateDirectCostsModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateDirectCostsModelRequest build() { + return new GetCreateDirectCostsModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequestBuilder.java new file mode 100644 index 00000000..b8524ecf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateDirectCostsModelRequestBuilder { + + private GetCreateDirectCostsModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateDirectCostsModel sdk; + + public GetCreateDirectCostsModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateDirectCostsModel sdk) { + this.sdk = sdk; + } + + public GetCreateDirectCostsModelRequestBuilder request(GetCreateDirectCostsModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateDirectCostsModelResponse call() throws Exception { + return sdk.getCreateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelResponse.java new file mode 100644 index 00000000..0f4e1b2c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateDirectCostsModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateDirectCostsModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateDirectCostsModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateDirectCostsModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateDirectCostsModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateDirectCostsModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateDirectCostsModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreateDirectCostsModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateDirectCostsModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateDirectCostsModelResponse 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; + } + GetCreateDirectCostsModelResponse other = (GetCreateDirectCostsModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateDirectCostsModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreateDirectCostsModelResponse build() { + return new GetCreateDirectCostsModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequest.java new file mode 100644 index 00000000..a7707b88 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateOperationRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for the push operation. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pushOperationKey") + private String pushOperationKey; + + public GetCreateOperationRequest( + String companyId, + String pushOperationKey) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.companyId = companyId; + this.pushOperationKey = pushOperationKey; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for the push operation. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateOperationRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for the push operation. + */ + public GetCreateOperationRequest withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCreateOperationRequest other = (GetCreateOperationRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + pushOperationKey); + } + + @Override + public String toString() { + return Utils.toString(GetCreateOperationRequest.class, + "companyId", companyId, + "pushOperationKey", pushOperationKey); + } + + public final static class Builder { + + private String companyId; + + private String pushOperationKey; + + 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; + } + + /** + * Unique identifier for the push operation. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + return this; + } + + public GetCreateOperationRequest build() { + return new GetCreateOperationRequest( + companyId, + pushOperationKey); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequestBuilder.java new file mode 100644 index 00000000..32a79c98 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateOperationRequestBuilder { + + private GetCreateOperationRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateOperation sdk; + + public GetCreateOperationRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateOperation sdk) { + this.sdk = sdk; + } + + public GetCreateOperationRequestBuilder request(GetCreateOperationRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateOperationResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationResponse.java new file mode 100644 index 00000000..25e95902 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateOperationResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateOperationResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOperation; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateOperationResponse( + String contentType, + Optional errorMessage, + Optional pushOperation, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperation, "pushOperation"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOperation = pushOperation; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOperation() { + return pushOperation; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateOperationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateOperationResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateOperationResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateOperationResponse withPushOperation(io.codat.lending.models.shared.PushOperation pushOperation) { + Utils.checkNotNull(pushOperation, "pushOperation"); + this.pushOperation = Optional.ofNullable(pushOperation); + return this; + } + + /** + * OK + */ + public GetCreateOperationResponse withPushOperation(Optional pushOperation) { + Utils.checkNotNull(pushOperation, "pushOperation"); + this.pushOperation = pushOperation; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateOperationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateOperationResponse 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; + } + GetCreateOperationResponse other = (GetCreateOperationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperation, other.pushOperation) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOperation, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateOperationResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOperation", pushOperation, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional pushOperation = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOperation(io.codat.lending.models.shared.PushOperation pushOperation) { + Utils.checkNotNull(pushOperation, "pushOperation"); + this.pushOperation = Optional.ofNullable(pushOperation); + return this; + } + + /** + * OK + */ + public Builder pushOperation(Optional pushOperation) { + Utils.checkNotNull(pushOperation, "pushOperation"); + this.pushOperation = pushOperation; + 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 GetCreateOperationResponse build() { + return new GetCreateOperationResponse( + contentType, + errorMessage, + pushOperation, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequest.java new file mode 100644 index 00000000..63b6e113 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreatePaymentModelRequest { + + /** + * 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; + + public GetCreatePaymentModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreatePaymentModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreatePaymentModelRequest 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; + } + GetCreatePaymentModelRequest other = (GetCreatePaymentModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreatePaymentModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreatePaymentModelRequest build() { + return new GetCreatePaymentModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequestBuilder.java new file mode 100644 index 00000000..feafea17 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreatePaymentModelRequestBuilder { + + private GetCreatePaymentModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreatePaymentModel sdk; + + public GetCreatePaymentModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreatePaymentModel sdk) { + this.sdk = sdk; + } + + public GetCreatePaymentModelRequestBuilder request(GetCreatePaymentModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreatePaymentModelResponse call() throws Exception { + return sdk.getCreateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelResponse.java new file mode 100644 index 00000000..1d3eaf03 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreatePaymentModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreatePaymentModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreatePaymentModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreatePaymentModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreatePaymentModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreatePaymentModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreatePaymentModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreatePaymentModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreatePaymentModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreatePaymentModelResponse 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; + } + GetCreatePaymentModelResponse other = (GetCreatePaymentModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreatePaymentModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreatePaymentModelResponse build() { + return new GetCreatePaymentModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequest.java new file mode 100644 index 00000000..ee583e3b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateTransfersModelRequest { + + /** + * 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; + + public GetCreateTransfersModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateTransfersModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateTransfersModelRequest 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; + } + GetCreateTransfersModelRequest other = (GetCreateTransfersModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateTransfersModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateTransfersModelRequest build() { + return new GetCreateTransfersModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequestBuilder.java new file mode 100644 index 00000000..d60256bc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateTransfersModelRequestBuilder { + + private GetCreateTransfersModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateTransfersModel sdk; + + public GetCreateTransfersModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateTransfersModel sdk) { + this.sdk = sdk; + } + + public GetCreateTransfersModelRequestBuilder request(GetCreateTransfersModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateTransfersModelResponse call() throws Exception { + return sdk.getCreateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelResponse.java new file mode 100644 index 00000000..5d510816 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateTransfersModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateTransfersModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateTransfersModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateTransfersModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateTransfersModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateTransfersModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateTransfersModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreateTransfersModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateTransfersModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateTransfersModelResponse 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; + } + GetCreateTransfersModelResponse other = (GetCreateTransfersModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateTransfersModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreateTransfersModelResponse build() { + return new GetCreateTransfersModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequest.java new file mode 100644 index 00000000..7ab5e65e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateUpdateBankAccountsModelRequest { + + /** + * 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; + + public GetCreateUpdateBankAccountsModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateUpdateBankAccountsModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateUpdateBankAccountsModelRequest 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; + } + GetCreateUpdateBankAccountsModelRequest other = (GetCreateUpdateBankAccountsModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateUpdateBankAccountsModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateUpdateBankAccountsModelRequest build() { + return new GetCreateUpdateBankAccountsModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequestBuilder.java new file mode 100644 index 00000000..881bf27b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateUpdateBankAccountsModelRequestBuilder { + + private GetCreateUpdateBankAccountsModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateUpdateBankAccountsModel sdk; + + public GetCreateUpdateBankAccountsModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateUpdateBankAccountsModel sdk) { + this.sdk = sdk; + } + + public GetCreateUpdateBankAccountsModelRequestBuilder request(GetCreateUpdateBankAccountsModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateUpdateBankAccountsModelResponse call() throws Exception { + return sdk.getCreateUpdateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelResponse.java new file mode 100644 index 00000000..aa7e39b8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateBankAccountsModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateUpdateBankAccountsModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateUpdateBankAccountsModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateUpdateBankAccountsModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateUpdateBankAccountsModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateUpdateBankAccountsModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateUpdateBankAccountsModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreateUpdateBankAccountsModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateUpdateBankAccountsModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateUpdateBankAccountsModelResponse 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; + } + GetCreateUpdateBankAccountsModelResponse other = (GetCreateUpdateBankAccountsModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateUpdateBankAccountsModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreateUpdateBankAccountsModelResponse build() { + return new GetCreateUpdateBankAccountsModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequest.java new file mode 100644 index 00000000..6a4863c6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetCreateUpdateSuppliersModelRequest { + + /** + * 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; + + public GetCreateUpdateSuppliersModelRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetCreateUpdateSuppliersModelRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public GetCreateUpdateSuppliersModelRequest 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; + } + GetCreateUpdateSuppliersModelRequest other = (GetCreateUpdateSuppliersModelRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(GetCreateUpdateSuppliersModelRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public GetCreateUpdateSuppliersModelRequest build() { + return new GetCreateUpdateSuppliersModelRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequestBuilder.java new file mode 100644 index 00000000..f062afaa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetCreateUpdateSuppliersModelRequestBuilder { + + private GetCreateUpdateSuppliersModelRequest request; + + private final SDKMethodInterfaces.MethodCallGetCreateUpdateSuppliersModel sdk; + + public GetCreateUpdateSuppliersModelRequestBuilder(SDKMethodInterfaces.MethodCallGetCreateUpdateSuppliersModel sdk) { + this.sdk = sdk; + } + + public GetCreateUpdateSuppliersModelRequestBuilder request(GetCreateUpdateSuppliersModelRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetCreateUpdateSuppliersModelResponse call() throws Exception { + return sdk.getCreateUpdateModel( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelResponse.java new file mode 100644 index 00000000..cd864174 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetCreateUpdateSuppliersModelResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCreateUpdateSuppliersModelResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOption; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetCreateUpdateSuppliersModelResponse( + String contentType, + Optional errorMessage, + Optional pushOption, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOption, "pushOption"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOption = pushOption; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOption() { + return pushOption; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetCreateUpdateSuppliersModelResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateUpdateSuppliersModelResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetCreateUpdateSuppliersModelResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetCreateUpdateSuppliersModelResponse withPushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + public GetCreateUpdateSuppliersModelResponse withPushOption(Optional pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = pushOption; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCreateUpdateSuppliersModelResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCreateUpdateSuppliersModelResponse 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; + } + GetCreateUpdateSuppliersModelResponse other = (GetCreateUpdateSuppliersModelResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOption, other.pushOption) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCreateUpdateSuppliersModelResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOption", pushOption, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOption(io.codat.lending.models.shared.PushOption pushOption) { + Utils.checkNotNull(pushOption, "pushOption"); + this.pushOption = Optional.ofNullable(pushOption); + return this; + } + + /** + * OK + */ + 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 GetCreateUpdateSuppliersModelResponse build() { + return new GetCreateUpdateSuppliersModelResponse( + contentType, + errorMessage, + pushOption, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequest.java new file mode 100644 index 00000000..3d92a0ec --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetDataIntegrityStatusRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * A key for a Codat data type. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=dataType") + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + public GetDataIntegrityStatusRequest( + String companyId, + io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(dataType, "dataType"); + this.companyId = companyId; + this.dataType = dataType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * A key for a Codat data type. + */ + public io.codat.lending.models.shared.DataIntegrityDataType dataType() { + return dataType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetDataIntegrityStatusRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * A key for a Codat data type. + */ + public GetDataIntegrityStatusRequest withDataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDataIntegrityStatusRequest other = (GetDataIntegrityStatusRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.dataType, other.dataType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + dataType); + } + + @Override + public String toString() { + return Utils.toString(GetDataIntegrityStatusRequest.class, + "companyId", companyId, + "dataType", dataType); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + 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; + } + + /** + * A key for a Codat data type. + */ + public Builder dataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + public GetDataIntegrityStatusRequest build() { + return new GetDataIntegrityStatusRequest( + companyId, + dataType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequestBuilder.java new file mode 100644 index 00000000..d3dd2301 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetDataIntegrityStatusRequestBuilder { + + private GetDataIntegrityStatusRequest request; + + private final SDKMethodInterfaces.MethodCallGetDataIntegrityStatus sdk; + + public GetDataIntegrityStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetDataIntegrityStatus sdk) { + this.sdk = sdk; + } + + public GetDataIntegrityStatusRequestBuilder request(GetDataIntegrityStatusRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetDataIntegrityStatusResponse call() throws Exception { + return sdk.status( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusResponse.java new file mode 100644 index 00000000..3e2beed9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegrityStatusResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetDataIntegrityStatusResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional dataIntegrityStatuses; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetDataIntegrityStatusResponse( + String contentType, + Optional dataIntegrityStatuses, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(dataIntegrityStatuses, "dataIntegrityStatuses"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.dataIntegrityStatuses = dataIntegrityStatuses; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional dataIntegrityStatuses() { + return dataIntegrityStatuses; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetDataIntegrityStatusResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetDataIntegrityStatusResponse withDataIntegrityStatuses(io.codat.lending.models.shared.DataIntegrityStatuses dataIntegrityStatuses) { + Utils.checkNotNull(dataIntegrityStatuses, "dataIntegrityStatuses"); + this.dataIntegrityStatuses = Optional.ofNullable(dataIntegrityStatuses); + return this; + } + + /** + * OK + */ + public GetDataIntegrityStatusResponse withDataIntegrityStatuses(Optional dataIntegrityStatuses) { + Utils.checkNotNull(dataIntegrityStatuses, "dataIntegrityStatuses"); + this.dataIntegrityStatuses = dataIntegrityStatuses; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetDataIntegrityStatusResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetDataIntegrityStatusResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetDataIntegrityStatusResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDataIntegrityStatusResponse 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; + } + GetDataIntegrityStatusResponse other = (GetDataIntegrityStatusResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.dataIntegrityStatuses, other.dataIntegrityStatuses) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + dataIntegrityStatuses, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDataIntegrityStatusResponse.class, + "contentType", contentType, + "dataIntegrityStatuses", dataIntegrityStatuses, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional dataIntegrityStatuses = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder dataIntegrityStatuses(io.codat.lending.models.shared.DataIntegrityStatuses dataIntegrityStatuses) { + Utils.checkNotNull(dataIntegrityStatuses, "dataIntegrityStatuses"); + this.dataIntegrityStatuses = Optional.ofNullable(dataIntegrityStatuses); + return this; + } + + /** + * OK + */ + public Builder dataIntegrityStatuses(Optional dataIntegrityStatuses) { + Utils.checkNotNull(dataIntegrityStatuses, "dataIntegrityStatuses"); + this.dataIntegrityStatuses = dataIntegrityStatuses; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetDataIntegrityStatusResponse build() { + return new GetDataIntegrityStatusResponse( + contentType, + dataIntegrityStatuses, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequest.java new file mode 100644 index 00000000..1215ab3f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequest.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GetDataIntegritySummariesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * A key for a Codat data type. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=dataType") + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public GetDataIntegritySummariesRequest( + String companyId, + io.codat.lending.models.shared.DataIntegrityDataType dataType, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.dataType = dataType; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * A key for a Codat data type. + */ + public io.codat.lending.models.shared.DataIntegrityDataType dataType() { + return dataType; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetDataIntegritySummariesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * A key for a Codat data type. + */ + public GetDataIntegritySummariesRequest withDataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public GetDataIntegritySummariesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public GetDataIntegritySummariesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDataIntegritySummariesRequest other = (GetDataIntegritySummariesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + dataType, + query); + } + + @Override + public String toString() { + return Utils.toString(GetDataIntegritySummariesRequest.class, + "companyId", companyId, + "dataType", dataType, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * A key for a Codat data type. + */ + public Builder dataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public GetDataIntegritySummariesRequest build() { + return new GetDataIntegritySummariesRequest( + companyId, + dataType, + query); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequestBuilder.java new file mode 100644 index 00000000..7b58dd3f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetDataIntegritySummariesRequestBuilder { + + private GetDataIntegritySummariesRequest request; + + private final SDKMethodInterfaces.MethodCallGetDataIntegritySummaries sdk; + + public GetDataIntegritySummariesRequestBuilder(SDKMethodInterfaces.MethodCallGetDataIntegritySummaries sdk) { + this.sdk = sdk; + } + + public GetDataIntegritySummariesRequestBuilder request(GetDataIntegritySummariesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetDataIntegritySummariesResponse call() throws Exception { + return sdk.summaries( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesResponse.java new file mode 100644 index 00000000..fd242a90 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataIntegritySummariesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetDataIntegritySummariesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional dataIntegritySummaries; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetDataIntegritySummariesResponse( + String contentType, + Optional dataIntegritySummaries, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(dataIntegritySummaries, "dataIntegritySummaries"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.dataIntegritySummaries = dataIntegritySummaries; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional dataIntegritySummaries() { + return dataIntegritySummaries; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetDataIntegritySummariesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetDataIntegritySummariesResponse withDataIntegritySummaries(io.codat.lending.models.shared.DataIntegritySummaries dataIntegritySummaries) { + Utils.checkNotNull(dataIntegritySummaries, "dataIntegritySummaries"); + this.dataIntegritySummaries = Optional.ofNullable(dataIntegritySummaries); + return this; + } + + /** + * OK + */ + public GetDataIntegritySummariesResponse withDataIntegritySummaries(Optional dataIntegritySummaries) { + Utils.checkNotNull(dataIntegritySummaries, "dataIntegritySummaries"); + this.dataIntegritySummaries = dataIntegritySummaries; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetDataIntegritySummariesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetDataIntegritySummariesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetDataIntegritySummariesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDataIntegritySummariesResponse 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; + } + GetDataIntegritySummariesResponse other = (GetDataIntegritySummariesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.dataIntegritySummaries, other.dataIntegritySummaries) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + dataIntegritySummaries, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDataIntegritySummariesResponse.class, + "contentType", contentType, + "dataIntegritySummaries", dataIntegritySummaries, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional dataIntegritySummaries = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder dataIntegritySummaries(io.codat.lending.models.shared.DataIntegritySummaries dataIntegritySummaries) { + Utils.checkNotNull(dataIntegritySummaries, "dataIntegritySummaries"); + this.dataIntegritySummaries = Optional.ofNullable(dataIntegritySummaries); + return this; + } + + /** + * OK + */ + public Builder dataIntegritySummaries(Optional dataIntegritySummaries) { + Utils.checkNotNull(dataIntegritySummaries, "dataIntegritySummaries"); + this.dataIntegritySummaries = dataIntegritySummaries; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetDataIntegritySummariesResponse build() { + return new GetDataIntegritySummariesResponse( + contentType, + dataIntegritySummaries, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequest.java new file mode 100644 index 00000000..232837af --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetDataStatusRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public GetDataStatusRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetDataStatusRequest 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; + } + GetDataStatusRequest other = (GetDataStatusRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(GetDataStatusRequest.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 GetDataStatusRequest build() { + return new GetDataStatusRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequestBuilder.java new file mode 100644 index 00000000..c98bb74c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetDataStatusRequestBuilder { + + private GetDataStatusRequest request; + + private final SDKMethodInterfaces.MethodCallGetDataStatus sdk; + + public GetDataStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetDataStatus sdk) { + this.sdk = sdk; + } + + public GetDataStatusRequestBuilder request(GetDataStatusRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetDataStatusResponse call() throws Exception { + return sdk.getStatus( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusResponse.java new file mode 100644 index 00000000..4bbfcee4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetDataStatusResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetDataStatusResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional> dataStatuses; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetDataStatusResponse( + String contentType, + Optional> dataStatuses, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(dataStatuses, "dataStatuses"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.dataStatuses = dataStatuses; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional> dataStatuses() { + return dataStatuses; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetDataStatusResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public GetDataStatusResponse withDataStatuses(java.util.Map dataStatuses) { + Utils.checkNotNull(dataStatuses, "dataStatuses"); + this.dataStatuses = Optional.ofNullable(dataStatuses); + return this; + } + + /** + * OK + */ + public GetDataStatusResponse withDataStatuses(Optional> dataStatuses) { + Utils.checkNotNull(dataStatuses, "dataStatuses"); + this.dataStatuses = dataStatuses; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetDataStatusResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetDataStatusResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetDataStatusResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDataStatusResponse 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; + } + GetDataStatusResponse other = (GetDataStatusResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.dataStatuses, other.dataStatuses) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + dataStatuses, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDataStatusResponse.class, + "contentType", contentType, + "dataStatuses", dataStatuses, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional> dataStatuses = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder dataStatuses(java.util.Map dataStatuses) { + Utils.checkNotNull(dataStatuses, "dataStatuses"); + this.dataStatuses = Optional.ofNullable(dataStatuses); + return this; + } + + /** + * OK + */ + public Builder dataStatuses(Optional> dataStatuses) { + Utils.checkNotNull(dataStatuses, "dataStatuses"); + this.dataStatuses = dataStatuses; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 GetDataStatusResponse build() { + return new GetDataStatusResponse( + contentType, + dataStatuses, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequest.java new file mode 100644 index 00000000..d80f1e43 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetExcelReportGenerationStatusRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * The type of report you want to generate and download. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=reportType") + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + public GetExcelReportGenerationStatusRequest( + String companyId, + io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(reportType, "reportType"); + this.companyId = companyId; + this.reportType = reportType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * The type of report you want to generate and download. + */ + public io.codat.lending.models.shared.ExcelReportTypes reportType() { + return reportType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetExcelReportGenerationStatusRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * The type of report you want to generate and download. + */ + public GetExcelReportGenerationStatusRequest withReportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExcelReportGenerationStatusRequest other = (GetExcelReportGenerationStatusRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.reportType, other.reportType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + reportType); + } + + @Override + public String toString() { + return Utils.toString(GetExcelReportGenerationStatusRequest.class, + "companyId", companyId, + "reportType", reportType); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.ExcelReportTypes reportType; + + 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; + } + + /** + * The type of report you want to generate and download. + */ + public Builder reportType(io.codat.lending.models.shared.ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + public GetExcelReportGenerationStatusRequest build() { + return new GetExcelReportGenerationStatusRequest( + companyId, + reportType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequestBuilder.java new file mode 100644 index 00000000..9d7c0134 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetExcelReportGenerationStatusRequestBuilder { + + private GetExcelReportGenerationStatusRequest request; + + private final SDKMethodInterfaces.MethodCallGetExcelReportGenerationStatus sdk; + + public GetExcelReportGenerationStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetExcelReportGenerationStatus sdk) { + this.sdk = sdk; + } + + public GetExcelReportGenerationStatusRequestBuilder request(GetExcelReportGenerationStatusRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetExcelReportGenerationStatusResponse call() throws Exception { + return sdk.getStatus( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusResponse.java new file mode 100644 index 00000000..50321063 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetExcelReportGenerationStatusResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetExcelReportGenerationStatusResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional excelStatus; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetExcelReportGenerationStatusResponse( + String contentType, + Optional errorMessage, + Optional excelStatus, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(excelStatus, "excelStatus"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.excelStatus = excelStatus; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional excelStatus() { + return excelStatus; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetExcelReportGenerationStatusResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetExcelReportGenerationStatusResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public GetExcelReportGenerationStatusResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetExcelReportGenerationStatusResponse withExcelStatus(io.codat.lending.models.shared.ExcelStatus excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = Optional.ofNullable(excelStatus); + return this; + } + + /** + * OK + */ + public GetExcelReportGenerationStatusResponse withExcelStatus(Optional excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = excelStatus; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetExcelReportGenerationStatusResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetExcelReportGenerationStatusResponse 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; + } + GetExcelReportGenerationStatusResponse other = (GetExcelReportGenerationStatusResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.excelStatus, other.excelStatus) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + excelStatus, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetExcelReportGenerationStatusResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "excelStatus", excelStatus, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional excelStatus = 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; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder excelStatus(io.codat.lending.models.shared.ExcelStatus excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = Optional.ofNullable(excelStatus); + return this; + } + + /** + * OK + */ + public Builder excelStatus(Optional excelStatus) { + Utils.checkNotNull(excelStatus, "excelStatus"); + this.excelStatus = excelStatus; + 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 GetExcelReportGenerationStatusResponse build() { + return new GetExcelReportGenerationStatusResponse( + contentType, + errorMessage, + excelStatus, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryQueryParamSourceType.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryQueryParamSourceType.java new file mode 100644 index 00000000..bbfc63de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryQueryParamSourceType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * GetLoanSummaryQueryParamSourceType - Data source type. + */ +public enum GetLoanSummaryQueryParamSourceType { + BANKING("banking"), + COMMERCE("commerce"), + ACCOUNTING("accounting"); + + @JsonValue + private final String value; + + private GetLoanSummaryQueryParamSourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequest.java new file mode 100644 index 00000000..9c91e1ec --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetLoanSummaryRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Data source type. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sourceType") + private GetLoanSummaryQueryParamSourceType sourceType; + + public GetLoanSummaryRequest( + String companyId, + GetLoanSummaryQueryParamSourceType sourceType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(sourceType, "sourceType"); + this.companyId = companyId; + this.sourceType = sourceType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Data source type. + */ + public GetLoanSummaryQueryParamSourceType sourceType() { + return sourceType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetLoanSummaryRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Data source type. + */ + public GetLoanSummaryRequest withSourceType(GetLoanSummaryQueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLoanSummaryRequest other = (GetLoanSummaryRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + sourceType); + } + + @Override + public String toString() { + return Utils.toString(GetLoanSummaryRequest.class, + "companyId", companyId, + "sourceType", sourceType); + } + + public final static class Builder { + + private String companyId; + + private GetLoanSummaryQueryParamSourceType sourceType; + + 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; + } + + /** + * Data source type. + */ + public Builder sourceType(GetLoanSummaryQueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + public GetLoanSummaryRequest build() { + return new GetLoanSummaryRequest( + companyId, + sourceType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequestBuilder.java new file mode 100644 index 00000000..3c9c817f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetLoanSummaryRequestBuilder { + + private GetLoanSummaryRequest request; + + private final SDKMethodInterfaces.MethodCallGetLoanSummary sdk; + + public GetLoanSummaryRequestBuilder(SDKMethodInterfaces.MethodCallGetLoanSummary sdk) { + this.sdk = sdk; + } + + public GetLoanSummaryRequestBuilder request(GetLoanSummaryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetLoanSummaryResponse call() throws Exception { + return sdk.getLoanSummary( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryResponse.java new file mode 100644 index 00000000..905f4ea8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetLoanSummaryResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetLoanSummaryResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional loanSummary; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetLoanSummaryResponse( + String contentType, + Optional errorMessage, + Optional loanSummary, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(loanSummary, "loanSummary"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.loanSummary = loanSummary; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional loanSummary() { + return loanSummary; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetLoanSummaryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetLoanSummaryResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetLoanSummaryResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetLoanSummaryResponse withLoanSummary(io.codat.lending.models.shared.LoanSummary loanSummary) { + Utils.checkNotNull(loanSummary, "loanSummary"); + this.loanSummary = Optional.ofNullable(loanSummary); + return this; + } + + /** + * OK + */ + public GetLoanSummaryResponse withLoanSummary(Optional loanSummary) { + Utils.checkNotNull(loanSummary, "loanSummary"); + this.loanSummary = loanSummary; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetLoanSummaryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLoanSummaryResponse 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; + } + GetLoanSummaryResponse other = (GetLoanSummaryResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.loanSummary, other.loanSummary) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + loanSummary, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLoanSummaryResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "loanSummary", loanSummary, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional loanSummary = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder loanSummary(io.codat.lending.models.shared.LoanSummary loanSummary) { + Utils.checkNotNull(loanSummary, "loanSummary"); + this.loanSummary = Optional.ofNullable(loanSummary); + return this; + } + + /** + * OK + */ + public Builder loanSummary(Optional loanSummary) { + Utils.checkNotNull(loanSummary, "loanSummary"); + this.loanSummary = loanSummary; + 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 GetLoanSummaryResponse build() { + return new GetLoanSummaryResponse( + contentType, + errorMessage, + loanSummary, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequest.java new file mode 100644 index 00000000..0cecf17a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class GetPullOperationRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Unique identifier for the dataset that completed its sync. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=datasetId") + private String datasetId; + + public GetPullOperationRequest( + String companyId, + String datasetId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(datasetId, "datasetId"); + this.companyId = companyId; + this.datasetId = datasetId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for the dataset that completed its sync. + */ + public String datasetId() { + return datasetId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public GetPullOperationRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for the dataset that completed its sync. + */ + public GetPullOperationRequest withDatasetId(String datasetId) { + Utils.checkNotNull(datasetId, "datasetId"); + this.datasetId = datasetId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPullOperationRequest other = (GetPullOperationRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.datasetId, other.datasetId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + datasetId); + } + + @Override + public String toString() { + return Utils.toString(GetPullOperationRequest.class, + "companyId", companyId, + "datasetId", datasetId); + } + + public final static class Builder { + + private String companyId; + + private String datasetId; + + 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; + } + + /** + * Unique identifier for the dataset that completed its sync. + */ + public Builder datasetId(String datasetId) { + Utils.checkNotNull(datasetId, "datasetId"); + this.datasetId = datasetId; + return this; + } + + public GetPullOperationRequest build() { + return new GetPullOperationRequest( + companyId, + datasetId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequestBuilder.java new file mode 100644 index 00000000..d3b48d9c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class GetPullOperationRequestBuilder { + + private GetPullOperationRequest request; + + private final SDKMethodInterfaces.MethodCallGetPullOperation sdk; + + public GetPullOperationRequestBuilder(SDKMethodInterfaces.MethodCallGetPullOperation sdk) { + this.sdk = sdk; + } + + public GetPullOperationRequestBuilder request(GetPullOperationRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetPullOperationResponse call() throws Exception { + return sdk.get( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationResponse.java new file mode 100644 index 00000000..f4ada126 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/GetPullOperationResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetPullOperationResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pullOperation; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public GetPullOperationResponse( + String contentType, + Optional errorMessage, + Optional pullOperation, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pullOperation, "pullOperation"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pullOperation = pullOperation; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pullOperation() { + return pullOperation; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public GetPullOperationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetPullOperationResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public GetPullOperationResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public GetPullOperationResponse withPullOperation(io.codat.lending.models.shared.PullOperation pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = Optional.ofNullable(pullOperation); + return this; + } + + /** + * OK + */ + public GetPullOperationResponse withPullOperation(Optional pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = pullOperation; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPullOperationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPullOperationResponse 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; + } + GetPullOperationResponse other = (GetPullOperationResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pullOperation, other.pullOperation) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pullOperation, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPullOperationResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pullOperation", pullOperation, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional pullOperation = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pullOperation(io.codat.lending.models.shared.PullOperation pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = Optional.ofNullable(pullOperation); + return this; + } + + /** + * OK + */ + public Builder pullOperation(Optional pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = pullOperation; + 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 GetPullOperationResponse build() { + return new GetPullOperationResponse( + contentType, + errorMessage, + pullOperation, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequest.java new file mode 100644 index 00000000..73acb102 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class IsAgedCreditorsReportAvailableRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public IsAgedCreditorsReportAvailableRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public IsAgedCreditorsReportAvailableRequest 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; + } + IsAgedCreditorsReportAvailableRequest other = (IsAgedCreditorsReportAvailableRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(IsAgedCreditorsReportAvailableRequest.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 IsAgedCreditorsReportAvailableRequest build() { + return new IsAgedCreditorsReportAvailableRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequestBuilder.java new file mode 100644 index 00000000..5adaa70b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class IsAgedCreditorsReportAvailableRequestBuilder { + + private IsAgedCreditorsReportAvailableRequest request; + + private final SDKMethodInterfaces.MethodCallIsAgedCreditorsReportAvailable sdk; + + public IsAgedCreditorsReportAvailableRequestBuilder(SDKMethodInterfaces.MethodCallIsAgedCreditorsReportAvailable sdk) { + this.sdk = sdk; + } + + public IsAgedCreditorsReportAvailableRequestBuilder request(IsAgedCreditorsReportAvailableRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public IsAgedCreditorsReportAvailableResponse call() throws Exception { + return sdk.isAgedCreditorsAvailable( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableResponse.java new file mode 100644 index 00000000..e7ac09c4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedCreditorsReportAvailableResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class IsAgedCreditorsReportAvailableResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * OK + */ + private Optional boolean_; + + public IsAgedCreditorsReportAvailableResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse, + Optional boolean_) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(boolean_, "boolean_"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.boolean_ = boolean_; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * OK + */ + public Optional boolean_() { + return boolean_; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public IsAgedCreditorsReportAvailableResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public IsAgedCreditorsReportAvailableResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public IsAgedCreditorsReportAvailableResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public IsAgedCreditorsReportAvailableResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public IsAgedCreditorsReportAvailableResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public IsAgedCreditorsReportAvailableResponse withBoolean(boolean boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = Optional.ofNullable(boolean_); + return this; + } + + /** + * OK + */ + public IsAgedCreditorsReportAvailableResponse withBoolean(Optional boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = boolean_; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsAgedCreditorsReportAvailableResponse other = (IsAgedCreditorsReportAvailableResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.boolean_, other.boolean_); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse, + boolean_); + } + + @Override + public String toString() { + return Utils.toString(IsAgedCreditorsReportAvailableResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse, + "boolean_", boolean_); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional boolean_ = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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; + } + + /** + * OK + */ + public Builder boolean_(boolean boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = Optional.ofNullable(boolean_); + return this; + } + + /** + * OK + */ + public Builder boolean_(Optional boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = boolean_; + return this; + } + + public IsAgedCreditorsReportAvailableResponse build() { + return new IsAgedCreditorsReportAvailableResponse( + contentType, + errorMessage, + statusCode, + rawResponse, + boolean_); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequest.java new file mode 100644 index 00000000..5f02230f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class IsAgedDebtorsReportAvailableRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public IsAgedDebtorsReportAvailableRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public IsAgedDebtorsReportAvailableRequest 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; + } + IsAgedDebtorsReportAvailableRequest other = (IsAgedDebtorsReportAvailableRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(IsAgedDebtorsReportAvailableRequest.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 IsAgedDebtorsReportAvailableRequest build() { + return new IsAgedDebtorsReportAvailableRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequestBuilder.java new file mode 100644 index 00000000..819b1c1c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class IsAgedDebtorsReportAvailableRequestBuilder { + + private IsAgedDebtorsReportAvailableRequest request; + + private final SDKMethodInterfaces.MethodCallIsAgedDebtorsReportAvailable sdk; + + public IsAgedDebtorsReportAvailableRequestBuilder(SDKMethodInterfaces.MethodCallIsAgedDebtorsReportAvailable sdk) { + this.sdk = sdk; + } + + public IsAgedDebtorsReportAvailableRequestBuilder request(IsAgedDebtorsReportAvailableRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public IsAgedDebtorsReportAvailableResponse call() throws Exception { + return sdk.isAgedDebtorsAvailable( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableResponse.java new file mode 100644 index 00000000..8a7f9c30 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/IsAgedDebtorsReportAvailableResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class IsAgedDebtorsReportAvailableResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * OK + */ + private Optional boolean_; + + public IsAgedDebtorsReportAvailableResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse, + Optional boolean_) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(boolean_, "boolean_"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.boolean_ = boolean_; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * OK + */ + public Optional boolean_() { + return boolean_; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public IsAgedDebtorsReportAvailableResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public IsAgedDebtorsReportAvailableResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public IsAgedDebtorsReportAvailableResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public IsAgedDebtorsReportAvailableResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public IsAgedDebtorsReportAvailableResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * OK + */ + public IsAgedDebtorsReportAvailableResponse withBoolean(boolean boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = Optional.ofNullable(boolean_); + return this; + } + + /** + * OK + */ + public IsAgedDebtorsReportAvailableResponse withBoolean(Optional boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = boolean_; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsAgedDebtorsReportAvailableResponse other = (IsAgedDebtorsReportAvailableResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.boolean_, other.boolean_); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse, + boolean_); + } + + @Override + public String toString() { + return Utils.toString(IsAgedDebtorsReportAvailableResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse, + "boolean_", boolean_); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional boolean_ = Optional.empty(); + + 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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; + } + + /** + * OK + */ + public Builder boolean_(boolean boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = Optional.ofNullable(boolean_); + return this; + } + + /** + * OK + */ + public Builder boolean_(Optional boolean_) { + Utils.checkNotNull(boolean_, "boolean_"); + this.boolean_ = boolean_; + return this; + } + + public IsAgedDebtorsReportAvailableResponse build() { + return new IsAgedDebtorsReportAvailableResponse( + contentType, + errorMessage, + statusCode, + rawResponse, + boolean_); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequest.java new file mode 100644 index 00000000..12ec6ce6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingAccountTransactionsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingAccountTransactionsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingAccountTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingAccountTransactionsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingAccountTransactionsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingAccountTransactionsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountTransactionsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountTransactionsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountTransactionsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountTransactionsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingAccountTransactionsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingAccountTransactionsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingAccountTransactionsRequest other = (ListAccountingAccountTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingAccountTransactionsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingAccountTransactionsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingAccountTransactionsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequestBuilder.java new file mode 100644 index 00000000..050bc70d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingAccountTransactionsRequestBuilder { + + private ListAccountingAccountTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingAccountTransactions sdk; + + public ListAccountingAccountTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingAccountTransactions sdk) { + this.sdk = sdk; + } + + public ListAccountingAccountTransactionsRequestBuilder request(ListAccountingAccountTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingAccountTransactionsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsResponse.java new file mode 100644 index 00000000..5ac3b7de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingAccountTransactionsResponse { + + /** + * Success + */ + private Optional accountingAccountTransactions; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingAccountTransactionsResponse( + Optional accountingAccountTransactions, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAccountTransactions, "accountingAccountTransactions"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAccountTransactions = accountingAccountTransactions; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingAccountTransactions() { + return accountingAccountTransactions; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingAccountTransactionsResponse withAccountingAccountTransactions(io.codat.lending.models.shared.AccountingAccountTransactions accountingAccountTransactions) { + Utils.checkNotNull(accountingAccountTransactions, "accountingAccountTransactions"); + this.accountingAccountTransactions = Optional.ofNullable(accountingAccountTransactions); + return this; + } + + /** + * Success + */ + public ListAccountingAccountTransactionsResponse withAccountingAccountTransactions(Optional accountingAccountTransactions) { + Utils.checkNotNull(accountingAccountTransactions, "accountingAccountTransactions"); + this.accountingAccountTransactions = accountingAccountTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingAccountTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingAccountTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingAccountTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingAccountTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingAccountTransactionsResponse 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; + } + ListAccountingAccountTransactionsResponse other = (ListAccountingAccountTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.accountingAccountTransactions, other.accountingAccountTransactions) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAccountTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingAccountTransactionsResponse.class, + "accountingAccountTransactions", accountingAccountTransactions, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingAccountTransactions = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAccountTransactions(io.codat.lending.models.shared.AccountingAccountTransactions accountingAccountTransactions) { + Utils.checkNotNull(accountingAccountTransactions, "accountingAccountTransactions"); + this.accountingAccountTransactions = Optional.ofNullable(accountingAccountTransactions); + return this; + } + + /** + * Success + */ + public Builder accountingAccountTransactions(Optional accountingAccountTransactions) { + Utils.checkNotNull(accountingAccountTransactions, "accountingAccountTransactions"); + this.accountingAccountTransactions = accountingAccountTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingAccountTransactionsResponse build() { + return new ListAccountingAccountTransactionsResponse( + accountingAccountTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequest.java new file mode 100644 index 00000000..5afafa3a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingAccountsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingAccountsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingAccountsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingAccountsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingAccountsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingAccountsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingAccountsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingAccountsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingAccountsRequest other = (ListAccountingAccountsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingAccountsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingAccountsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingAccountsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequestBuilder.java new file mode 100644 index 00000000..50fa1894 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingAccountsRequestBuilder { + + private ListAccountingAccountsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingAccounts sdk; + + public ListAccountingAccountsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingAccounts sdk) { + this.sdk = sdk; + } + + public ListAccountingAccountsRequestBuilder request(ListAccountingAccountsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingAccountsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsResponse.java new file mode 100644 index 00000000..04cb64ba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingAccountsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingAccountsResponse { + + /** + * Success + */ + private Optional accountingAccounts; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingAccountsResponse( + Optional accountingAccounts, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingAccounts, "accountingAccounts"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingAccounts = accountingAccounts; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingAccounts() { + return accountingAccounts; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingAccountsResponse withAccountingAccounts(io.codat.lending.models.shared.AccountingAccounts accountingAccounts) { + Utils.checkNotNull(accountingAccounts, "accountingAccounts"); + this.accountingAccounts = Optional.ofNullable(accountingAccounts); + return this; + } + + /** + * Success + */ + public ListAccountingAccountsResponse withAccountingAccounts(Optional accountingAccounts) { + Utils.checkNotNull(accountingAccounts, "accountingAccounts"); + this.accountingAccounts = accountingAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingAccountsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingAccountsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingAccountsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingAccountsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingAccountsResponse 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; + } + ListAccountingAccountsResponse other = (ListAccountingAccountsResponse) o; + return + java.util.Objects.deepEquals(this.accountingAccounts, other.accountingAccounts) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingAccountsResponse.class, + "accountingAccounts", accountingAccounts, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingAccounts = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingAccounts(io.codat.lending.models.shared.AccountingAccounts accountingAccounts) { + Utils.checkNotNull(accountingAccounts, "accountingAccounts"); + this.accountingAccounts = Optional.ofNullable(accountingAccounts); + return this; + } + + /** + * Success + */ + public Builder accountingAccounts(Optional accountingAccounts) { + Utils.checkNotNull(accountingAccounts, "accountingAccounts"); + this.accountingAccounts = accountingAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingAccountsResponse build() { + return new ListAccountingAccountsResponse( + accountingAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequest.java new file mode 100644 index 00000000..889a68de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequest.java @@ -0,0 +1,427 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingBankAccountTransactionsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingBankAccountTransactionsRequest( + String accountId, + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.accountId = accountId; + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for an account. + */ + public String accountId() { + return accountId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for an account. + */ + public ListAccountingBankAccountTransactionsRequest withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBankAccountTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingBankAccountTransactionsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBankAccountTransactionsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBankAccountTransactionsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountTransactionsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountTransactionsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountTransactionsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountTransactionsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBankAccountTransactionsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBankAccountTransactionsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingBankAccountTransactionsRequest other = (ListAccountingBankAccountTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBankAccountTransactionsRequest.class, + "accountId", accountId, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String accountId; + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingBankAccountTransactionsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingBankAccountTransactionsRequest( + accountId, + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequestBuilder.java new file mode 100644 index 00000000..bad5f8f0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBankAccountTransactionsRequestBuilder { + + private ListAccountingBankAccountTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBankAccountTransactions sdk; + + public ListAccountingBankAccountTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBankAccountTransactions sdk) { + this.sdk = sdk; + } + + public ListAccountingBankAccountTransactionsRequestBuilder request(ListAccountingBankAccountTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBankAccountTransactionsResponse call() throws Exception { + return sdk.listTransactions( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsResponse.java new file mode 100644 index 00000000..ab522a59 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBankAccountTransactionsResponse { + + /** + * Success + */ + private Optional accountingBankTransactions; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBankAccountTransactionsResponse( + Optional accountingBankTransactions, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBankTransactions, "accountingBankTransactions"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBankTransactions = accountingBankTransactions; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBankTransactions() { + return accountingBankTransactions; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBankAccountTransactionsResponse withAccountingBankTransactions(io.codat.lending.models.shared.AccountingBankTransactions accountingBankTransactions) { + Utils.checkNotNull(accountingBankTransactions, "accountingBankTransactions"); + this.accountingBankTransactions = Optional.ofNullable(accountingBankTransactions); + return this; + } + + /** + * Success + */ + public ListAccountingBankAccountTransactionsResponse withAccountingBankTransactions(Optional accountingBankTransactions) { + Utils.checkNotNull(accountingBankTransactions, "accountingBankTransactions"); + this.accountingBankTransactions = accountingBankTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBankAccountTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBankAccountTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBankAccountTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBankAccountTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBankAccountTransactionsResponse 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; + } + ListAccountingBankAccountTransactionsResponse other = (ListAccountingBankAccountTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.accountingBankTransactions, other.accountingBankTransactions) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBankTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBankAccountTransactionsResponse.class, + "accountingBankTransactions", accountingBankTransactions, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBankTransactions = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBankTransactions(io.codat.lending.models.shared.AccountingBankTransactions accountingBankTransactions) { + Utils.checkNotNull(accountingBankTransactions, "accountingBankTransactions"); + this.accountingBankTransactions = Optional.ofNullable(accountingBankTransactions); + return this; + } + + /** + * Success + */ + public Builder accountingBankTransactions(Optional accountingBankTransactions) { + Utils.checkNotNull(accountingBankTransactions, "accountingBankTransactions"); + this.accountingBankTransactions = accountingBankTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBankAccountTransactionsResponse build() { + return new ListAccountingBankAccountTransactionsResponse( + accountingBankTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequest.java new file mode 100644 index 00000000..59c7d0dd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingBankAccountsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingBankAccountsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBankAccountsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingBankAccountsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBankAccountsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBankAccountsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBankAccountsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBankAccountsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBankAccountsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingBankAccountsRequest other = (ListAccountingBankAccountsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBankAccountsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingBankAccountsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingBankAccountsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequestBuilder.java new file mode 100644 index 00000000..86405487 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBankAccountsRequestBuilder { + + private ListAccountingBankAccountsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBankAccounts sdk; + + public ListAccountingBankAccountsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBankAccounts sdk) { + this.sdk = sdk; + } + + public ListAccountingBankAccountsRequestBuilder request(ListAccountingBankAccountsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBankAccountsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsResponse.java new file mode 100644 index 00000000..a75a5f0f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBankAccountsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBankAccountsResponse { + + /** + * Success + */ + private Optional accountingBankAccounts; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBankAccountsResponse( + Optional accountingBankAccounts, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBankAccounts, "accountingBankAccounts"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBankAccounts = accountingBankAccounts; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBankAccounts() { + return accountingBankAccounts; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBankAccountsResponse withAccountingBankAccounts(io.codat.lending.models.shared.AccountingBankAccounts accountingBankAccounts) { + Utils.checkNotNull(accountingBankAccounts, "accountingBankAccounts"); + this.accountingBankAccounts = Optional.ofNullable(accountingBankAccounts); + return this; + } + + /** + * Success + */ + public ListAccountingBankAccountsResponse withAccountingBankAccounts(Optional accountingBankAccounts) { + Utils.checkNotNull(accountingBankAccounts, "accountingBankAccounts"); + this.accountingBankAccounts = accountingBankAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBankAccountsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBankAccountsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBankAccountsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBankAccountsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBankAccountsResponse 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; + } + ListAccountingBankAccountsResponse other = (ListAccountingBankAccountsResponse) o; + return + java.util.Objects.deepEquals(this.accountingBankAccounts, other.accountingBankAccounts) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBankAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBankAccountsResponse.class, + "accountingBankAccounts", accountingBankAccounts, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBankAccounts = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBankAccounts(io.codat.lending.models.shared.AccountingBankAccounts accountingBankAccounts) { + Utils.checkNotNull(accountingBankAccounts, "accountingBankAccounts"); + this.accountingBankAccounts = Optional.ofNullable(accountingBankAccounts); + return this; + } + + /** + * Success + */ + public Builder accountingBankAccounts(Optional accountingBankAccounts) { + Utils.checkNotNull(accountingBankAccounts, "accountingBankAccounts"); + this.accountingBankAccounts = accountingBankAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBankAccountsResponse build() { + return new ListAccountingBankAccountsResponse( + accountingBankAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequest.java new file mode 100644 index 00000000..f7a8df20 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingBillAttachmentsRequest { + + /** + * Unique identifier for a bill. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=billId") + private String billId; + + /** + * 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; + + public ListAccountingBillAttachmentsRequest( + String billId, + String companyId, + String connectionId) { + Utils.checkNotNull(billId, "billId"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.billId = billId; + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a bill. + */ + public String billId() { + return billId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bill. + */ + public ListAccountingBillAttachmentsRequest withBillId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + return this; + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBillAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingBillAttachmentsRequest 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; + } + ListAccountingBillAttachmentsRequest other = (ListAccountingBillAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.billId, other.billId) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + billId, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillAttachmentsRequest.class, + "billId", billId, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String billId; + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bill. + */ + public Builder billId(String billId) { + Utils.checkNotNull(billId, "billId"); + this.billId = billId; + 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 ListAccountingBillAttachmentsRequest build() { + return new ListAccountingBillAttachmentsRequest( + billId, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequestBuilder.java new file mode 100644 index 00000000..0803b9b8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBillAttachmentsRequestBuilder { + + private ListAccountingBillAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBillAttachments sdk; + + public ListAccountingBillAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBillAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingBillAttachmentsRequestBuilder request(ListAccountingBillAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBillAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsResponse.java new file mode 100644 index 00000000..d7f99b60 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBillAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBillAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBillAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingBillAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBillAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingBillAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingBillAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBillAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBillAttachmentsResponse 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; + } + ListAccountingBillAttachmentsResponse other = (ListAccountingBillAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBillAttachmentsResponse build() { + return new ListAccountingBillAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequest.java new file mode 100644 index 00000000..cfcdf234 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingBillCreditNotesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingBillCreditNotesRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBillCreditNotesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillCreditNotesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillCreditNotesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillCreditNotesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillCreditNotesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillCreditNotesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillCreditNotesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillCreditNotesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillCreditNotesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingBillCreditNotesRequest other = (ListAccountingBillCreditNotesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillCreditNotesRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingBillCreditNotesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingBillCreditNotesRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequestBuilder.java new file mode 100644 index 00000000..686663b3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBillCreditNotesRequestBuilder { + + private ListAccountingBillCreditNotesRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBillCreditNotes sdk; + + public ListAccountingBillCreditNotesRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBillCreditNotes sdk) { + this.sdk = sdk; + } + + public ListAccountingBillCreditNotesRequestBuilder request(ListAccountingBillCreditNotesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBillCreditNotesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesResponse.java new file mode 100644 index 00000000..39e27733 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillCreditNotesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBillCreditNotesResponse { + + /** + * Success + */ + private Optional accountingBillCreditNotes; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBillCreditNotesResponse( + Optional accountingBillCreditNotes, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBillCreditNotes, "accountingBillCreditNotes"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBillCreditNotes = accountingBillCreditNotes; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBillCreditNotes() { + return accountingBillCreditNotes; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBillCreditNotesResponse withAccountingBillCreditNotes(io.codat.lending.models.shared.AccountingBillCreditNotes accountingBillCreditNotes) { + Utils.checkNotNull(accountingBillCreditNotes, "accountingBillCreditNotes"); + this.accountingBillCreditNotes = Optional.ofNullable(accountingBillCreditNotes); + return this; + } + + /** + * Success + */ + public ListAccountingBillCreditNotesResponse withAccountingBillCreditNotes(Optional accountingBillCreditNotes) { + Utils.checkNotNull(accountingBillCreditNotes, "accountingBillCreditNotes"); + this.accountingBillCreditNotes = accountingBillCreditNotes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBillCreditNotesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillCreditNotesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillCreditNotesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBillCreditNotesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBillCreditNotesResponse 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; + } + ListAccountingBillCreditNotesResponse other = (ListAccountingBillCreditNotesResponse) o; + return + java.util.Objects.deepEquals(this.accountingBillCreditNotes, other.accountingBillCreditNotes) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBillCreditNotes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillCreditNotesResponse.class, + "accountingBillCreditNotes", accountingBillCreditNotes, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBillCreditNotes = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBillCreditNotes(io.codat.lending.models.shared.AccountingBillCreditNotes accountingBillCreditNotes) { + Utils.checkNotNull(accountingBillCreditNotes, "accountingBillCreditNotes"); + this.accountingBillCreditNotes = Optional.ofNullable(accountingBillCreditNotes); + return this; + } + + /** + * Success + */ + public Builder accountingBillCreditNotes(Optional accountingBillCreditNotes) { + Utils.checkNotNull(accountingBillCreditNotes, "accountingBillCreditNotes"); + this.accountingBillCreditNotes = accountingBillCreditNotes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBillCreditNotesResponse build() { + return new ListAccountingBillCreditNotesResponse( + accountingBillCreditNotes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequest.java new file mode 100644 index 00000000..7ec65dea --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingBillPaymentsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingBillPaymentsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBillPaymentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillPaymentsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillPaymentsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillPaymentsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillPaymentsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillPaymentsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillPaymentsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillPaymentsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillPaymentsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingBillPaymentsRequest other = (ListAccountingBillPaymentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillPaymentsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingBillPaymentsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingBillPaymentsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequestBuilder.java new file mode 100644 index 00000000..d8732bb7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBillPaymentsRequestBuilder { + + private ListAccountingBillPaymentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBillPayments sdk; + + public ListAccountingBillPaymentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBillPayments sdk) { + this.sdk = sdk; + } + + public ListAccountingBillPaymentsRequestBuilder request(ListAccountingBillPaymentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBillPaymentsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsResponse.java new file mode 100644 index 00000000..2f00b7e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillPaymentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBillPaymentsResponse { + + /** + * Success + */ + private Optional accountingBillPayments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBillPaymentsResponse( + Optional accountingBillPayments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBillPayments, "accountingBillPayments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBillPayments = accountingBillPayments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBillPayments() { + return accountingBillPayments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBillPaymentsResponse withAccountingBillPayments(io.codat.lending.models.shared.AccountingBillPayments accountingBillPayments) { + Utils.checkNotNull(accountingBillPayments, "accountingBillPayments"); + this.accountingBillPayments = Optional.ofNullable(accountingBillPayments); + return this; + } + + /** + * Success + */ + public ListAccountingBillPaymentsResponse withAccountingBillPayments(Optional accountingBillPayments) { + Utils.checkNotNull(accountingBillPayments, "accountingBillPayments"); + this.accountingBillPayments = accountingBillPayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBillPaymentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillPaymentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillPaymentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBillPaymentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBillPaymentsResponse 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; + } + ListAccountingBillPaymentsResponse other = (ListAccountingBillPaymentsResponse) o; + return + java.util.Objects.deepEquals(this.accountingBillPayments, other.accountingBillPayments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBillPayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillPaymentsResponse.class, + "accountingBillPayments", accountingBillPayments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBillPayments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBillPayments(io.codat.lending.models.shared.AccountingBillPayments accountingBillPayments) { + Utils.checkNotNull(accountingBillPayments, "accountingBillPayments"); + this.accountingBillPayments = Optional.ofNullable(accountingBillPayments); + return this; + } + + /** + * Success + */ + public Builder accountingBillPayments(Optional accountingBillPayments) { + Utils.checkNotNull(accountingBillPayments, "accountingBillPayments"); + this.accountingBillPayments = accountingBillPayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBillPaymentsResponse build() { + return new ListAccountingBillPaymentsResponse( + accountingBillPayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequest.java new file mode 100644 index 00000000..39aecb24 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingBillsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingBillsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingBillsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingBillsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingBillsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingBillsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingBillsRequest other = (ListAccountingBillsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingBillsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingBillsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequestBuilder.java new file mode 100644 index 00000000..f7e48bba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingBillsRequestBuilder { + + private ListAccountingBillsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingBills sdk; + + public ListAccountingBillsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingBills sdk) { + this.sdk = sdk; + } + + public ListAccountingBillsRequestBuilder request(ListAccountingBillsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingBillsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsResponse.java new file mode 100644 index 00000000..461c1e1e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingBillsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingBillsResponse { + + /** + * Success + */ + private Optional accountingBills; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingBillsResponse( + Optional accountingBills, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingBills, "accountingBills"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingBills = accountingBills; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingBills() { + return accountingBills; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingBillsResponse withAccountingBills(io.codat.lending.models.shared.AccountingBills accountingBills) { + Utils.checkNotNull(accountingBills, "accountingBills"); + this.accountingBills = Optional.ofNullable(accountingBills); + return this; + } + + /** + * Success + */ + public ListAccountingBillsResponse withAccountingBills(Optional accountingBills) { + Utils.checkNotNull(accountingBills, "accountingBills"); + this.accountingBills = accountingBills; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingBillsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingBillsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingBillsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingBillsResponse 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; + } + ListAccountingBillsResponse other = (ListAccountingBillsResponse) o; + return + java.util.Objects.deepEquals(this.accountingBills, other.accountingBills) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingBills, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingBillsResponse.class, + "accountingBills", accountingBills, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingBills = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingBills(io.codat.lending.models.shared.AccountingBills accountingBills) { + Utils.checkNotNull(accountingBills, "accountingBills"); + this.accountingBills = Optional.ofNullable(accountingBills); + return this; + } + + /** + * Success + */ + public Builder accountingBills(Optional accountingBills) { + Utils.checkNotNull(accountingBills, "accountingBills"); + this.accountingBills = accountingBills; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingBillsResponse build() { + return new ListAccountingBillsResponse( + accountingBills, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequest.java new file mode 100644 index 00000000..0401ebc5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingCreditNotesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingCreditNotesRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingCreditNotesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingCreditNotesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingCreditNotesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCreditNotesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCreditNotesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCreditNotesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCreditNotesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingCreditNotesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingCreditNotesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingCreditNotesRequest other = (ListAccountingCreditNotesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCreditNotesRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingCreditNotesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingCreditNotesRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequestBuilder.java new file mode 100644 index 00000000..aef5e468 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingCreditNotesRequestBuilder { + + private ListAccountingCreditNotesRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingCreditNotes sdk; + + public ListAccountingCreditNotesRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingCreditNotes sdk) { + this.sdk = sdk; + } + + public ListAccountingCreditNotesRequestBuilder request(ListAccountingCreditNotesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingCreditNotesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesResponse.java new file mode 100644 index 00000000..2749201b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCreditNotesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingCreditNotesResponse { + + /** + * Success + */ + private Optional accountingCreditNotes; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingCreditNotesResponse( + Optional accountingCreditNotes, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCreditNotes, "accountingCreditNotes"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCreditNotes = accountingCreditNotes; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCreditNotes() { + return accountingCreditNotes; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingCreditNotesResponse withAccountingCreditNotes(io.codat.lending.models.shared.AccountingCreditNotes accountingCreditNotes) { + Utils.checkNotNull(accountingCreditNotes, "accountingCreditNotes"); + this.accountingCreditNotes = Optional.ofNullable(accountingCreditNotes); + return this; + } + + /** + * Success + */ + public ListAccountingCreditNotesResponse withAccountingCreditNotes(Optional accountingCreditNotes) { + Utils.checkNotNull(accountingCreditNotes, "accountingCreditNotes"); + this.accountingCreditNotes = accountingCreditNotes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingCreditNotesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingCreditNotesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingCreditNotesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingCreditNotesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingCreditNotesResponse 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; + } + ListAccountingCreditNotesResponse other = (ListAccountingCreditNotesResponse) o; + return + java.util.Objects.deepEquals(this.accountingCreditNotes, other.accountingCreditNotes) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCreditNotes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCreditNotesResponse.class, + "accountingCreditNotes", accountingCreditNotes, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCreditNotes = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCreditNotes(io.codat.lending.models.shared.AccountingCreditNotes accountingCreditNotes) { + Utils.checkNotNull(accountingCreditNotes, "accountingCreditNotes"); + this.accountingCreditNotes = Optional.ofNullable(accountingCreditNotes); + return this; + } + + /** + * Success + */ + public Builder accountingCreditNotes(Optional accountingCreditNotes) { + Utils.checkNotNull(accountingCreditNotes, "accountingCreditNotes"); + this.accountingCreditNotes = accountingCreditNotes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingCreditNotesResponse build() { + return new ListAccountingCreditNotesResponse( + accountingCreditNotes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequest.java new file mode 100644 index 00000000..2243ea65 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingCustomerAttachmentsRequest { + + /** + * 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; + + /** + * Unique identifier for a customer. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=customerId") + private String customerId; + + public ListAccountingCustomerAttachmentsRequest( + String companyId, + String connectionId, + String customerId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(customerId, "customerId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.customerId = customerId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a customer. + */ + public String customerId() { + return customerId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingCustomerAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingCustomerAttachmentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public ListAccountingCustomerAttachmentsRequest withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingCustomerAttachmentsRequest other = (ListAccountingCustomerAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.customerId, other.customerId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + customerId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCustomerAttachmentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "customerId", customerId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String customerId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a customer. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + public ListAccountingCustomerAttachmentsRequest build() { + return new ListAccountingCustomerAttachmentsRequest( + companyId, + connectionId, + customerId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequestBuilder.java new file mode 100644 index 00000000..4804796b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingCustomerAttachmentsRequestBuilder { + + private ListAccountingCustomerAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingCustomerAttachments sdk; + + public ListAccountingCustomerAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingCustomerAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingCustomerAttachmentsRequestBuilder request(ListAccountingCustomerAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingCustomerAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsResponse.java new file mode 100644 index 00000000..ce72cc18 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomerAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingCustomerAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingCustomerAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingCustomerAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingCustomerAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingCustomerAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingCustomerAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingCustomerAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingCustomerAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingCustomerAttachmentsResponse 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; + } + ListAccountingCustomerAttachmentsResponse other = (ListAccountingCustomerAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCustomerAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingCustomerAttachmentsResponse build() { + return new ListAccountingCustomerAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequest.java new file mode 100644 index 00000000..5624281c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingCustomersRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingCustomersRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingCustomersRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingCustomersRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingCustomersRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCustomersRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCustomersRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCustomersRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingCustomersRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingCustomersRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingCustomersRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingCustomersRequest other = (ListAccountingCustomersRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCustomersRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingCustomersRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingCustomersRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequestBuilder.java new file mode 100644 index 00000000..df2da52e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingCustomersRequestBuilder { + + private ListAccountingCustomersRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingCustomers sdk; + + public ListAccountingCustomersRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingCustomers sdk) { + this.sdk = sdk; + } + + public ListAccountingCustomersRequestBuilder request(ListAccountingCustomersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingCustomersResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersResponse.java new file mode 100644 index 00000000..35cee9da --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingCustomersResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingCustomersResponse { + + /** + * Success + */ + private Optional accountingCustomers; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingCustomersResponse( + Optional accountingCustomers, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingCustomers, "accountingCustomers"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingCustomers = accountingCustomers; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingCustomers() { + return accountingCustomers; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingCustomersResponse withAccountingCustomers(io.codat.lending.models.shared.AccountingCustomers accountingCustomers) { + Utils.checkNotNull(accountingCustomers, "accountingCustomers"); + this.accountingCustomers = Optional.ofNullable(accountingCustomers); + return this; + } + + /** + * Success + */ + public ListAccountingCustomersResponse withAccountingCustomers(Optional accountingCustomers) { + Utils.checkNotNull(accountingCustomers, "accountingCustomers"); + this.accountingCustomers = accountingCustomers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingCustomersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingCustomersResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingCustomersResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingCustomersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingCustomersResponse 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; + } + ListAccountingCustomersResponse other = (ListAccountingCustomersResponse) o; + return + java.util.Objects.deepEquals(this.accountingCustomers, other.accountingCustomers) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingCustomers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingCustomersResponse.class, + "accountingCustomers", accountingCustomers, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingCustomers = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingCustomers(io.codat.lending.models.shared.AccountingCustomers accountingCustomers) { + Utils.checkNotNull(accountingCustomers, "accountingCustomers"); + this.accountingCustomers = Optional.ofNullable(accountingCustomers); + return this; + } + + /** + * Success + */ + public Builder accountingCustomers(Optional accountingCustomers) { + Utils.checkNotNull(accountingCustomers, "accountingCustomers"); + this.accountingCustomers = accountingCustomers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingCustomersResponse build() { + return new ListAccountingCustomersResponse( + accountingCustomers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequest.java new file mode 100644 index 00000000..d58679fd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingDirectCostAttachmentsRequest { + + /** + * 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; + + /** + * Unique identifier for a direct cost. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directCostId") + private String directCostId; + + public ListAccountingDirectCostAttachmentsRequest( + String companyId, + String connectionId, + String directCostId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directCostId, "directCostId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.directCostId = directCostId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct cost. + */ + public String directCostId() { + return directCostId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingDirectCostAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingDirectCostAttachmentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public ListAccountingDirectCostAttachmentsRequest withDirectCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingDirectCostAttachmentsRequest other = (ListAccountingDirectCostAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directCostId, other.directCostId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + directCostId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectCostAttachmentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "directCostId", directCostId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String directCostId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct cost. + */ + public Builder directCostId(String directCostId) { + Utils.checkNotNull(directCostId, "directCostId"); + this.directCostId = directCostId; + return this; + } + + public ListAccountingDirectCostAttachmentsRequest build() { + return new ListAccountingDirectCostAttachmentsRequest( + companyId, + connectionId, + directCostId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequestBuilder.java new file mode 100644 index 00000000..de2c4ccf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingDirectCostAttachmentsRequestBuilder { + + private ListAccountingDirectCostAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingDirectCostAttachments sdk; + + public ListAccountingDirectCostAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingDirectCostAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingDirectCostAttachmentsRequestBuilder request(ListAccountingDirectCostAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingDirectCostAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsResponse.java new file mode 100644 index 00000000..0b99f82c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingDirectCostAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingDirectCostAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingDirectCostAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingDirectCostAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingDirectCostAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingDirectCostAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingDirectCostAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingDirectCostAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingDirectCostAttachmentsResponse 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; + } + ListAccountingDirectCostAttachmentsResponse other = (ListAccountingDirectCostAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectCostAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingDirectCostAttachmentsResponse build() { + return new ListAccountingDirectCostAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequest.java new file mode 100644 index 00000000..8183de13 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingDirectCostsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingDirectCostsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingDirectCostsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingDirectCostsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingDirectCostsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingDirectCostsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectCostsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectCostsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectCostsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectCostsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingDirectCostsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingDirectCostsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingDirectCostsRequest other = (ListAccountingDirectCostsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectCostsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingDirectCostsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingDirectCostsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequestBuilder.java new file mode 100644 index 00000000..d29b9513 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingDirectCostsRequestBuilder { + + private ListAccountingDirectCostsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingDirectCosts sdk; + + public ListAccountingDirectCostsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingDirectCosts sdk) { + this.sdk = sdk; + } + + public ListAccountingDirectCostsRequestBuilder request(ListAccountingDirectCostsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingDirectCostsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsResponse.java new file mode 100644 index 00000000..9db5433c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectCostsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingDirectCostsResponse { + + /** + * Success + */ + private Optional accountingDirectCosts; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingDirectCostsResponse( + Optional accountingDirectCosts, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingDirectCosts, "accountingDirectCosts"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingDirectCosts = accountingDirectCosts; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingDirectCosts() { + return accountingDirectCosts; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingDirectCostsResponse withAccountingDirectCosts(io.codat.lending.models.shared.AccountingDirectCosts accountingDirectCosts) { + Utils.checkNotNull(accountingDirectCosts, "accountingDirectCosts"); + this.accountingDirectCosts = Optional.ofNullable(accountingDirectCosts); + return this; + } + + /** + * Success + */ + public ListAccountingDirectCostsResponse withAccountingDirectCosts(Optional accountingDirectCosts) { + Utils.checkNotNull(accountingDirectCosts, "accountingDirectCosts"); + this.accountingDirectCosts = accountingDirectCosts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingDirectCostsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingDirectCostsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingDirectCostsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingDirectCostsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingDirectCostsResponse 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; + } + ListAccountingDirectCostsResponse other = (ListAccountingDirectCostsResponse) o; + return + java.util.Objects.deepEquals(this.accountingDirectCosts, other.accountingDirectCosts) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingDirectCosts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectCostsResponse.class, + "accountingDirectCosts", accountingDirectCosts, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingDirectCosts = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingDirectCosts(io.codat.lending.models.shared.AccountingDirectCosts accountingDirectCosts) { + Utils.checkNotNull(accountingDirectCosts, "accountingDirectCosts"); + this.accountingDirectCosts = Optional.ofNullable(accountingDirectCosts); + return this; + } + + /** + * Success + */ + public Builder accountingDirectCosts(Optional accountingDirectCosts) { + Utils.checkNotNull(accountingDirectCosts, "accountingDirectCosts"); + this.accountingDirectCosts = accountingDirectCosts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingDirectCostsResponse build() { + return new ListAccountingDirectCostsResponse( + accountingDirectCosts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequest.java new file mode 100644 index 00000000..29dbaa74 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingDirectIncomeAttachmentsRequest { + + /** + * 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; + + /** + * Unique identifier for a direct income. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=directIncomeId") + private String directIncomeId; + + public ListAccountingDirectIncomeAttachmentsRequest( + String companyId, + String connectionId, + String directIncomeId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.directIncomeId = directIncomeId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a direct income. + */ + public String directIncomeId() { + return directIncomeId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingDirectIncomeAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingDirectIncomeAttachmentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public ListAccountingDirectIncomeAttachmentsRequest withDirectIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingDirectIncomeAttachmentsRequest other = (ListAccountingDirectIncomeAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.directIncomeId, other.directIncomeId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + directIncomeId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectIncomeAttachmentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "directIncomeId", directIncomeId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String directIncomeId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a direct income. + */ + public Builder directIncomeId(String directIncomeId) { + Utils.checkNotNull(directIncomeId, "directIncomeId"); + this.directIncomeId = directIncomeId; + return this; + } + + public ListAccountingDirectIncomeAttachmentsRequest build() { + return new ListAccountingDirectIncomeAttachmentsRequest( + companyId, + connectionId, + directIncomeId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequestBuilder.java new file mode 100644 index 00000000..a7a365cd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingDirectIncomeAttachmentsRequestBuilder { + + private ListAccountingDirectIncomeAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingDirectIncomeAttachments sdk; + + public ListAccountingDirectIncomeAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingDirectIncomeAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingDirectIncomeAttachmentsRequestBuilder request(ListAccountingDirectIncomeAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingDirectIncomeAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsResponse.java new file mode 100644 index 00000000..0e30a4a2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomeAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingDirectIncomeAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingDirectIncomeAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingDirectIncomeAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingDirectIncomeAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingDirectIncomeAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingDirectIncomeAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingDirectIncomeAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingDirectIncomeAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingDirectIncomeAttachmentsResponse 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; + } + ListAccountingDirectIncomeAttachmentsResponse other = (ListAccountingDirectIncomeAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectIncomeAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingDirectIncomeAttachmentsResponse build() { + return new ListAccountingDirectIncomeAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequest.java new file mode 100644 index 00000000..1aaf2615 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingDirectIncomesRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingDirectIncomesRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingDirectIncomesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingDirectIncomesRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingDirectIncomesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingDirectIncomesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectIncomesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectIncomesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectIncomesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingDirectIncomesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingDirectIncomesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingDirectIncomesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingDirectIncomesRequest other = (ListAccountingDirectIncomesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectIncomesRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingDirectIncomesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingDirectIncomesRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequestBuilder.java new file mode 100644 index 00000000..97595ce8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingDirectIncomesRequestBuilder { + + private ListAccountingDirectIncomesRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingDirectIncomes sdk; + + public ListAccountingDirectIncomesRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingDirectIncomes sdk) { + this.sdk = sdk; + } + + public ListAccountingDirectIncomesRequestBuilder request(ListAccountingDirectIncomesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingDirectIncomesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesResponse.java new file mode 100644 index 00000000..f6bfd4cb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingDirectIncomesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingDirectIncomesResponse { + + /** + * Success + */ + private Optional accountingDirectIncomes; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingDirectIncomesResponse( + Optional accountingDirectIncomes, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingDirectIncomes, "accountingDirectIncomes"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingDirectIncomes = accountingDirectIncomes; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingDirectIncomes() { + return accountingDirectIncomes; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingDirectIncomesResponse withAccountingDirectIncomes(io.codat.lending.models.shared.AccountingDirectIncomes accountingDirectIncomes) { + Utils.checkNotNull(accountingDirectIncomes, "accountingDirectIncomes"); + this.accountingDirectIncomes = Optional.ofNullable(accountingDirectIncomes); + return this; + } + + /** + * Success + */ + public ListAccountingDirectIncomesResponse withAccountingDirectIncomes(Optional accountingDirectIncomes) { + Utils.checkNotNull(accountingDirectIncomes, "accountingDirectIncomes"); + this.accountingDirectIncomes = accountingDirectIncomes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingDirectIncomesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingDirectIncomesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingDirectIncomesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingDirectIncomesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingDirectIncomesResponse 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; + } + ListAccountingDirectIncomesResponse other = (ListAccountingDirectIncomesResponse) o; + return + java.util.Objects.deepEquals(this.accountingDirectIncomes, other.accountingDirectIncomes) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingDirectIncomes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingDirectIncomesResponse.class, + "accountingDirectIncomes", accountingDirectIncomes, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingDirectIncomes = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingDirectIncomes(io.codat.lending.models.shared.AccountingDirectIncomes accountingDirectIncomes) { + Utils.checkNotNull(accountingDirectIncomes, "accountingDirectIncomes"); + this.accountingDirectIncomes = Optional.ofNullable(accountingDirectIncomes); + return this; + } + + /** + * Success + */ + public Builder accountingDirectIncomes(Optional accountingDirectIncomes) { + Utils.checkNotNull(accountingDirectIncomes, "accountingDirectIncomes"); + this.accountingDirectIncomes = accountingDirectIncomes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingDirectIncomesResponse build() { + return new ListAccountingDirectIncomesResponse( + accountingDirectIncomes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequest.java new file mode 100644 index 00000000..608180b6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingInvoiceAttachmentsRequest { + + /** + * 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; + + /** + * Unique identifier for an invoice. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=invoiceId") + private String invoiceId; + + public ListAccountingInvoiceAttachmentsRequest( + String companyId, + String connectionId, + String invoiceId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(invoiceId, "invoiceId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.invoiceId = invoiceId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for an invoice. + */ + public String invoiceId() { + return invoiceId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingInvoiceAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingInvoiceAttachmentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public ListAccountingInvoiceAttachmentsRequest withInvoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingInvoiceAttachmentsRequest other = (ListAccountingInvoiceAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.invoiceId, other.invoiceId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + invoiceId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingInvoiceAttachmentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "invoiceId", invoiceId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String invoiceId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for an invoice. + */ + public Builder invoiceId(String invoiceId) { + Utils.checkNotNull(invoiceId, "invoiceId"); + this.invoiceId = invoiceId; + return this; + } + + public ListAccountingInvoiceAttachmentsRequest build() { + return new ListAccountingInvoiceAttachmentsRequest( + companyId, + connectionId, + invoiceId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequestBuilder.java new file mode 100644 index 00000000..b059ec01 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingInvoiceAttachmentsRequestBuilder { + + private ListAccountingInvoiceAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingInvoiceAttachments sdk; + + public ListAccountingInvoiceAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingInvoiceAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingInvoiceAttachmentsRequestBuilder request(ListAccountingInvoiceAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingInvoiceAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsResponse.java new file mode 100644 index 00000000..b23bb2ee --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoiceAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingInvoiceAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingInvoiceAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingInvoiceAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingInvoiceAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingInvoiceAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingInvoiceAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingInvoiceAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingInvoiceAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingInvoiceAttachmentsResponse 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; + } + ListAccountingInvoiceAttachmentsResponse other = (ListAccountingInvoiceAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingInvoiceAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingInvoiceAttachmentsResponse build() { + return new ListAccountingInvoiceAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequest.java new file mode 100644 index 00000000..34f2267a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingInvoicesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingInvoicesRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingInvoicesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingInvoicesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingInvoicesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingInvoicesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingInvoicesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingInvoicesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingInvoicesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingInvoicesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingInvoicesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingInvoicesRequest other = (ListAccountingInvoicesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingInvoicesRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingInvoicesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingInvoicesRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequestBuilder.java new file mode 100644 index 00000000..94c11437 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingInvoicesRequestBuilder { + + private ListAccountingInvoicesRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingInvoices sdk; + + public ListAccountingInvoicesRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingInvoices sdk) { + this.sdk = sdk; + } + + public ListAccountingInvoicesRequestBuilder request(ListAccountingInvoicesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingInvoicesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesResponse.java new file mode 100644 index 00000000..78b1d6d4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingInvoicesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingInvoicesResponse { + + /** + * Success + */ + private Optional accountingInvoices; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingInvoicesResponse( + Optional accountingInvoices, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingInvoices, "accountingInvoices"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingInvoices = accountingInvoices; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingInvoices() { + return accountingInvoices; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingInvoicesResponse withAccountingInvoices(io.codat.lending.models.shared.AccountingInvoices accountingInvoices) { + Utils.checkNotNull(accountingInvoices, "accountingInvoices"); + this.accountingInvoices = Optional.ofNullable(accountingInvoices); + return this; + } + + /** + * Success + */ + public ListAccountingInvoicesResponse withAccountingInvoices(Optional accountingInvoices) { + Utils.checkNotNull(accountingInvoices, "accountingInvoices"); + this.accountingInvoices = accountingInvoices; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingInvoicesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingInvoicesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingInvoicesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingInvoicesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingInvoicesResponse 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; + } + ListAccountingInvoicesResponse other = (ListAccountingInvoicesResponse) o; + return + java.util.Objects.deepEquals(this.accountingInvoices, other.accountingInvoices) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingInvoices, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingInvoicesResponse.class, + "accountingInvoices", accountingInvoices, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingInvoices = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingInvoices(io.codat.lending.models.shared.AccountingInvoices accountingInvoices) { + Utils.checkNotNull(accountingInvoices, "accountingInvoices"); + this.accountingInvoices = Optional.ofNullable(accountingInvoices); + return this; + } + + /** + * Success + */ + public Builder accountingInvoices(Optional accountingInvoices) { + Utils.checkNotNull(accountingInvoices, "accountingInvoices"); + this.accountingInvoices = accountingInvoices; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingInvoicesResponse build() { + return new ListAccountingInvoicesResponse( + accountingInvoices, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequest.java new file mode 100644 index 00000000..90baf0b9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingJournalEntriesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingJournalEntriesRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingJournalEntriesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingJournalEntriesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingJournalEntriesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalEntriesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalEntriesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalEntriesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalEntriesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingJournalEntriesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingJournalEntriesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingJournalEntriesRequest other = (ListAccountingJournalEntriesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingJournalEntriesRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingJournalEntriesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingJournalEntriesRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequestBuilder.java new file mode 100644 index 00000000..b7886b25 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingJournalEntriesRequestBuilder { + + private ListAccountingJournalEntriesRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingJournalEntries sdk; + + public ListAccountingJournalEntriesRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingJournalEntries sdk) { + this.sdk = sdk; + } + + public ListAccountingJournalEntriesRequestBuilder request(ListAccountingJournalEntriesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingJournalEntriesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesResponse.java new file mode 100644 index 00000000..b3a271b0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalEntriesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingJournalEntriesResponse { + + /** + * Success + */ + private Optional accountingJournalEntries; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingJournalEntriesResponse( + Optional accountingJournalEntries, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingJournalEntries, "accountingJournalEntries"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingJournalEntries = accountingJournalEntries; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingJournalEntries() { + return accountingJournalEntries; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingJournalEntriesResponse withAccountingJournalEntries(io.codat.lending.models.shared.AccountingJournalEntries accountingJournalEntries) { + Utils.checkNotNull(accountingJournalEntries, "accountingJournalEntries"); + this.accountingJournalEntries = Optional.ofNullable(accountingJournalEntries); + return this; + } + + /** + * Success + */ + public ListAccountingJournalEntriesResponse withAccountingJournalEntries(Optional accountingJournalEntries) { + Utils.checkNotNull(accountingJournalEntries, "accountingJournalEntries"); + this.accountingJournalEntries = accountingJournalEntries; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingJournalEntriesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingJournalEntriesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingJournalEntriesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingJournalEntriesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingJournalEntriesResponse 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; + } + ListAccountingJournalEntriesResponse other = (ListAccountingJournalEntriesResponse) o; + return + java.util.Objects.deepEquals(this.accountingJournalEntries, other.accountingJournalEntries) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingJournalEntries, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingJournalEntriesResponse.class, + "accountingJournalEntries", accountingJournalEntries, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingJournalEntries = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingJournalEntries(io.codat.lending.models.shared.AccountingJournalEntries accountingJournalEntries) { + Utils.checkNotNull(accountingJournalEntries, "accountingJournalEntries"); + this.accountingJournalEntries = Optional.ofNullable(accountingJournalEntries); + return this; + } + + /** + * Success + */ + public Builder accountingJournalEntries(Optional accountingJournalEntries) { + Utils.checkNotNull(accountingJournalEntries, "accountingJournalEntries"); + this.accountingJournalEntries = accountingJournalEntries; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingJournalEntriesResponse build() { + return new ListAccountingJournalEntriesResponse( + accountingJournalEntries, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequest.java new file mode 100644 index 00000000..1a0d71e5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingJournalsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingJournalsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingJournalsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingJournalsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingJournalsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingJournalsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingJournalsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingJournalsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingJournalsRequest other = (ListAccountingJournalsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingJournalsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingJournalsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingJournalsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequestBuilder.java new file mode 100644 index 00000000..5939b39b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingJournalsRequestBuilder { + + private ListAccountingJournalsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingJournals sdk; + + public ListAccountingJournalsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingJournals sdk) { + this.sdk = sdk; + } + + public ListAccountingJournalsRequestBuilder request(ListAccountingJournalsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingJournalsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsResponse.java new file mode 100644 index 00000000..25e00469 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingJournalsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingJournalsResponse { + + /** + * Success + */ + private Optional accountingJournals; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingJournalsResponse( + Optional accountingJournals, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingJournals, "accountingJournals"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingJournals = accountingJournals; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingJournals() { + return accountingJournals; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingJournalsResponse withAccountingJournals(io.codat.lending.models.shared.AccountingJournals accountingJournals) { + Utils.checkNotNull(accountingJournals, "accountingJournals"); + this.accountingJournals = Optional.ofNullable(accountingJournals); + return this; + } + + /** + * Success + */ + public ListAccountingJournalsResponse withAccountingJournals(Optional accountingJournals) { + Utils.checkNotNull(accountingJournals, "accountingJournals"); + this.accountingJournals = accountingJournals; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingJournalsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingJournalsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingJournalsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingJournalsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingJournalsResponse 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; + } + ListAccountingJournalsResponse other = (ListAccountingJournalsResponse) o; + return + java.util.Objects.deepEquals(this.accountingJournals, other.accountingJournals) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingJournals, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingJournalsResponse.class, + "accountingJournals", accountingJournals, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingJournals = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingJournals(io.codat.lending.models.shared.AccountingJournals accountingJournals) { + Utils.checkNotNull(accountingJournals, "accountingJournals"); + this.accountingJournals = Optional.ofNullable(accountingJournals); + return this; + } + + /** + * Success + */ + public Builder accountingJournals(Optional accountingJournals) { + Utils.checkNotNull(accountingJournals, "accountingJournals"); + this.accountingJournals = accountingJournals; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingJournalsResponse build() { + return new ListAccountingJournalsResponse( + accountingJournals, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequest.java new file mode 100644 index 00000000..d6446d0f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingPaymentsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingPaymentsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingPaymentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingPaymentsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingPaymentsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingPaymentsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingPaymentsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingPaymentsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingPaymentsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingPaymentsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingPaymentsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingPaymentsRequest other = (ListAccountingPaymentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingPaymentsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingPaymentsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingPaymentsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequestBuilder.java new file mode 100644 index 00000000..2d2f49c9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingPaymentsRequestBuilder { + + private ListAccountingPaymentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingPayments sdk; + + public ListAccountingPaymentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingPayments sdk) { + this.sdk = sdk; + } + + public ListAccountingPaymentsRequestBuilder request(ListAccountingPaymentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingPaymentsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsResponse.java new file mode 100644 index 00000000..0cb280ed --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingPaymentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingPaymentsResponse { + + /** + * Success + */ + private Optional accountingPayments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingPaymentsResponse( + Optional accountingPayments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingPayments, "accountingPayments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingPayments = accountingPayments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingPayments() { + return accountingPayments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingPaymentsResponse withAccountingPayments(io.codat.lending.models.shared.AccountingPayments accountingPayments) { + Utils.checkNotNull(accountingPayments, "accountingPayments"); + this.accountingPayments = Optional.ofNullable(accountingPayments); + return this; + } + + /** + * Success + */ + public ListAccountingPaymentsResponse withAccountingPayments(Optional accountingPayments) { + Utils.checkNotNull(accountingPayments, "accountingPayments"); + this.accountingPayments = accountingPayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingPaymentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingPaymentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingPaymentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingPaymentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingPaymentsResponse 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; + } + ListAccountingPaymentsResponse other = (ListAccountingPaymentsResponse) o; + return + java.util.Objects.deepEquals(this.accountingPayments, other.accountingPayments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingPayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingPaymentsResponse.class, + "accountingPayments", accountingPayments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingPayments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingPayments(io.codat.lending.models.shared.AccountingPayments accountingPayments) { + Utils.checkNotNull(accountingPayments, "accountingPayments"); + this.accountingPayments = Optional.ofNullable(accountingPayments); + return this; + } + + /** + * Success + */ + public Builder accountingPayments(Optional accountingPayments) { + Utils.checkNotNull(accountingPayments, "accountingPayments"); + this.accountingPayments = accountingPayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingPaymentsResponse build() { + return new ListAccountingPaymentsResponse( + accountingPayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequest.java new file mode 100644 index 00000000..f019e97e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequest.java @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListAccountingSupplierAttachmentsRequest { + + /** + * 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; + + /** + * Unique identifier for a supplier. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=supplierId") + private String supplierId; + + public ListAccountingSupplierAttachmentsRequest( + String companyId, + String connectionId, + String supplierId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(supplierId, "supplierId"); + this.companyId = companyId; + this.connectionId = connectionId; + this.supplierId = supplierId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Unique identifier for a supplier. + */ + public String supplierId() { + return supplierId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingSupplierAttachmentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingSupplierAttachmentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a supplier. + */ + public ListAccountingSupplierAttachmentsRequest withSupplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingSupplierAttachmentsRequest other = (ListAccountingSupplierAttachmentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.supplierId, other.supplierId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + supplierId); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingSupplierAttachmentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "supplierId", supplierId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private String supplierId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Unique identifier for a supplier. + */ + public Builder supplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + public ListAccountingSupplierAttachmentsRequest build() { + return new ListAccountingSupplierAttachmentsRequest( + companyId, + connectionId, + supplierId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequestBuilder.java new file mode 100644 index 00000000..9cced447 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingSupplierAttachmentsRequestBuilder { + + private ListAccountingSupplierAttachmentsRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingSupplierAttachments sdk; + + public ListAccountingSupplierAttachmentsRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingSupplierAttachments sdk) { + this.sdk = sdk; + } + + public ListAccountingSupplierAttachmentsRequestBuilder request(ListAccountingSupplierAttachmentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingSupplierAttachmentsResponse call() throws Exception { + return sdk.listAttachments( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsResponse.java new file mode 100644 index 00000000..8e312517 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSupplierAttachmentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingSupplierAttachmentsResponse { + + /** + * Success + */ + private Optional attachments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingSupplierAttachmentsResponse( + Optional attachments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(attachments, "attachments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.attachments = attachments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional attachments() { + return attachments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingSupplierAttachmentsResponse withAttachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public ListAccountingSupplierAttachmentsResponse withAttachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingSupplierAttachmentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingSupplierAttachmentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListAccountingSupplierAttachmentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingSupplierAttachmentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingSupplierAttachmentsResponse 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; + } + ListAccountingSupplierAttachmentsResponse other = (ListAccountingSupplierAttachmentsResponse) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingSupplierAttachmentsResponse.class, + "attachments", attachments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional attachments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder attachments(io.codat.lending.models.shared.Attachments attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + * Success + */ + public Builder attachments(Optional attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingSupplierAttachmentsResponse build() { + return new ListAccountingSupplierAttachmentsResponse( + attachments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequest.java new file mode 100644 index 00000000..ef34549e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingSuppliersRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingSuppliersRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingSuppliersRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingSuppliersRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingSuppliersRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingSuppliersRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingSuppliersRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingSuppliersRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingSuppliersRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingSuppliersRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingSuppliersRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingSuppliersRequest other = (ListAccountingSuppliersRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingSuppliersRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingSuppliersRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingSuppliersRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequestBuilder.java new file mode 100644 index 00000000..c70e32a1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingSuppliersRequestBuilder { + + private ListAccountingSuppliersRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingSuppliers sdk; + + public ListAccountingSuppliersRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingSuppliers sdk) { + this.sdk = sdk; + } + + public ListAccountingSuppliersRequestBuilder request(ListAccountingSuppliersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingSuppliersResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersResponse.java new file mode 100644 index 00000000..fadc74bf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingSuppliersResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingSuppliersResponse { + + /** + * Success + */ + private Optional accountingSuppliers; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingSuppliersResponse( + Optional accountingSuppliers, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingSuppliers, "accountingSuppliers"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingSuppliers = accountingSuppliers; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingSuppliers() { + return accountingSuppliers; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingSuppliersResponse withAccountingSuppliers(io.codat.lending.models.shared.AccountingSuppliers accountingSuppliers) { + Utils.checkNotNull(accountingSuppliers, "accountingSuppliers"); + this.accountingSuppliers = Optional.ofNullable(accountingSuppliers); + return this; + } + + /** + * Success + */ + public ListAccountingSuppliersResponse withAccountingSuppliers(Optional accountingSuppliers) { + Utils.checkNotNull(accountingSuppliers, "accountingSuppliers"); + this.accountingSuppliers = accountingSuppliers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingSuppliersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingSuppliersResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingSuppliersResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingSuppliersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingSuppliersResponse 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; + } + ListAccountingSuppliersResponse other = (ListAccountingSuppliersResponse) o; + return + java.util.Objects.deepEquals(this.accountingSuppliers, other.accountingSuppliers) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingSuppliers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingSuppliersResponse.class, + "accountingSuppliers", accountingSuppliers, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingSuppliers = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingSuppliers(io.codat.lending.models.shared.AccountingSuppliers accountingSuppliers) { + Utils.checkNotNull(accountingSuppliers, "accountingSuppliers"); + this.accountingSuppliers = Optional.ofNullable(accountingSuppliers); + return this; + } + + /** + * Success + */ + public Builder accountingSuppliers(Optional accountingSuppliers) { + Utils.checkNotNull(accountingSuppliers, "accountingSuppliers"); + this.accountingSuppliers = accountingSuppliers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingSuppliersResponse build() { + return new ListAccountingSuppliersResponse( + accountingSuppliers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequest.java new file mode 100644 index 00000000..7ccf733d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListAccountingTransfersRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListAccountingTransfersRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListAccountingTransfersRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListAccountingTransfersRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingTransfersRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListAccountingTransfersRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingTransfersRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingTransfersRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingTransfersRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListAccountingTransfersRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingTransfersRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListAccountingTransfersRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAccountingTransfersRequest other = (ListAccountingTransfersRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingTransfersRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListAccountingTransfersRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListAccountingTransfersRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequestBuilder.java new file mode 100644 index 00000000..8ed1e518 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListAccountingTransfersRequestBuilder { + + private ListAccountingTransfersRequest request; + + private final SDKMethodInterfaces.MethodCallListAccountingTransfers sdk; + + public ListAccountingTransfersRequestBuilder(SDKMethodInterfaces.MethodCallListAccountingTransfers sdk) { + this.sdk = sdk; + } + + public ListAccountingTransfersRequestBuilder request(ListAccountingTransfersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListAccountingTransfersResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersResponse.java new file mode 100644 index 00000000..b3370139 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListAccountingTransfersResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListAccountingTransfersResponse { + + /** + * Success + */ + private Optional accountingTransfers; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListAccountingTransfersResponse( + Optional accountingTransfers, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(accountingTransfers, "accountingTransfers"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.accountingTransfers = accountingTransfers; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional accountingTransfers() { + return accountingTransfers; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListAccountingTransfersResponse withAccountingTransfers(io.codat.lending.models.shared.AccountingTransfers accountingTransfers) { + Utils.checkNotNull(accountingTransfers, "accountingTransfers"); + this.accountingTransfers = Optional.ofNullable(accountingTransfers); + return this; + } + + /** + * Success + */ + public ListAccountingTransfersResponse withAccountingTransfers(Optional accountingTransfers) { + Utils.checkNotNull(accountingTransfers, "accountingTransfers"); + this.accountingTransfers = accountingTransfers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListAccountingTransfersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingTransfersResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListAccountingTransfersResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListAccountingTransfersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListAccountingTransfersResponse 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; + } + ListAccountingTransfersResponse other = (ListAccountingTransfersResponse) o; + return + java.util.Objects.deepEquals(this.accountingTransfers, other.accountingTransfers) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingTransfers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListAccountingTransfersResponse.class, + "accountingTransfers", accountingTransfers, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional accountingTransfers = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder accountingTransfers(io.codat.lending.models.shared.AccountingTransfers accountingTransfers) { + Utils.checkNotNull(accountingTransfers, "accountingTransfers"); + this.accountingTransfers = Optional.ofNullable(accountingTransfers); + return this; + } + + /** + * Success + */ + public Builder accountingTransfers(Optional accountingTransfers) { + Utils.checkNotNull(accountingTransfers, "accountingTransfers"); + this.accountingTransfers = accountingTransfers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListAccountingTransfersResponse build() { + return new ListAccountingTransfersResponse( + accountingTransfers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequest.java new file mode 100644 index 00000000..28679ccc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListBankingAccountBalancesRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListBankingAccountBalancesRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListBankingAccountBalancesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListBankingAccountBalancesRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingAccountBalancesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingAccountBalancesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountBalancesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountBalancesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountBalancesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountBalancesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingAccountBalancesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingAccountBalancesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListBankingAccountBalancesRequest other = (ListBankingAccountBalancesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListBankingAccountBalancesRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListBankingAccountBalancesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListBankingAccountBalancesRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequestBuilder.java new file mode 100644 index 00000000..b9a5989d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListBankingAccountBalancesRequestBuilder { + + private ListBankingAccountBalancesRequest request; + + private final SDKMethodInterfaces.MethodCallListBankingAccountBalances sdk; + + public ListBankingAccountBalancesRequestBuilder(SDKMethodInterfaces.MethodCallListBankingAccountBalances sdk) { + this.sdk = sdk; + } + + public ListBankingAccountBalancesRequestBuilder request(ListBankingAccountBalancesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListBankingAccountBalancesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesResponse.java new file mode 100644 index 00000000..7007500a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountBalancesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListBankingAccountBalancesResponse { + + /** + * Success + */ + private Optional bankingAccountBalances; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListBankingAccountBalancesResponse( + Optional bankingAccountBalances, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingAccountBalances, "bankingAccountBalances"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingAccountBalances = bankingAccountBalances; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional bankingAccountBalances() { + return bankingAccountBalances; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListBankingAccountBalancesResponse withBankingAccountBalances(io.codat.lending.models.shared.BankingAccountBalances bankingAccountBalances) { + Utils.checkNotNull(bankingAccountBalances, "bankingAccountBalances"); + this.bankingAccountBalances = Optional.ofNullable(bankingAccountBalances); + return this; + } + + /** + * Success + */ + public ListBankingAccountBalancesResponse withBankingAccountBalances(Optional bankingAccountBalances) { + Utils.checkNotNull(bankingAccountBalances, "bankingAccountBalances"); + this.bankingAccountBalances = bankingAccountBalances; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListBankingAccountBalancesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingAccountBalancesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingAccountBalancesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListBankingAccountBalancesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListBankingAccountBalancesResponse 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; + } + ListBankingAccountBalancesResponse other = (ListBankingAccountBalancesResponse) o; + return + java.util.Objects.deepEquals(this.bankingAccountBalances, other.bankingAccountBalances) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingAccountBalances, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListBankingAccountBalancesResponse.class, + "bankingAccountBalances", bankingAccountBalances, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional bankingAccountBalances = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingAccountBalances(io.codat.lending.models.shared.BankingAccountBalances bankingAccountBalances) { + Utils.checkNotNull(bankingAccountBalances, "bankingAccountBalances"); + this.bankingAccountBalances = Optional.ofNullable(bankingAccountBalances); + return this; + } + + /** + * Success + */ + public Builder bankingAccountBalances(Optional bankingAccountBalances) { + Utils.checkNotNull(bankingAccountBalances, "bankingAccountBalances"); + this.bankingAccountBalances = bankingAccountBalances; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListBankingAccountBalancesResponse build() { + return new ListBankingAccountBalancesResponse( + bankingAccountBalances, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequest.java new file mode 100644 index 00000000..8b93886f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListBankingAccountsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListBankingAccountsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListBankingAccountsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListBankingAccountsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingAccountsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingAccountsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingAccountsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingAccountsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingAccountsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListBankingAccountsRequest other = (ListBankingAccountsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListBankingAccountsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListBankingAccountsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListBankingAccountsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequestBuilder.java new file mode 100644 index 00000000..37250b64 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListBankingAccountsRequestBuilder { + + private ListBankingAccountsRequest request; + + private final SDKMethodInterfaces.MethodCallListBankingAccounts sdk; + + public ListBankingAccountsRequestBuilder(SDKMethodInterfaces.MethodCallListBankingAccounts sdk) { + this.sdk = sdk; + } + + public ListBankingAccountsRequestBuilder request(ListBankingAccountsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListBankingAccountsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsResponse.java new file mode 100644 index 00000000..d30a4d06 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingAccountsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListBankingAccountsResponse { + + /** + * Success + */ + private Optional bankingAccounts; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListBankingAccountsResponse( + Optional bankingAccounts, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingAccounts, "bankingAccounts"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingAccounts = bankingAccounts; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional bankingAccounts() { + return bankingAccounts; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListBankingAccountsResponse withBankingAccounts(io.codat.lending.models.shared.BankingAccounts bankingAccounts) { + Utils.checkNotNull(bankingAccounts, "bankingAccounts"); + this.bankingAccounts = Optional.ofNullable(bankingAccounts); + return this; + } + + /** + * Success + */ + public ListBankingAccountsResponse withBankingAccounts(Optional bankingAccounts) { + Utils.checkNotNull(bankingAccounts, "bankingAccounts"); + this.bankingAccounts = bankingAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListBankingAccountsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingAccountsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingAccountsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListBankingAccountsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListBankingAccountsResponse 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; + } + ListBankingAccountsResponse other = (ListBankingAccountsResponse) o; + return + java.util.Objects.deepEquals(this.bankingAccounts, other.bankingAccounts) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListBankingAccountsResponse.class, + "bankingAccounts", bankingAccounts, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional bankingAccounts = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingAccounts(io.codat.lending.models.shared.BankingAccounts bankingAccounts) { + Utils.checkNotNull(bankingAccounts, "bankingAccounts"); + this.bankingAccounts = Optional.ofNullable(bankingAccounts); + return this; + } + + /** + * Success + */ + public Builder bankingAccounts(Optional bankingAccounts) { + Utils.checkNotNull(bankingAccounts, "bankingAccounts"); + this.bankingAccounts = bankingAccounts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListBankingAccountsResponse build() { + return new ListBankingAccountsResponse( + bankingAccounts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequest.java new file mode 100644 index 00000000..53005c4a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListBankingTransactionCategoriesRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListBankingTransactionCategoriesRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListBankingTransactionCategoriesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListBankingTransactionCategoriesRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingTransactionCategoriesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingTransactionCategoriesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionCategoriesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionCategoriesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionCategoriesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionCategoriesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingTransactionCategoriesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingTransactionCategoriesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListBankingTransactionCategoriesRequest other = (ListBankingTransactionCategoriesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListBankingTransactionCategoriesRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListBankingTransactionCategoriesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListBankingTransactionCategoriesRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequestBuilder.java new file mode 100644 index 00000000..4da1d058 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListBankingTransactionCategoriesRequestBuilder { + + private ListBankingTransactionCategoriesRequest request; + + private final SDKMethodInterfaces.MethodCallListBankingTransactionCategories sdk; + + public ListBankingTransactionCategoriesRequestBuilder(SDKMethodInterfaces.MethodCallListBankingTransactionCategories sdk) { + this.sdk = sdk; + } + + public ListBankingTransactionCategoriesRequestBuilder request(ListBankingTransactionCategoriesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListBankingTransactionCategoriesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesResponse.java new file mode 100644 index 00000000..3e1a582e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionCategoriesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListBankingTransactionCategoriesResponse { + + /** + * Success + */ + private Optional bankingTransactionCategories; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListBankingTransactionCategoriesResponse( + Optional bankingTransactionCategories, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingTransactionCategories, "bankingTransactionCategories"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingTransactionCategories = bankingTransactionCategories; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional bankingTransactionCategories() { + return bankingTransactionCategories; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListBankingTransactionCategoriesResponse withBankingTransactionCategories(io.codat.lending.models.shared.BankingTransactionCategories bankingTransactionCategories) { + Utils.checkNotNull(bankingTransactionCategories, "bankingTransactionCategories"); + this.bankingTransactionCategories = Optional.ofNullable(bankingTransactionCategories); + return this; + } + + /** + * Success + */ + public ListBankingTransactionCategoriesResponse withBankingTransactionCategories(Optional bankingTransactionCategories) { + Utils.checkNotNull(bankingTransactionCategories, "bankingTransactionCategories"); + this.bankingTransactionCategories = bankingTransactionCategories; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListBankingTransactionCategoriesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingTransactionCategoriesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingTransactionCategoriesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListBankingTransactionCategoriesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListBankingTransactionCategoriesResponse 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; + } + ListBankingTransactionCategoriesResponse other = (ListBankingTransactionCategoriesResponse) o; + return + java.util.Objects.deepEquals(this.bankingTransactionCategories, other.bankingTransactionCategories) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingTransactionCategories, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListBankingTransactionCategoriesResponse.class, + "bankingTransactionCategories", bankingTransactionCategories, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional bankingTransactionCategories = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingTransactionCategories(io.codat.lending.models.shared.BankingTransactionCategories bankingTransactionCategories) { + Utils.checkNotNull(bankingTransactionCategories, "bankingTransactionCategories"); + this.bankingTransactionCategories = Optional.ofNullable(bankingTransactionCategories); + return this; + } + + /** + * Success + */ + public Builder bankingTransactionCategories(Optional bankingTransactionCategories) { + Utils.checkNotNull(bankingTransactionCategories, "bankingTransactionCategories"); + this.bankingTransactionCategories = bankingTransactionCategories; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListBankingTransactionCategoriesResponse build() { + return new ListBankingTransactionCategoriesResponse( + bankingTransactionCategories, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequest.java new file mode 100644 index 00000000..3deebfe5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListBankingTransactionsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListBankingTransactionsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListBankingTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListBankingTransactionsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingTransactionsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListBankingTransactionsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListBankingTransactionsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingTransactionsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListBankingTransactionsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListBankingTransactionsRequest other = (ListBankingTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListBankingTransactionsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListBankingTransactionsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListBankingTransactionsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequestBuilder.java new file mode 100644 index 00000000..2a443f30 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListBankingTransactionsRequestBuilder { + + private ListBankingTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallListBankingTransactions sdk; + + public ListBankingTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallListBankingTransactions sdk) { + this.sdk = sdk; + } + + public ListBankingTransactionsRequestBuilder request(ListBankingTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListBankingTransactionsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsResponse.java new file mode 100644 index 00000000..e0e0e252 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListBankingTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListBankingTransactionsResponse { + + /** + * Success + */ + private Optional bankingTransactions; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListBankingTransactionsResponse( + Optional bankingTransactions, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(bankingTransactions, "bankingTransactions"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.bankingTransactions = bankingTransactions; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * Success + */ + public Optional bankingTransactions() { + return bankingTransactions; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Success + */ + public ListBankingTransactionsResponse withBankingTransactions(io.codat.lending.models.shared.BankingTransactions bankingTransactions) { + Utils.checkNotNull(bankingTransactions, "bankingTransactions"); + this.bankingTransactions = Optional.ofNullable(bankingTransactions); + return this; + } + + /** + * Success + */ + public ListBankingTransactionsResponse withBankingTransactions(Optional bankingTransactions) { + Utils.checkNotNull(bankingTransactions, "bankingTransactions"); + this.bankingTransactions = bankingTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListBankingTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListBankingTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListBankingTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListBankingTransactionsResponse 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; + } + ListBankingTransactionsResponse other = (ListBankingTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.bankingTransactions, other.bankingTransactions) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankingTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListBankingTransactionsResponse.class, + "bankingTransactions", bankingTransactions, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional bankingTransactions = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * Success + */ + public Builder bankingTransactions(io.codat.lending.models.shared.BankingTransactions bankingTransactions) { + Utils.checkNotNull(bankingTransactions, "bankingTransactions"); + this.bankingTransactions = Optional.ofNullable(bankingTransactions); + return this; + } + + /** + * Success + */ + public Builder bankingTransactions(Optional bankingTransactions) { + Utils.checkNotNull(bankingTransactions, "bankingTransactions"); + this.bankingTransactions = bankingTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListBankingTransactionsResponse build() { + return new ListBankingTransactionsResponse( + bankingTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequest.java new file mode 100644 index 00000000..c17e9dea --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceCustomersRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceCustomersRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceCustomersRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceCustomersRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceCustomersRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceCustomersRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceCustomersRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceCustomersRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceCustomersRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceCustomersRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceCustomersRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceCustomersRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceCustomersRequest other = (ListCommerceCustomersRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceCustomersRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceCustomersRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceCustomersRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequestBuilder.java new file mode 100644 index 00000000..054d0906 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceCustomersRequestBuilder { + + private ListCommerceCustomersRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceCustomers sdk; + + public ListCommerceCustomersRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceCustomers sdk) { + this.sdk = sdk; + } + + public ListCommerceCustomersRequestBuilder request(ListCommerceCustomersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceCustomersResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersResponse.java new file mode 100644 index 00000000..af24d2a8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceCustomersResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceCustomersResponse { + + /** + * OK + */ + private Optional commerceCustomers; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceCustomersResponse( + Optional commerceCustomers, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceCustomers, "commerceCustomers"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceCustomers = commerceCustomers; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceCustomers() { + return commerceCustomers; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceCustomersResponse withCommerceCustomers(io.codat.lending.models.shared.CommerceCustomers commerceCustomers) { + Utils.checkNotNull(commerceCustomers, "commerceCustomers"); + this.commerceCustomers = Optional.ofNullable(commerceCustomers); + return this; + } + + /** + * OK + */ + public ListCommerceCustomersResponse withCommerceCustomers(Optional commerceCustomers) { + Utils.checkNotNull(commerceCustomers, "commerceCustomers"); + this.commerceCustomers = commerceCustomers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceCustomersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceCustomersResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceCustomersResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceCustomersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceCustomersResponse 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; + } + ListCommerceCustomersResponse other = (ListCommerceCustomersResponse) o; + return + java.util.Objects.deepEquals(this.commerceCustomers, other.commerceCustomers) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceCustomers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceCustomersResponse.class, + "commerceCustomers", commerceCustomers, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceCustomers = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceCustomers(io.codat.lending.models.shared.CommerceCustomers commerceCustomers) { + Utils.checkNotNull(commerceCustomers, "commerceCustomers"); + this.commerceCustomers = Optional.ofNullable(commerceCustomers); + return this; + } + + /** + * OK + */ + public Builder commerceCustomers(Optional commerceCustomers) { + Utils.checkNotNull(commerceCustomers, "commerceCustomers"); + this.commerceCustomers = commerceCustomers; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceCustomersResponse build() { + return new ListCommerceCustomersResponse( + commerceCustomers, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequest.java new file mode 100644 index 00000000..b74cc66e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceDisputesRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceDisputesRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceDisputesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceDisputesRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceDisputesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceDisputesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceDisputesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceDisputesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceDisputesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceDisputesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceDisputesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceDisputesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceDisputesRequest other = (ListCommerceDisputesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceDisputesRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceDisputesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceDisputesRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequestBuilder.java new file mode 100644 index 00000000..d282e79c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceDisputesRequestBuilder { + + private ListCommerceDisputesRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceDisputes sdk; + + public ListCommerceDisputesRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceDisputes sdk) { + this.sdk = sdk; + } + + public ListCommerceDisputesRequestBuilder request(ListCommerceDisputesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceDisputesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesResponse.java new file mode 100644 index 00000000..6ff7ac4a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceDisputesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceDisputesResponse { + + /** + * OK + */ + private Optional commerceDisputes; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceDisputesResponse( + Optional commerceDisputes, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceDisputes, "commerceDisputes"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceDisputes = commerceDisputes; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceDisputes() { + return commerceDisputes; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceDisputesResponse withCommerceDisputes(io.codat.lending.models.shared.CommerceDisputes commerceDisputes) { + Utils.checkNotNull(commerceDisputes, "commerceDisputes"); + this.commerceDisputes = Optional.ofNullable(commerceDisputes); + return this; + } + + /** + * OK + */ + public ListCommerceDisputesResponse withCommerceDisputes(Optional commerceDisputes) { + Utils.checkNotNull(commerceDisputes, "commerceDisputes"); + this.commerceDisputes = commerceDisputes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceDisputesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceDisputesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceDisputesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceDisputesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceDisputesResponse 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; + } + ListCommerceDisputesResponse other = (ListCommerceDisputesResponse) o; + return + java.util.Objects.deepEquals(this.commerceDisputes, other.commerceDisputes) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceDisputes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceDisputesResponse.class, + "commerceDisputes", commerceDisputes, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceDisputes = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceDisputes(io.codat.lending.models.shared.CommerceDisputes commerceDisputes) { + Utils.checkNotNull(commerceDisputes, "commerceDisputes"); + this.commerceDisputes = Optional.ofNullable(commerceDisputes); + return this; + } + + /** + * OK + */ + public Builder commerceDisputes(Optional commerceDisputes) { + Utils.checkNotNull(commerceDisputes, "commerceDisputes"); + this.commerceDisputes = commerceDisputes; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceDisputesResponse build() { + return new ListCommerceDisputesResponse( + commerceDisputes, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequest.java new file mode 100644 index 00000000..52fc75a6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListCommerceLocationsRequest { + + /** + * 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; + + public ListCommerceLocationsRequest( + String companyId, + String connectionId) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.companyId = companyId; + this.connectionId = connectionId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceLocationsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceLocationsRequest 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; + } + ListCommerceLocationsRequest other = (ListCommerceLocationsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceLocationsRequest.class, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + public ListCommerceLocationsRequest build() { + return new ListCommerceLocationsRequest( + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequestBuilder.java new file mode 100644 index 00000000..c0e6432a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceLocationsRequestBuilder { + + private ListCommerceLocationsRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceLocations sdk; + + public ListCommerceLocationsRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceLocations sdk) { + this.sdk = sdk; + } + + public ListCommerceLocationsRequestBuilder request(ListCommerceLocationsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceLocationsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsResponse.java new file mode 100644 index 00000000..2d91926b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceLocationsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceLocationsResponse { + + /** + * OK + */ + private Optional commerceLocations; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceLocationsResponse( + Optional commerceLocations, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceLocations, "commerceLocations"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceLocations = commerceLocations; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceLocations() { + return commerceLocations; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceLocationsResponse withCommerceLocations(io.codat.lending.models.shared.CommerceLocations commerceLocations) { + Utils.checkNotNull(commerceLocations, "commerceLocations"); + this.commerceLocations = Optional.ofNullable(commerceLocations); + return this; + } + + /** + * OK + */ + public ListCommerceLocationsResponse withCommerceLocations(Optional commerceLocations) { + Utils.checkNotNull(commerceLocations, "commerceLocations"); + this.commerceLocations = commerceLocations; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceLocationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListCommerceLocationsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListCommerceLocationsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceLocationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceLocationsResponse 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; + } + ListCommerceLocationsResponse other = (ListCommerceLocationsResponse) o; + return + java.util.Objects.deepEquals(this.commerceLocations, other.commerceLocations) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceLocations, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceLocationsResponse.class, + "commerceLocations", commerceLocations, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceLocations = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceLocations(io.codat.lending.models.shared.CommerceLocations commerceLocations) { + Utils.checkNotNull(commerceLocations, "commerceLocations"); + this.commerceLocations = Optional.ofNullable(commerceLocations); + return this; + } + + /** + * OK + */ + public Builder commerceLocations(Optional commerceLocations) { + Utils.checkNotNull(commerceLocations, "commerceLocations"); + this.commerceLocations = commerceLocations; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceLocationsResponse build() { + return new ListCommerceLocationsResponse( + commerceLocations, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequest.java new file mode 100644 index 00000000..94b04224 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceOrdersRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceOrdersRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceOrdersRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceOrdersRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceOrdersRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceOrdersRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceOrdersRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceOrdersRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceOrdersRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceOrdersRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceOrdersRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceOrdersRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceOrdersRequest other = (ListCommerceOrdersRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceOrdersRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceOrdersRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceOrdersRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequestBuilder.java new file mode 100644 index 00000000..94f6d441 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceOrdersRequestBuilder { + + private ListCommerceOrdersRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceOrders sdk; + + public ListCommerceOrdersRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceOrders sdk) { + this.sdk = sdk; + } + + public ListCommerceOrdersRequestBuilder request(ListCommerceOrdersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceOrdersResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersResponse.java new file mode 100644 index 00000000..25847b04 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceOrdersResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceOrdersResponse { + + /** + * OK + */ + private Optional commerceOrders; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceOrdersResponse( + Optional commerceOrders, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceOrders, "commerceOrders"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceOrders = commerceOrders; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceOrders() { + return commerceOrders; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceOrdersResponse withCommerceOrders(io.codat.lending.models.shared.CommerceOrders commerceOrders) { + Utils.checkNotNull(commerceOrders, "commerceOrders"); + this.commerceOrders = Optional.ofNullable(commerceOrders); + return this; + } + + /** + * OK + */ + public ListCommerceOrdersResponse withCommerceOrders(Optional commerceOrders) { + Utils.checkNotNull(commerceOrders, "commerceOrders"); + this.commerceOrders = commerceOrders; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceOrdersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceOrdersResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceOrdersResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceOrdersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceOrdersResponse 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; + } + ListCommerceOrdersResponse other = (ListCommerceOrdersResponse) o; + return + java.util.Objects.deepEquals(this.commerceOrders, other.commerceOrders) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceOrders, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceOrdersResponse.class, + "commerceOrders", commerceOrders, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceOrders = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceOrders(io.codat.lending.models.shared.CommerceOrders commerceOrders) { + Utils.checkNotNull(commerceOrders, "commerceOrders"); + this.commerceOrders = Optional.ofNullable(commerceOrders); + return this; + } + + /** + * OK + */ + public Builder commerceOrders(Optional commerceOrders) { + Utils.checkNotNull(commerceOrders, "commerceOrders"); + this.commerceOrders = commerceOrders; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceOrdersResponse build() { + return new ListCommerceOrdersResponse( + commerceOrders, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequest.java new file mode 100644 index 00000000..52c7454b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommercePaymentMethodsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommercePaymentMethodsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommercePaymentMethodsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommercePaymentMethodsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommercePaymentMethodsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommercePaymentMethodsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentMethodsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentMethodsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentMethodsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentMethodsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommercePaymentMethodsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommercePaymentMethodsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommercePaymentMethodsRequest other = (ListCommercePaymentMethodsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommercePaymentMethodsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommercePaymentMethodsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommercePaymentMethodsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequestBuilder.java new file mode 100644 index 00000000..b2d18045 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommercePaymentMethodsRequestBuilder { + + private ListCommercePaymentMethodsRequest request; + + private final SDKMethodInterfaces.MethodCallListCommercePaymentMethods sdk; + + public ListCommercePaymentMethodsRequestBuilder(SDKMethodInterfaces.MethodCallListCommercePaymentMethods sdk) { + this.sdk = sdk; + } + + public ListCommercePaymentMethodsRequestBuilder request(ListCommercePaymentMethodsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommercePaymentMethodsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsResponse.java new file mode 100644 index 00000000..d5209224 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentMethodsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommercePaymentMethodsResponse { + + /** + * OK + */ + private Optional commercePaymentMethods; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommercePaymentMethodsResponse( + Optional commercePaymentMethods, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commercePaymentMethods, "commercePaymentMethods"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commercePaymentMethods = commercePaymentMethods; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commercePaymentMethods() { + return commercePaymentMethods; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommercePaymentMethodsResponse withCommercePaymentMethods(io.codat.lending.models.shared.CommercePaymentMethods commercePaymentMethods) { + Utils.checkNotNull(commercePaymentMethods, "commercePaymentMethods"); + this.commercePaymentMethods = Optional.ofNullable(commercePaymentMethods); + return this; + } + + /** + * OK + */ + public ListCommercePaymentMethodsResponse withCommercePaymentMethods(Optional commercePaymentMethods) { + Utils.checkNotNull(commercePaymentMethods, "commercePaymentMethods"); + this.commercePaymentMethods = commercePaymentMethods; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommercePaymentMethodsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommercePaymentMethodsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommercePaymentMethodsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommercePaymentMethodsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommercePaymentMethodsResponse 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; + } + ListCommercePaymentMethodsResponse other = (ListCommercePaymentMethodsResponse) o; + return + java.util.Objects.deepEquals(this.commercePaymentMethods, other.commercePaymentMethods) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commercePaymentMethods, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommercePaymentMethodsResponse.class, + "commercePaymentMethods", commercePaymentMethods, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commercePaymentMethods = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commercePaymentMethods(io.codat.lending.models.shared.CommercePaymentMethods commercePaymentMethods) { + Utils.checkNotNull(commercePaymentMethods, "commercePaymentMethods"); + this.commercePaymentMethods = Optional.ofNullable(commercePaymentMethods); + return this; + } + + /** + * OK + */ + public Builder commercePaymentMethods(Optional commercePaymentMethods) { + Utils.checkNotNull(commercePaymentMethods, "commercePaymentMethods"); + this.commercePaymentMethods = commercePaymentMethods; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommercePaymentMethodsResponse build() { + return new ListCommercePaymentMethodsResponse( + commercePaymentMethods, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequest.java new file mode 100644 index 00000000..823d3879 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommercePaymentsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommercePaymentsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommercePaymentsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommercePaymentsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommercePaymentsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommercePaymentsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommercePaymentsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommercePaymentsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommercePaymentsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommercePaymentsRequest other = (ListCommercePaymentsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommercePaymentsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommercePaymentsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommercePaymentsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequestBuilder.java new file mode 100644 index 00000000..5ca80b19 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommercePaymentsRequestBuilder { + + private ListCommercePaymentsRequest request; + + private final SDKMethodInterfaces.MethodCallListCommercePayments sdk; + + public ListCommercePaymentsRequestBuilder(SDKMethodInterfaces.MethodCallListCommercePayments sdk) { + this.sdk = sdk; + } + + public ListCommercePaymentsRequestBuilder request(ListCommercePaymentsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommercePaymentsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsResponse.java new file mode 100644 index 00000000..926f0cd8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommercePaymentsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommercePaymentsResponse { + + /** + * OK + */ + private Optional commercePayments; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommercePaymentsResponse( + Optional commercePayments, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commercePayments, "commercePayments"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commercePayments = commercePayments; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commercePayments() { + return commercePayments; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommercePaymentsResponse withCommercePayments(io.codat.lending.models.shared.CommercePayments commercePayments) { + Utils.checkNotNull(commercePayments, "commercePayments"); + this.commercePayments = Optional.ofNullable(commercePayments); + return this; + } + + /** + * OK + */ + public ListCommercePaymentsResponse withCommercePayments(Optional commercePayments) { + Utils.checkNotNull(commercePayments, "commercePayments"); + this.commercePayments = commercePayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommercePaymentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommercePaymentsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommercePaymentsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommercePaymentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommercePaymentsResponse 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; + } + ListCommercePaymentsResponse other = (ListCommercePaymentsResponse) o; + return + java.util.Objects.deepEquals(this.commercePayments, other.commercePayments) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commercePayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommercePaymentsResponse.class, + "commercePayments", commercePayments, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commercePayments = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commercePayments(io.codat.lending.models.shared.CommercePayments commercePayments) { + Utils.checkNotNull(commercePayments, "commercePayments"); + this.commercePayments = Optional.ofNullable(commercePayments); + return this; + } + + /** + * OK + */ + public Builder commercePayments(Optional commercePayments) { + Utils.checkNotNull(commercePayments, "commercePayments"); + this.commercePayments = commercePayments; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommercePaymentsResponse build() { + return new ListCommercePaymentsResponse( + commercePayments, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequest.java new file mode 100644 index 00000000..0e82fa25 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceProductCategoriesRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceProductCategoriesRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceProductCategoriesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceProductCategoriesRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceProductCategoriesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceProductCategoriesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductCategoriesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductCategoriesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductCategoriesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductCategoriesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceProductCategoriesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceProductCategoriesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceProductCategoriesRequest other = (ListCommerceProductCategoriesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceProductCategoriesRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceProductCategoriesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceProductCategoriesRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequestBuilder.java new file mode 100644 index 00000000..861fede2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceProductCategoriesRequestBuilder { + + private ListCommerceProductCategoriesRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceProductCategories sdk; + + public ListCommerceProductCategoriesRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceProductCategories sdk) { + this.sdk = sdk; + } + + public ListCommerceProductCategoriesRequestBuilder request(ListCommerceProductCategoriesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceProductCategoriesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesResponse.java new file mode 100644 index 00000000..e0a73ea8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductCategoriesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceProductCategoriesResponse { + + /** + * OK + */ + private Optional commerceProductCategories; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceProductCategoriesResponse( + Optional commerceProductCategories, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceProductCategories, "commerceProductCategories"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceProductCategories = commerceProductCategories; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceProductCategories() { + return commerceProductCategories; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceProductCategoriesResponse withCommerceProductCategories(io.codat.lending.models.shared.CommerceProductCategories commerceProductCategories) { + Utils.checkNotNull(commerceProductCategories, "commerceProductCategories"); + this.commerceProductCategories = Optional.ofNullable(commerceProductCategories); + return this; + } + + /** + * OK + */ + public ListCommerceProductCategoriesResponse withCommerceProductCategories(Optional commerceProductCategories) { + Utils.checkNotNull(commerceProductCategories, "commerceProductCategories"); + this.commerceProductCategories = commerceProductCategories; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceProductCategoriesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceProductCategoriesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceProductCategoriesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceProductCategoriesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceProductCategoriesResponse 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; + } + ListCommerceProductCategoriesResponse other = (ListCommerceProductCategoriesResponse) o; + return + java.util.Objects.deepEquals(this.commerceProductCategories, other.commerceProductCategories) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceProductCategories, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceProductCategoriesResponse.class, + "commerceProductCategories", commerceProductCategories, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceProductCategories = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceProductCategories(io.codat.lending.models.shared.CommerceProductCategories commerceProductCategories) { + Utils.checkNotNull(commerceProductCategories, "commerceProductCategories"); + this.commerceProductCategories = Optional.ofNullable(commerceProductCategories); + return this; + } + + /** + * OK + */ + public Builder commerceProductCategories(Optional commerceProductCategories) { + Utils.checkNotNull(commerceProductCategories, "commerceProductCategories"); + this.commerceProductCategories = commerceProductCategories; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceProductCategoriesResponse build() { + return new ListCommerceProductCategoriesResponse( + commerceProductCategories, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequest.java new file mode 100644 index 00000000..240de74d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceProductsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceProductsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceProductsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceProductsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceProductsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceProductsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceProductsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceProductsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceProductsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceProductsRequest other = (ListCommerceProductsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceProductsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceProductsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceProductsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequestBuilder.java new file mode 100644 index 00000000..a51d9b17 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceProductsRequestBuilder { + + private ListCommerceProductsRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceProducts sdk; + + public ListCommerceProductsRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceProducts sdk) { + this.sdk = sdk; + } + + public ListCommerceProductsRequestBuilder request(ListCommerceProductsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceProductsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsResponse.java new file mode 100644 index 00000000..5ab912c3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceProductsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceProductsResponse { + + /** + * OK + */ + private Optional commerceProducts; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceProductsResponse( + Optional commerceProducts, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceProducts, "commerceProducts"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceProducts = commerceProducts; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceProducts() { + return commerceProducts; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceProductsResponse withCommerceProducts(io.codat.lending.models.shared.CommerceProducts commerceProducts) { + Utils.checkNotNull(commerceProducts, "commerceProducts"); + this.commerceProducts = Optional.ofNullable(commerceProducts); + return this; + } + + /** + * OK + */ + public ListCommerceProductsResponse withCommerceProducts(Optional commerceProducts) { + Utils.checkNotNull(commerceProducts, "commerceProducts"); + this.commerceProducts = commerceProducts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceProductsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceProductsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceProductsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceProductsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceProductsResponse 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; + } + ListCommerceProductsResponse other = (ListCommerceProductsResponse) o; + return + java.util.Objects.deepEquals(this.commerceProducts, other.commerceProducts) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceProducts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceProductsResponse.class, + "commerceProducts", commerceProducts, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceProducts = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceProducts(io.codat.lending.models.shared.CommerceProducts commerceProducts) { + Utils.checkNotNull(commerceProducts, "commerceProducts"); + this.commerceProducts = Optional.ofNullable(commerceProducts); + return this; + } + + /** + * OK + */ + public Builder commerceProducts(Optional commerceProducts) { + Utils.checkNotNull(commerceProducts, "commerceProducts"); + this.commerceProducts = commerceProducts; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceProductsResponse build() { + return new ListCommerceProductsResponse( + commerceProducts, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequest.java new file mode 100644 index 00000000..437392ed --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCommerceTransactionsRequest { + + /** + * 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; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCommerceTransactionsRequest( + String companyId, + String connectionId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.connectionId = connectionId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCommerceTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public ListCommerceTransactionsRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceTransactionsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCommerceTransactionsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceTransactionsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceTransactionsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceTransactionsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCommerceTransactionsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceTransactionsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCommerceTransactionsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCommerceTransactionsRequest other = (ListCommerceTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceTransactionsRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private String connectionId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Unique identifier for a connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCommerceTransactionsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCommerceTransactionsRequest( + companyId, + connectionId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequestBuilder.java new file mode 100644 index 00000000..d4bb6495 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCommerceTransactionsRequestBuilder { + + private ListCommerceTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallListCommerceTransactions sdk; + + public ListCommerceTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallListCommerceTransactions sdk) { + this.sdk = sdk; + } + + public ListCommerceTransactionsRequestBuilder request(ListCommerceTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCommerceTransactionsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsResponse.java new file mode 100644 index 00000000..978e8470 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCommerceTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCommerceTransactionsResponse { + + /** + * OK + */ + private Optional commerceTransactions; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCommerceTransactionsResponse( + Optional commerceTransactions, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(commerceTransactions, "commerceTransactions"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.commerceTransactions = commerceTransactions; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional commerceTransactions() { + return commerceTransactions; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCommerceTransactionsResponse withCommerceTransactions(io.codat.lending.models.shared.CommerceTransactions commerceTransactions) { + Utils.checkNotNull(commerceTransactions, "commerceTransactions"); + this.commerceTransactions = Optional.ofNullable(commerceTransactions); + return this; + } + + /** + * OK + */ + public ListCommerceTransactionsResponse withCommerceTransactions(Optional commerceTransactions) { + Utils.checkNotNull(commerceTransactions, "commerceTransactions"); + this.commerceTransactions = commerceTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCommerceTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCommerceTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCommerceTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCommerceTransactionsResponse 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; + } + ListCommerceTransactionsResponse other = (ListCommerceTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.commerceTransactions, other.commerceTransactions) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + commerceTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCommerceTransactionsResponse.class, + "commerceTransactions", commerceTransactions, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional commerceTransactions = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder commerceTransactions(io.codat.lending.models.shared.CommerceTransactions commerceTransactions) { + Utils.checkNotNull(commerceTransactions, "commerceTransactions"); + this.commerceTransactions = Optional.ofNullable(commerceTransactions); + return this; + } + + /** + * OK + */ + public Builder commerceTransactions(Optional commerceTransactions) { + Utils.checkNotNull(commerceTransactions, "commerceTransactions"); + this.commerceTransactions = commerceTransactions; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCommerceTransactionsResponse build() { + return new ListCommerceTransactionsResponse( + commerceTransactions, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequest.java new file mode 100644 index 00000000..6c964612 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequest.java @@ -0,0 +1,307 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCompaniesRequest { + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCompaniesRequest( + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCompaniesRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCompaniesRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCompaniesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCompaniesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCompaniesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCompaniesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCompaniesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCompaniesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCompaniesRequest other = (ListCompaniesRequest) o; + return + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCompaniesRequest.class, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCompaniesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCompaniesRequest( + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequestBuilder.java new file mode 100644 index 00000000..826d5e72 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCompaniesRequestBuilder { + + private ListCompaniesRequest request; + + private final SDKMethodInterfaces.MethodCallListCompanies sdk; + + public ListCompaniesRequestBuilder(SDKMethodInterfaces.MethodCallListCompanies sdk) { + this.sdk = sdk; + } + + public ListCompaniesRequestBuilder request(ListCompaniesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCompaniesResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesResponse.java new file mode 100644 index 00000000..37921b94 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCompaniesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCompaniesResponse { + + /** + * OK + */ + private Optional companies; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCompaniesResponse( + Optional companies, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(companies, "companies"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.companies = companies; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional companies() { + return companies; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListCompaniesResponse withCompanies(io.codat.lending.models.shared.Companies companies) { + Utils.checkNotNull(companies, "companies"); + this.companies = Optional.ofNullable(companies); + return this; + } + + /** + * OK + */ + public ListCompaniesResponse withCompanies(Optional companies) { + Utils.checkNotNull(companies, "companies"); + this.companies = companies; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListCompaniesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCompaniesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCompaniesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCompaniesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCompaniesResponse 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; + } + ListCompaniesResponse other = (ListCompaniesResponse) o; + return + java.util.Objects.deepEquals(this.companies, other.companies) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companies, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCompaniesResponse.class, + "companies", companies, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional companies = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder companies(io.codat.lending.models.shared.Companies companies) { + Utils.checkNotNull(companies, "companies"); + this.companies = Optional.ofNullable(companies); + return this; + } + + /** + * OK + */ + public Builder companies(Optional companies) { + Utils.checkNotNull(companies, "companies"); + this.companies = companies; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListCompaniesResponse build() { + return new ListCompaniesResponse( + companies, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequest.java new file mode 100644 index 00000000..29bd4fa9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListConnectionsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListConnectionsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListConnectionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListConnectionsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListConnectionsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListConnectionsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListConnectionsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListConnectionsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListConnectionsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListConnectionsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListConnectionsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListConnectionsRequest other = (ListConnectionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListConnectionsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListConnectionsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListConnectionsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequestBuilder.java new file mode 100644 index 00000000..40b20844 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListConnectionsRequestBuilder { + + private ListConnectionsRequest request; + + private final SDKMethodInterfaces.MethodCallListConnections sdk; + + public ListConnectionsRequestBuilder(SDKMethodInterfaces.MethodCallListConnections sdk) { + this.sdk = sdk; + } + + public ListConnectionsRequestBuilder request(ListConnectionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListConnectionsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsResponse.java new file mode 100644 index 00000000..98b73da5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListConnectionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListConnectionsResponse { + + /** + * OK + */ + private Optional connections; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListConnectionsResponse( + Optional connections, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(connections, "connections"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.connections = connections; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional connections() { + return connections; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public ListConnectionsResponse withConnections(io.codat.lending.models.shared.Connections connections) { + Utils.checkNotNull(connections, "connections"); + this.connections = Optional.ofNullable(connections); + return this; + } + + /** + * OK + */ + public ListConnectionsResponse withConnections(Optional connections) { + Utils.checkNotNull(connections, "connections"); + this.connections = connections; + return this; + } + + /** + * HTTP response content type for this operation + */ + public ListConnectionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListConnectionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListConnectionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListConnectionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListConnectionsResponse 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; + } + ListConnectionsResponse other = (ListConnectionsResponse) o; + return + java.util.Objects.deepEquals(this.connections, other.connections) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + connections, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListConnectionsResponse.class, + "connections", connections, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional connections = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder connections(io.codat.lending.models.shared.Connections connections) { + Utils.checkNotNull(connections, "connections"); + this.connections = Optional.ofNullable(connections); + return this; + } + + /** + * OK + */ + public Builder connections(Optional connections) { + Utils.checkNotNull(connections, "connections"); + this.connections = connections; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListConnectionsResponse build() { + return new ListConnectionsResponse( + connections, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequest.java new file mode 100644 index 00000000..71b23c28 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListCreateOperationsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListCreateOperationsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListCreateOperationsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCreateOperationsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListCreateOperationsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCreateOperationsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCreateOperationsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCreateOperationsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListCreateOperationsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCreateOperationsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListCreateOperationsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCreateOperationsRequest other = (ListCreateOperationsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListCreateOperationsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListCreateOperationsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListCreateOperationsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequestBuilder.java new file mode 100644 index 00000000..2de8eb20 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListCreateOperationsRequestBuilder { + + private ListCreateOperationsRequest request; + + private final SDKMethodInterfaces.MethodCallListCreateOperations sdk; + + public ListCreateOperationsRequestBuilder(SDKMethodInterfaces.MethodCallListCreateOperations sdk) { + this.sdk = sdk; + } + + public ListCreateOperationsRequestBuilder request(ListCreateOperationsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListCreateOperationsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsResponse.java new file mode 100644 index 00000000..781dd91c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListCreateOperationsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListCreateOperationsResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pushOperations; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListCreateOperationsResponse( + String contentType, + Optional errorMessage, + Optional pushOperations, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperations, "pushOperations"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pushOperations = pushOperations; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pushOperations() { + return pushOperations; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListCreateOperationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCreateOperationsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListCreateOperationsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public ListCreateOperationsResponse withPushOperations(io.codat.lending.models.shared.PushOperations pushOperations) { + Utils.checkNotNull(pushOperations, "pushOperations"); + this.pushOperations = Optional.ofNullable(pushOperations); + return this; + } + + /** + * OK + */ + public ListCreateOperationsResponse withPushOperations(Optional pushOperations) { + Utils.checkNotNull(pushOperations, "pushOperations"); + this.pushOperations = pushOperations; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListCreateOperationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListCreateOperationsResponse 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; + } + ListCreateOperationsResponse other = (ListCreateOperationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperations, other.pushOperations) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pushOperations, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListCreateOperationsResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pushOperations", pushOperations, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional pushOperations = 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; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pushOperations(io.codat.lending.models.shared.PushOperations pushOperations) { + Utils.checkNotNull(pushOperations, "pushOperations"); + this.pushOperations = Optional.ofNullable(pushOperations); + return this; + } + + /** + * OK + */ + public Builder pushOperations(Optional pushOperations) { + Utils.checkNotNull(pushOperations, "pushOperations"); + this.pushOperations = pushOperations; + 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 ListCreateOperationsResponse build() { + return new ListCreateOperationsResponse( + contentType, + errorMessage, + pushOperations, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequest.java new file mode 100644 index 00000000..00064a44 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequest.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListDataIntegrityDetailsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * A key for a Codat data type. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=dataType") + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListDataIntegrityDetailsRequest( + String companyId, + io.codat.lending.models.shared.DataIntegrityDataType dataType, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.dataType = dataType; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * A key for a Codat data type. + */ + public io.codat.lending.models.shared.DataIntegrityDataType dataType() { + return dataType; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListDataIntegrityDetailsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * A key for a Codat data type. + */ + public ListDataIntegrityDetailsRequest withDataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListDataIntegrityDetailsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListDataIntegrityDetailsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListDataIntegrityDetailsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListDataIntegrityDetailsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListDataIntegrityDetailsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListDataIntegrityDetailsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListDataIntegrityDetailsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListDataIntegrityDetailsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDataIntegrityDetailsRequest other = (ListDataIntegrityDetailsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + dataType, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListDataIntegrityDetailsRequest.class, + "companyId", companyId, + "dataType", dataType, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private io.codat.lending.models.shared.DataIntegrityDataType dataType; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * A key for a Codat data type. + */ + public Builder dataType(io.codat.lending.models.shared.DataIntegrityDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListDataIntegrityDetailsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListDataIntegrityDetailsRequest( + companyId, + dataType, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequestBuilder.java new file mode 100644 index 00000000..63af7a3a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListDataIntegrityDetailsRequestBuilder { + + private ListDataIntegrityDetailsRequest request; + + private final SDKMethodInterfaces.MethodCallListDataIntegrityDetails sdk; + + public ListDataIntegrityDetailsRequestBuilder(SDKMethodInterfaces.MethodCallListDataIntegrityDetails sdk) { + this.sdk = sdk; + } + + public ListDataIntegrityDetailsRequestBuilder request(ListDataIntegrityDetailsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListDataIntegrityDetailsResponse call() throws Exception { + return sdk.details( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsResponse.java new file mode 100644 index 00000000..a0ff6b33 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListDataIntegrityDetailsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListDataIntegrityDetailsResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional dataIntegrityDetails; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListDataIntegrityDetailsResponse( + String contentType, + Optional dataIntegrityDetails, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(dataIntegrityDetails, "dataIntegrityDetails"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.dataIntegrityDetails = dataIntegrityDetails; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional dataIntegrityDetails() { + return dataIntegrityDetails; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListDataIntegrityDetailsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public ListDataIntegrityDetailsResponse withDataIntegrityDetails(io.codat.lending.models.shared.DataIntegrityDetails dataIntegrityDetails) { + Utils.checkNotNull(dataIntegrityDetails, "dataIntegrityDetails"); + this.dataIntegrityDetails = Optional.ofNullable(dataIntegrityDetails); + return this; + } + + /** + * OK + */ + public ListDataIntegrityDetailsResponse withDataIntegrityDetails(Optional dataIntegrityDetails) { + Utils.checkNotNull(dataIntegrityDetails, "dataIntegrityDetails"); + this.dataIntegrityDetails = dataIntegrityDetails; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListDataIntegrityDetailsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListDataIntegrityDetailsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListDataIntegrityDetailsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListDataIntegrityDetailsResponse 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; + } + ListDataIntegrityDetailsResponse other = (ListDataIntegrityDetailsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.dataIntegrityDetails, other.dataIntegrityDetails) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + dataIntegrityDetails, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListDataIntegrityDetailsResponse.class, + "contentType", contentType, + "dataIntegrityDetails", dataIntegrityDetails, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional dataIntegrityDetails = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder dataIntegrityDetails(io.codat.lending.models.shared.DataIntegrityDetails dataIntegrityDetails) { + Utils.checkNotNull(dataIntegrityDetails, "dataIntegrityDetails"); + this.dataIntegrityDetails = Optional.ofNullable(dataIntegrityDetails); + return this; + } + + /** + * OK + */ + public Builder dataIntegrityDetails(Optional dataIntegrityDetails) { + Utils.checkNotNull(dataIntegrityDetails, "dataIntegrityDetails"); + this.dataIntegrityDetails = dataIntegrityDetails; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListDataIntegrityDetailsResponse build() { + return new ListDataIntegrityDetailsResponse( + contentType, + dataIntegrityDetails, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequest.java new file mode 100644 index 00000000..03931fcf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListFilesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public ListFilesRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListFilesRequest 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; + } + ListFilesRequest other = (ListFilesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(ListFilesRequest.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 ListFilesRequest build() { + return new ListFilesRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequestBuilder.java new file mode 100644 index 00000000..a77305e6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListFilesRequestBuilder { + + private ListFilesRequest request; + + private final SDKMethodInterfaces.MethodCallListFiles sdk; + + public ListFilesRequestBuilder(SDKMethodInterfaces.MethodCallListFiles sdk) { + this.sdk = sdk; + } + + public ListFilesRequestBuilder request(ListFilesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListFilesResponse call() throws Exception { + return sdk.listUploaded( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesResponse.java new file mode 100644 index 00000000..4c36309e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListFilesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListFilesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * Success + */ + private Optional> files; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListFilesResponse( + String contentType, + Optional errorMessage, + Optional> files, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(files, "files"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.files = files; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * Success + */ + public Optional> files() { + return files; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListFilesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListFilesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public ListFilesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Success + */ + public ListFilesResponse withFiles(java.util.List files) { + Utils.checkNotNull(files, "files"); + this.files = Optional.ofNullable(files); + return this; + } + + /** + * Success + */ + public ListFilesResponse withFiles(Optional> files) { + Utils.checkNotNull(files, "files"); + this.files = files; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListFilesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListFilesResponse 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; + } + ListFilesResponse other = (ListFilesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.files, other.files) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + files, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListFilesResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "files", files, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional> files = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Success + */ + public Builder files(java.util.List files) { + Utils.checkNotNull(files, "files"); + this.files = Optional.ofNullable(files); + return this; + } + + /** + * Success + */ + public Builder files(Optional> files) { + Utils.checkNotNull(files, "files"); + this.files = files; + 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 ListFilesResponse build() { + return new ListFilesResponse( + contentType, + errorMessage, + files, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsQueryParamSourceType.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsQueryParamSourceType.java new file mode 100644 index 00000000..44ddb7e0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsQueryParamSourceType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ListLoanTransactionsQueryParamSourceType - Data source type. + */ +public enum ListLoanTransactionsQueryParamSourceType { + BANKING("banking"), + COMMERCE("commerce"), + ACCOUNTING("accounting"); + + @JsonValue + private final String value; + + private ListLoanTransactionsQueryParamSourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequest.java new file mode 100644 index 00000000..68f4290e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequest.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class ListLoanTransactionsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Data source type. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=sourceType") + private ListLoanTransactionsQueryParamSourceType sourceType; + + public ListLoanTransactionsRequest( + String companyId, + ListLoanTransactionsQueryParamSourceType sourceType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(sourceType, "sourceType"); + this.companyId = companyId; + this.sourceType = sourceType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Data source type. + */ + public ListLoanTransactionsQueryParamSourceType sourceType() { + return sourceType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListLoanTransactionsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Data source type. + */ + public ListLoanTransactionsRequest withSourceType(ListLoanTransactionsQueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListLoanTransactionsRequest other = (ListLoanTransactionsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + sourceType); + } + + @Override + public String toString() { + return Utils.toString(ListLoanTransactionsRequest.class, + "companyId", companyId, + "sourceType", sourceType); + } + + public final static class Builder { + + private String companyId; + + private ListLoanTransactionsQueryParamSourceType sourceType; + + 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; + } + + /** + * Data source type. + */ + public Builder sourceType(ListLoanTransactionsQueryParamSourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + public ListLoanTransactionsRequest build() { + return new ListLoanTransactionsRequest( + companyId, + sourceType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequestBuilder.java new file mode 100644 index 00000000..1df429e3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListLoanTransactionsRequestBuilder { + + private ListLoanTransactionsRequest request; + + private final SDKMethodInterfaces.MethodCallListLoanTransactions sdk; + + public ListLoanTransactionsRequestBuilder(SDKMethodInterfaces.MethodCallListLoanTransactions sdk) { + this.sdk = sdk; + } + + public ListLoanTransactionsRequestBuilder request(ListLoanTransactionsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListLoanTransactionsResponse call() throws Exception { + return sdk.listLoanTransactions( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsResponse.java new file mode 100644 index 00000000..2a316869 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListLoanTransactionsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListLoanTransactionsResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional loanTransactions; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListLoanTransactionsResponse( + String contentType, + Optional errorMessage, + Optional loanTransactions, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(loanTransactions, "loanTransactions"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.loanTransactions = loanTransactions; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional loanTransactions() { + return loanTransactions; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListLoanTransactionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public ListLoanTransactionsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public ListLoanTransactionsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public ListLoanTransactionsResponse withLoanTransactions(io.codat.lending.models.shared.LoanTransactions loanTransactions) { + Utils.checkNotNull(loanTransactions, "loanTransactions"); + this.loanTransactions = Optional.ofNullable(loanTransactions); + return this; + } + + /** + * OK + */ + public ListLoanTransactionsResponse withLoanTransactions(Optional loanTransactions) { + Utils.checkNotNull(loanTransactions, "loanTransactions"); + this.loanTransactions = loanTransactions; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListLoanTransactionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListLoanTransactionsResponse 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; + } + ListLoanTransactionsResponse other = (ListLoanTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.loanTransactions, other.loanTransactions) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + loanTransactions, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListLoanTransactionsResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "loanTransactions", loanTransactions, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional loanTransactions = 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; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder loanTransactions(io.codat.lending.models.shared.LoanTransactions loanTransactions) { + Utils.checkNotNull(loanTransactions, "loanTransactions"); + this.loanTransactions = Optional.ofNullable(loanTransactions); + return this; + } + + /** + * OK + */ + public Builder loanTransactions(Optional loanTransactions) { + Utils.checkNotNull(loanTransactions, "loanTransactions"); + this.loanTransactions = loanTransactions; + 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 ListLoanTransactionsResponse build() { + return new ListLoanTransactionsResponse( + contentType, + errorMessage, + loanTransactions, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequest.java new file mode 100644 index 00000000..e5c9bbb1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequest.java @@ -0,0 +1,347 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListPullOperationsRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy") + private Optional orderBy; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListPullOperationsRequest( + String companyId, + Optional orderBy, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(orderBy, "orderBy"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.orderBy = orderBy; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Optional orderBy() { + return orderBy; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListPullOperationsRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListPullOperationsRequest withOrderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public ListPullOperationsRequest withOrderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListPullOperationsRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListPullOperationsRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListPullOperationsRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListPullOperationsRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListPullOperationsRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListPullOperationsRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListPullOperationsRequest other = (ListPullOperationsRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.orderBy, other.orderBy) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + orderBy, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListPullOperationsRequest.class, + "companyId", companyId, + "orderBy", orderBy, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional orderBy = Optional.empty(); + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(String orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + */ + public Builder orderBy(Optional orderBy) { + Utils.checkNotNull(orderBy, "orderBy"); + this.orderBy = orderBy; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListPullOperationsRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListPullOperationsRequest( + companyId, + orderBy, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequestBuilder.java new file mode 100644 index 00000000..b58e5e54 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListPullOperationsRequestBuilder { + + private ListPullOperationsRequest request; + + private final SDKMethodInterfaces.MethodCallListPullOperations sdk; + + public ListPullOperationsRequestBuilder(SDKMethodInterfaces.MethodCallListPullOperations sdk) { + this.sdk = sdk; + } + + public ListPullOperationsRequestBuilder request(ListPullOperationsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListPullOperationsResponse call() throws Exception { + return sdk.list( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsResponse.java new file mode 100644 index 00000000..ff2e263f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListPullOperationsResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListPullOperationsResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pullOperations; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListPullOperationsResponse( + String contentType, + Optional errorMessage, + Optional pullOperations, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pullOperations, "pullOperations"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pullOperations = pullOperations; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pullOperations() { + return pullOperations; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListPullOperationsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListPullOperationsResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListPullOperationsResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public ListPullOperationsResponse withPullOperations(io.codat.lending.models.shared.PullOperations pullOperations) { + Utils.checkNotNull(pullOperations, "pullOperations"); + this.pullOperations = Optional.ofNullable(pullOperations); + return this; + } + + /** + * OK + */ + public ListPullOperationsResponse withPullOperations(Optional pullOperations) { + Utils.checkNotNull(pullOperations, "pullOperations"); + this.pullOperations = pullOperations; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListPullOperationsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListPullOperationsResponse 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; + } + ListPullOperationsResponse other = (ListPullOperationsResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pullOperations, other.pullOperations) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pullOperations, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListPullOperationsResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pullOperations", pullOperations, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional pullOperations = 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; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pullOperations(io.codat.lending.models.shared.PullOperations pullOperations) { + Utils.checkNotNull(pullOperations, "pullOperations"); + this.pullOperations = Optional.ofNullable(pullOperations); + return this; + } + + /** + * OK + */ + public Builder pullOperations(Optional pullOperations) { + Utils.checkNotNull(pullOperations, "pullOperations"); + this.pullOperations = pullOperations; + 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 ListPullOperationsResponse build() { + return new ListPullOperationsResponse( + contentType, + errorMessage, + pullOperations, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequest.java new file mode 100644 index 00000000..f2a08663 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequest.java @@ -0,0 +1,289 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.codat.lending.utils.LazySingletonValue; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ListReconciledInvoicesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=page") + private Optional page; + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize") + private Optional pageSize; + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") + private Optional query; + + public ListReconciledInvoicesRequest( + String companyId, + Optional page, + Optional pageSize, + Optional query) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(page, "page"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(query, "query"); + this.companyId = companyId; + this.page = page; + this.pageSize = pageSize; + this.query = query; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional page() { + return page; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Optional query() { + return query; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public ListReconciledInvoicesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListReconciledInvoicesRequest withPage(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListReconciledInvoicesRequest withPage(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListReconciledInvoicesRequest withPageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public ListReconciledInvoicesRequest withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListReconciledInvoicesRequest withQuery(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public ListReconciledInvoicesRequest withQuery(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListReconciledInvoicesRequest other = (ListReconciledInvoicesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.page, other.page) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.query, other.query); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + page, + pageSize, + query); + } + + @Override + public String toString() { + return Utils.toString(ListReconciledInvoicesRequest.class, + "companyId", companyId, + "page", page, + "pageSize", pageSize, + "query", query); + } + + public final static class Builder { + + private String companyId; + + private Optional page; + + private Optional pageSize; + + private Optional query = Optional.empty(); + + 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; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(int page) { + Utils.checkNotNull(page, "page"); + this.page = Optional.ofNullable(page); + return this; + } + + /** + * Page number. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder page(Optional page) { + Utils.checkNotNull(page, "page"); + this.page = page; + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(int pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = Optional.ofNullable(query); + return this; + } + + /** + * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + */ + public Builder query(Optional query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public ListReconciledInvoicesRequest build() { + if (page == null) { + page = _SINGLETON_VALUE_Page.value(); + } + if (pageSize == null) { + pageSize = _SINGLETON_VALUE_PageSize.value(); + } + return new ListReconciledInvoicesRequest( + companyId, + page, + pageSize, + query); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Page = + new LazySingletonValue<>( + "page", + "1", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_PageSize = + new LazySingletonValue<>( + "pageSize", + "100", + new TypeReference>() {}); + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequestBuilder.java new file mode 100644 index 00000000..62cb9975 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class ListReconciledInvoicesRequestBuilder { + + private ListReconciledInvoicesRequest request; + + private final SDKMethodInterfaces.MethodCallListReconciledInvoices sdk; + + public ListReconciledInvoicesRequestBuilder(SDKMethodInterfaces.MethodCallListReconciledInvoices sdk) { + this.sdk = sdk; + } + + public ListReconciledInvoicesRequestBuilder request(ListReconciledInvoicesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public ListReconciledInvoicesResponse call() throws Exception { + return sdk.listReconciled( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesResponse.java new file mode 100644 index 00000000..c34c8657 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/ListReconciledInvoicesResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class ListReconciledInvoicesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * OK + */ + private Optional enhancedInvoicesReport; + + /** + * Your `query` parameter was not correctly formed + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public ListReconciledInvoicesResponse( + String contentType, + Optional enhancedInvoicesReport, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(enhancedInvoicesReport, "enhancedInvoicesReport"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.enhancedInvoicesReport = enhancedInvoicesReport; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * OK + */ + public Optional enhancedInvoicesReport() { + return enhancedInvoicesReport; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ListReconciledInvoicesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * OK + */ + public ListReconciledInvoicesResponse withEnhancedInvoicesReport(io.codat.lending.models.shared.EnhancedInvoicesReport enhancedInvoicesReport) { + Utils.checkNotNull(enhancedInvoicesReport, "enhancedInvoicesReport"); + this.enhancedInvoicesReport = Optional.ofNullable(enhancedInvoicesReport); + return this; + } + + /** + * OK + */ + public ListReconciledInvoicesResponse withEnhancedInvoicesReport(Optional enhancedInvoicesReport) { + Utils.checkNotNull(enhancedInvoicesReport, "enhancedInvoicesReport"); + this.enhancedInvoicesReport = enhancedInvoicesReport; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListReconciledInvoicesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public ListReconciledInvoicesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ListReconciledInvoicesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ListReconciledInvoicesResponse 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; + } + ListReconciledInvoicesResponse other = (ListReconciledInvoicesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.enhancedInvoicesReport, other.enhancedInvoicesReport) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + enhancedInvoicesReport, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ListReconciledInvoicesResponse.class, + "contentType", contentType, + "enhancedInvoicesReport", enhancedInvoicesReport, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional enhancedInvoicesReport = Optional.empty(); + + private Optional errorMessage = 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; + } + + /** + * OK + */ + public Builder enhancedInvoicesReport(io.codat.lending.models.shared.EnhancedInvoicesReport enhancedInvoicesReport) { + Utils.checkNotNull(enhancedInvoicesReport, "enhancedInvoicesReport"); + this.enhancedInvoicesReport = Optional.ofNullable(enhancedInvoicesReport); + return this; + } + + /** + * OK + */ + public Builder enhancedInvoicesReport(Optional enhancedInvoicesReport) { + Utils.checkNotNull(enhancedInvoicesReport, "enhancedInvoicesReport"); + this.enhancedInvoicesReport = enhancedInvoicesReport; + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your `query` parameter was not correctly formed + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 ListReconciledInvoicesResponse build() { + return new ListReconciledInvoicesResponse( + contentType, + enhancedInvoicesReport, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/QueryParamSourceType.java b/lending/lib/src/main/java/io/codat/lending/models/operations/QueryParamSourceType.java new file mode 100644 index 00000000..9552bfb5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/QueryParamSourceType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * QueryParamSourceType - Data source type. + */ +public enum QueryParamSourceType { + BANKING("banking"), + COMMERCE("commerce"), + ACCOUNTING("accounting"); + + @JsonValue + private final String value; + + private QueryParamSourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequest.java new file mode 100644 index 00000000..90ebad1a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequest.java @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class RefreshAllDataTypesRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public RefreshAllDataTypesRequest( + String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public RefreshAllDataTypesRequest 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; + } + RefreshAllDataTypesRequest other = (RefreshAllDataTypesRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId); + } + + @Override + public String toString() { + return Utils.toString(RefreshAllDataTypesRequest.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 RefreshAllDataTypesRequest build() { + return new RefreshAllDataTypesRequest( + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequestBuilder.java new file mode 100644 index 00000000..6882d530 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class RefreshAllDataTypesRequestBuilder { + + private RefreshAllDataTypesRequest request; + + private final SDKMethodInterfaces.MethodCallRefreshAllDataTypes sdk; + + public RefreshAllDataTypesRequestBuilder(SDKMethodInterfaces.MethodCallRefreshAllDataTypes sdk) { + this.sdk = sdk; + } + + public RefreshAllDataTypesRequestBuilder request(RefreshAllDataTypesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public RefreshAllDataTypesResponse call() throws Exception { + return sdk.allDataTypes( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesResponse.java new file mode 100644 index 00000000..f367fb8a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshAllDataTypesResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class RefreshAllDataTypesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public RefreshAllDataTypesResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RefreshAllDataTypesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public RefreshAllDataTypesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public RefreshAllDataTypesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RefreshAllDataTypesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RefreshAllDataTypesResponse 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; + } + RefreshAllDataTypesResponse other = (RefreshAllDataTypesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(RefreshAllDataTypesResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 RefreshAllDataTypesResponse build() { + return new RefreshAllDataTypesResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequest.java new file mode 100644 index 00000000..7c24f488 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequest.java @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class RefreshDataTypeRequest { + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=connectionId") + private Optional connectionId; + + /** + * The key of a Codat data type + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=dataType") + private io.codat.lending.models.shared.SchemaDataType dataType; + + public RefreshDataTypeRequest( + String companyId, + Optional connectionId, + io.codat.lending.models.shared.SchemaDataType dataType) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(dataType, "dataType"); + this.companyId = companyId; + this.connectionId = connectionId; + this.dataType = dataType; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + public Optional connectionId() { + return connectionId; + } + + /** + * The key of a Codat data type + */ + public io.codat.lending.models.shared.SchemaDataType dataType() { + return dataType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a company. + */ + public RefreshDataTypeRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + public RefreshDataTypeRequest withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + public RefreshDataTypeRequest withConnectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The key of a Codat data type + */ + public RefreshDataTypeRequest withDataType(io.codat.lending.models.shared.SchemaDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefreshDataTypeRequest other = (RefreshDataTypeRequest) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.dataType, other.dataType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + connectionId, + dataType); + } + + @Override + public String toString() { + return Utils.toString(RefreshDataTypeRequest.class, + "companyId", companyId, + "connectionId", connectionId, + "dataType", dataType); + } + + public final static class Builder { + + private String companyId; + + private Optional connectionId = Optional.empty(); + + private io.codat.lending.models.shared.SchemaDataType dataType; + + 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; + } + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * Optionally, provide a data connection id to only queue pull operations on that connection. + */ + public Builder connectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The key of a Codat data type + */ + public Builder dataType(io.codat.lending.models.shared.SchemaDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + public RefreshDataTypeRequest build() { + return new RefreshDataTypeRequest( + companyId, + connectionId, + dataType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequestBuilder.java new file mode 100644 index 00000000..a2231252 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class RefreshDataTypeRequestBuilder { + + private RefreshDataTypeRequest request; + + private final SDKMethodInterfaces.MethodCallRefreshDataType sdk; + + public RefreshDataTypeRequestBuilder(SDKMethodInterfaces.MethodCallRefreshDataType sdk) { + this.sdk = sdk; + } + + public RefreshDataTypeRequestBuilder request(RefreshDataTypeRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public RefreshDataTypeResponse call() throws Exception { + return sdk.dataType( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeResponse.java new file mode 100644 index 00000000..794ee8b9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/RefreshDataTypeResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class RefreshDataTypeResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * OK + */ + private Optional pullOperation; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public RefreshDataTypeResponse( + String contentType, + Optional errorMessage, + Optional pullOperation, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pullOperation, "pullOperation"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.pullOperation = pullOperation; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * OK + */ + public Optional pullOperation() { + return pullOperation; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public RefreshDataTypeResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public RefreshDataTypeResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public RefreshDataTypeResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public RefreshDataTypeResponse withPullOperation(io.codat.lending.models.shared.PullOperation pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = Optional.ofNullable(pullOperation); + return this; + } + + /** + * OK + */ + public RefreshDataTypeResponse withPullOperation(Optional pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = pullOperation; + return this; + } + + /** + * HTTP response status code for this operation + */ + public RefreshDataTypeResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public RefreshDataTypeResponse 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; + } + RefreshDataTypeResponse other = (RefreshDataTypeResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pullOperation, other.pullOperation) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + pullOperation, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(RefreshDataTypeResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "pullOperation", pullOperation, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Optional pullOperation = 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; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * OK + */ + public Builder pullOperation(io.codat.lending.models.shared.PullOperation pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = Optional.ofNullable(pullOperation); + return this; + } + + /** + * OK + */ + public Builder pullOperation(Optional pullOperation) { + Utils.checkNotNull(pullOperation, "pullOperation"); + this.pullOperation = pullOperation; + 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 RefreshDataTypeResponse build() { + return new RefreshDataTypeResponse( + contentType, + errorMessage, + pullOperation, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/SDKMethodInterfaces.java b/lending/lib/src/main/java/io/codat/lending/models/operations/SDKMethodInterfaces.java new file mode 100644 index 00000000..c8678a9f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/SDKMethodInterfaces.java @@ -0,0 +1,848 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class SDKMethodInterfaces { + + public interface MethodCallCreateCompany { + io.codat.lending.models.operations.CreateCompanyResponse create( + Optional request) throws Exception; + } + + + public interface MethodCallDeleteCompany { + io.codat.lending.models.operations.DeleteCompanyResponse delete( + io.codat.lending.models.operations.DeleteCompanyRequest request) throws Exception; + } + + + public interface MethodCallGetCompany { + io.codat.lending.models.operations.GetCompanyResponse get( + io.codat.lending.models.operations.GetCompanyRequest request) throws Exception; + } + + + public interface MethodCallListCompanies { + io.codat.lending.models.operations.ListCompaniesResponse list( + io.codat.lending.models.operations.ListCompaniesRequest request) throws Exception; + } + + + public interface MethodCallUpdateCompany { + io.codat.lending.models.operations.UpdateCompanyResponse update( + io.codat.lending.models.operations.UpdateCompanyRequest request) throws Exception; + } + + + public interface MethodCallCreateConnection { + io.codat.lending.models.operations.CreateConnectionResponse create( + io.codat.lending.models.operations.CreateConnectionRequest request) throws Exception; + } + + + public interface MethodCallDeleteConnection { + io.codat.lending.models.operations.DeleteConnectionResponse delete( + io.codat.lending.models.operations.DeleteConnectionRequest request) throws Exception; + } + + + public interface MethodCallGetConnection { + io.codat.lending.models.operations.GetConnectionResponse get( + io.codat.lending.models.operations.GetConnectionRequest request) throws Exception; + } + + + public interface MethodCallListConnections { + io.codat.lending.models.operations.ListConnectionsResponse list( + io.codat.lending.models.operations.ListConnectionsRequest request) throws Exception; + } + + + public interface MethodCallUnlinkConnection { + io.codat.lending.models.operations.UnlinkConnectionResponse unlink( + io.codat.lending.models.operations.UnlinkConnectionRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingAccountTransaction { + io.codat.lending.models.operations.GetAccountingAccountTransactionResponse get( + io.codat.lending.models.operations.GetAccountingAccountTransactionRequest request) throws Exception; + } + + + public interface MethodCallListAccountingAccountTransactions { + io.codat.lending.models.operations.ListAccountingAccountTransactionsResponse list( + io.codat.lending.models.operations.ListAccountingAccountTransactionsRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingDirectCostAttachment { + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingDirectCostAttachmentRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingDirectCost { + io.codat.lending.models.operations.GetAccountingDirectCostResponse get( + io.codat.lending.models.operations.GetAccountingDirectCostRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingDirectCostAttachment { + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingDirectCostAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingDirectCosts { + io.codat.lending.models.operations.ListAccountingDirectCostsResponse list( + io.codat.lending.models.operations.ListAccountingDirectCostsRequest request) throws Exception; + } + + + public interface MethodCallListAccountingDirectCostAttachments { + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingDirectCostAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingTransfer { + io.codat.lending.models.operations.GetAccountingTransferResponse get( + io.codat.lending.models.operations.GetAccountingTransferRequest request) throws Exception; + } + + + public interface MethodCallListAccountingTransfers { + io.codat.lending.models.operations.ListAccountingTransfersResponse list( + io.codat.lending.models.operations.ListAccountingTransfersRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingJournalEntry { + io.codat.lending.models.operations.GetAccountingJournalEntryResponse get( + io.codat.lending.models.operations.GetAccountingJournalEntryRequest request) throws Exception; + } + + + public interface MethodCallListAccountingJournalEntries { + io.codat.lending.models.operations.ListAccountingJournalEntriesResponse list( + io.codat.lending.models.operations.ListAccountingJournalEntriesRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingJournal { + io.codat.lending.models.operations.GetAccountingJournalResponse get( + io.codat.lending.models.operations.GetAccountingJournalRequest request) throws Exception; + } + + + public interface MethodCallListAccountingJournals { + io.codat.lending.models.operations.ListAccountingJournalsResponse list( + io.codat.lending.models.operations.ListAccountingJournalsRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBankAccountTransactions { + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsResponse listTransactions( + io.codat.lending.models.operations.ListAccountingBankAccountTransactionsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBankAccount { + io.codat.lending.models.operations.GetAccountingBankAccountResponse get( + io.codat.lending.models.operations.GetAccountingBankAccountRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBankAccounts { + io.codat.lending.models.operations.ListAccountingBankAccountsResponse list( + io.codat.lending.models.operations.ListAccountingBankAccountsRequest request) throws Exception; + } + + + public interface MethodCallListBankingAccountBalances { + io.codat.lending.models.operations.ListBankingAccountBalancesResponse list( + io.codat.lending.models.operations.ListBankingAccountBalancesRequest request) throws Exception; + } + + + public interface MethodCallGetBankingAccount { + io.codat.lending.models.operations.GetBankingAccountResponse get( + io.codat.lending.models.operations.GetBankingAccountRequest request) throws Exception; + } + + + public interface MethodCallListBankingAccounts { + io.codat.lending.models.operations.ListBankingAccountsResponse list( + io.codat.lending.models.operations.ListBankingAccountsRequest request) throws Exception; + } + + + public interface MethodCallGetBankingTransactionCategory { + io.codat.lending.models.operations.GetBankingTransactionCategoryResponse get( + io.codat.lending.models.operations.GetBankingTransactionCategoryRequest request) throws Exception; + } + + + public interface MethodCallListBankingTransactionCategories { + io.codat.lending.models.operations.ListBankingTransactionCategoriesResponse list( + io.codat.lending.models.operations.ListBankingTransactionCategoriesRequest request) throws Exception; + } + + + public interface MethodCallGetBankingTransaction { + io.codat.lending.models.operations.GetBankingTransactionResponse get( + io.codat.lending.models.operations.GetBankingTransactionRequest request) throws Exception; + } + + + public interface MethodCallListBankingTransactions { + io.codat.lending.models.operations.ListBankingTransactionsResponse list( + io.codat.lending.models.operations.ListBankingTransactionsRequest request) throws Exception; + } + + + public interface MethodCallGetCategorizedBankStatement { + io.codat.lending.models.operations.GetCategorizedBankStatementResponse get( + io.codat.lending.models.operations.GetCategorizedBankStatementRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingBillAttachment { + io.codat.lending.models.operations.DownloadAccountingBillAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingBillAttachmentRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBill { + io.codat.lending.models.operations.GetAccountingBillResponse get( + io.codat.lending.models.operations.GetAccountingBillRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBillAttachment { + io.codat.lending.models.operations.GetAccountingBillAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingBillAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBills { + io.codat.lending.models.operations.ListAccountingBillsResponse list( + io.codat.lending.models.operations.ListAccountingBillsRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBillAttachments { + io.codat.lending.models.operations.ListAccountingBillAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingBillAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingSupplierAttachment { + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingSupplierAttachmentRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingSupplier { + io.codat.lending.models.operations.GetAccountingSupplierResponse get( + io.codat.lending.models.operations.GetAccountingSupplierRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingSupplierAttachment { + io.codat.lending.models.operations.GetAccountingSupplierAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingSupplierAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingSuppliers { + io.codat.lending.models.operations.ListAccountingSuppliersResponse list( + io.codat.lending.models.operations.ListAccountingSuppliersRequest request) throws Exception; + } + + + public interface MethodCallListAccountingSupplierAttachments { + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingSupplierAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBillCreditNote { + io.codat.lending.models.operations.GetAccountingBillCreditNoteResponse get( + io.codat.lending.models.operations.GetAccountingBillCreditNoteRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBillCreditNotes { + io.codat.lending.models.operations.ListAccountingBillCreditNotesResponse list( + io.codat.lending.models.operations.ListAccountingBillCreditNotesRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBillPayment { + io.codat.lending.models.operations.GetAccountingBillPaymentResponse get( + io.codat.lending.models.operations.GetAccountingBillPaymentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingBillPayments { + io.codat.lending.models.operations.ListAccountingBillPaymentsResponse list( + io.codat.lending.models.operations.ListAccountingBillPaymentsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceCustomer { + io.codat.lending.models.operations.GetCommerceCustomerResponse get( + io.codat.lending.models.operations.GetCommerceCustomerRequest request) throws Exception; + } + + + public interface MethodCallListCommerceCustomers { + io.codat.lending.models.operations.ListCommerceCustomersResponse list( + io.codat.lending.models.operations.ListCommerceCustomersRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceDispute { + io.codat.lending.models.operations.GetCommerceDisputeResponse get( + io.codat.lending.models.operations.GetCommerceDisputeRequest request) throws Exception; + } + + + public interface MethodCallListCommerceDisputes { + io.codat.lending.models.operations.ListCommerceDisputesResponse list( + io.codat.lending.models.operations.ListCommerceDisputesRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceLocation { + io.codat.lending.models.operations.GetCommerceLocationResponse get( + io.codat.lending.models.operations.GetCommerceLocationRequest request) throws Exception; + } + + + public interface MethodCallListCommerceLocations { + io.codat.lending.models.operations.ListCommerceLocationsResponse list( + io.codat.lending.models.operations.ListCommerceLocationsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceOrder { + io.codat.lending.models.operations.GetCommerceOrderResponse get( + io.codat.lending.models.operations.GetCommerceOrderRequest request) throws Exception; + } + + + public interface MethodCallListCommerceOrders { + io.codat.lending.models.operations.ListCommerceOrdersResponse list( + io.codat.lending.models.operations.ListCommerceOrdersRequest request) throws Exception; + } + + + public interface MethodCallGetCommercePaymentMethod { + io.codat.lending.models.operations.GetCommercePaymentMethodResponse get( + io.codat.lending.models.operations.GetCommercePaymentMethodRequest request) throws Exception; + } + + + public interface MethodCallListCommercePaymentMethods { + io.codat.lending.models.operations.ListCommercePaymentMethodsResponse list( + io.codat.lending.models.operations.ListCommercePaymentMethodsRequest request) throws Exception; + } + + + public interface MethodCallGetCommercePayment { + io.codat.lending.models.operations.GetCommercePaymentResponse get( + io.codat.lending.models.operations.GetCommercePaymentRequest request) throws Exception; + } + + + public interface MethodCallListCommercePayments { + io.codat.lending.models.operations.ListCommercePaymentsResponse list( + io.codat.lending.models.operations.ListCommercePaymentsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceProductCategory { + io.codat.lending.models.operations.GetCommerceProductCategoryResponse get( + io.codat.lending.models.operations.GetCommerceProductCategoryRequest request) throws Exception; + } + + + public interface MethodCallListCommerceProductCategories { + io.codat.lending.models.operations.ListCommerceProductCategoriesResponse list( + io.codat.lending.models.operations.ListCommerceProductCategoriesRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceProduct { + io.codat.lending.models.operations.GetCommerceProductResponse get( + io.codat.lending.models.operations.GetCommerceProductRequest request) throws Exception; + } + + + public interface MethodCallListCommerceProducts { + io.codat.lending.models.operations.ListCommerceProductsResponse list( + io.codat.lending.models.operations.ListCommerceProductsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceTransaction { + io.codat.lending.models.operations.GetCommerceTransactionResponse get( + io.codat.lending.models.operations.GetCommerceTransactionRequest request) throws Exception; + } + + + public interface MethodCallListCommerceTransactions { + io.codat.lending.models.operations.ListCommerceTransactionsResponse list( + io.codat.lending.models.operations.ListCommerceTransactionsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceCustomerRetentionMetrics { + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsResponse getCustomerRetention( + io.codat.lending.models.operations.GetCommerceCustomerRetentionMetricsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceLifetimeValueMetrics { + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsResponse getLifetimeValue( + io.codat.lending.models.operations.GetCommerceLifetimeValueMetricsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceRevenueMetrics { + io.codat.lending.models.operations.GetCommerceRevenueMetricsResponse getRevenue( + io.codat.lending.models.operations.GetCommerceRevenueMetricsRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceOrdersReport { + io.codat.lending.models.operations.GetCommerceOrdersReportResponse getOrders( + io.codat.lending.models.operations.GetCommerceOrdersReportRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceRefundsReport { + io.codat.lending.models.operations.GetCommerceRefundsReportResponse getRefunds( + io.codat.lending.models.operations.GetCommerceRefundsReportRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingProfile { + io.codat.lending.models.operations.GetAccountingProfileResponse getAccountingProfile( + io.codat.lending.models.operations.GetAccountingProfileRequest request) throws Exception; + } + + + public interface MethodCallGetCommerceProfile { + io.codat.lending.models.operations.GetCommerceProfileResponse getCommerceProfile( + io.codat.lending.models.operations.GetCommerceProfileRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingCustomerAttachment { + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingCustomerAttachmentRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingCustomer { + io.codat.lending.models.operations.GetAccountingCustomerResponse get( + io.codat.lending.models.operations.GetAccountingCustomerRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingCustomerAttachment { + io.codat.lending.models.operations.GetAccountingCustomerAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingCustomerAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingCustomers { + io.codat.lending.models.operations.ListAccountingCustomersResponse list( + io.codat.lending.models.operations.ListAccountingCustomersRequest request) throws Exception; + } + + + public interface MethodCallListAccountingCustomerAttachments { + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingCustomerAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingDirectIncomeAttachment { + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingDirectIncomeAttachmentRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingDirectIncome { + io.codat.lending.models.operations.GetAccountingDirectIncomeResponse get( + io.codat.lending.models.operations.GetAccountingDirectIncomeRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingDirectIncomeAttachment { + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingDirectIncomeAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingDirectIncomes { + io.codat.lending.models.operations.ListAccountingDirectIncomesResponse list( + io.codat.lending.models.operations.ListAccountingDirectIncomesRequest request) throws Exception; + } + + + public interface MethodCallListAccountingDirectIncomeAttachments { + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingDirectIncomeAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingInvoiceAttachment { + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentResponse downloadAttachment( + io.codat.lending.models.operations.DownloadAccountingInvoiceAttachmentRequest request) throws Exception; + } + + + public interface MethodCallDownloadAccountingInvoicePdf { + io.codat.lending.models.operations.DownloadAccountingInvoicePdfResponse downloadPdf( + io.codat.lending.models.operations.DownloadAccountingInvoicePdfRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingInvoice { + io.codat.lending.models.operations.GetAccountingInvoiceResponse get( + io.codat.lending.models.operations.GetAccountingInvoiceRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingInvoiceAttachment { + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentResponse getAttachment( + io.codat.lending.models.operations.GetAccountingInvoiceAttachmentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingInvoices { + io.codat.lending.models.operations.ListAccountingInvoicesResponse list( + io.codat.lending.models.operations.ListAccountingInvoicesRequest request) throws Exception; + } + + + public interface MethodCallListAccountingInvoiceAttachments { + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsResponse listAttachments( + io.codat.lending.models.operations.ListAccountingInvoiceAttachmentsRequest request) throws Exception; + } + + + public interface MethodCallListReconciledInvoices { + io.codat.lending.models.operations.ListReconciledInvoicesResponse listReconciled( + io.codat.lending.models.operations.ListReconciledInvoicesRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingCreditNote { + io.codat.lending.models.operations.GetAccountingCreditNoteResponse get( + io.codat.lending.models.operations.GetAccountingCreditNoteRequest request) throws Exception; + } + + + public interface MethodCallListAccountingCreditNotes { + io.codat.lending.models.operations.ListAccountingCreditNotesResponse list( + io.codat.lending.models.operations.ListAccountingCreditNotesRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingPayment { + io.codat.lending.models.operations.GetAccountingPaymentResponse get( + io.codat.lending.models.operations.GetAccountingPaymentRequest request) throws Exception; + } + + + public interface MethodCallListAccountingPayments { + io.codat.lending.models.operations.ListAccountingPaymentsResponse list( + io.codat.lending.models.operations.ListAccountingPaymentsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingAgedCreditorsReport { + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportResponse getAgedCreditors( + io.codat.lending.models.operations.GetAccountingAgedCreditorsReportRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingAgedDebtorsReport { + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportResponse getAgedDebtors( + io.codat.lending.models.operations.GetAccountingAgedDebtorsReportRequest request) throws Exception; + } + + + public interface MethodCallIsAgedCreditorsReportAvailable { + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableResponse isAgedCreditorsAvailable( + io.codat.lending.models.operations.IsAgedCreditorsReportAvailableRequest request) throws Exception; + } + + + public interface MethodCallIsAgedDebtorsReportAvailable { + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableResponse isAgedDebtorsAvailable( + io.codat.lending.models.operations.IsAgedDebtorsReportAvailableRequest request) throws Exception; + } + + + public interface MethodCallDownloadFiles { + io.codat.lending.models.operations.DownloadFilesResponse download( + io.codat.lending.models.operations.DownloadFilesRequest request) throws Exception; + } + + + public interface MethodCallListFiles { + io.codat.lending.models.operations.ListFilesResponse listUploaded( + io.codat.lending.models.operations.ListFilesRequest request) throws Exception; + } + + + public interface MethodCallUploadFiles { + io.codat.lending.models.operations.UploadFilesResponse upload( + io.codat.lending.models.operations.UploadFilesRequest request) throws Exception; + } + + + public interface MethodCallCreateBankAccount { + io.codat.lending.models.operations.CreateBankAccountResponse create( + io.codat.lending.models.operations.CreateBankAccountRequest request) throws Exception; + } + + + public interface MethodCallGetCreateUpdateBankAccountsModel { + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelResponse getCreateUpdateModel( + io.codat.lending.models.operations.GetCreateUpdateBankAccountsModelRequest request) throws Exception; + } + + + public interface MethodCallCreateBankTransactions { + io.codat.lending.models.operations.CreateBankTransactionsResponse create( + io.codat.lending.models.operations.CreateBankTransactionsRequest request) throws Exception; + } + + + public interface MethodCallGetCreateBankTransactionsModel { + io.codat.lending.models.operations.GetCreateBankTransactionsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateBankTransactionsModelRequest request) throws Exception; + } + + + public interface MethodCallCreateAccount { + io.codat.lending.models.operations.CreateAccountResponse create( + io.codat.lending.models.operations.CreateAccountRequest request) throws Exception; + } + + + public interface MethodCallGetCreateChartOfAccountsModel { + io.codat.lending.models.operations.GetCreateChartOfAccountsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateChartOfAccountsModelRequest request) throws Exception; + } + + + public interface MethodCallCreateDirectCost { + io.codat.lending.models.operations.CreateDirectCostResponse create( + io.codat.lending.models.operations.CreateDirectCostRequest request) throws Exception; + } + + + public interface MethodCallGetCreateDirectCostsModel { + io.codat.lending.models.operations.GetCreateDirectCostsModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateDirectCostsModelRequest request) throws Exception; + } + + + public interface MethodCallCreatePayment { + io.codat.lending.models.operations.CreatePaymentResponse create( + io.codat.lending.models.operations.CreatePaymentRequest request) throws Exception; + } + + + public interface MethodCallGetCreatePaymentModel { + io.codat.lending.models.operations.GetCreatePaymentModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreatePaymentModelRequest request) throws Exception; + } + + + public interface MethodCallCreateSupplier { + io.codat.lending.models.operations.CreateSupplierResponse create( + io.codat.lending.models.operations.CreateSupplierRequest request) throws Exception; + } + + + public interface MethodCallGetCreateUpdateSuppliersModel { + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelResponse getCreateUpdateModel( + io.codat.lending.models.operations.GetCreateUpdateSuppliersModelRequest request) throws Exception; + } + + + public interface MethodCallCreateTransfer { + io.codat.lending.models.operations.CreateTransferResponse create( + io.codat.lending.models.operations.CreateTransferRequest request) throws Exception; + } + + + public interface MethodCallGetCreateTransfersModel { + io.codat.lending.models.operations.GetCreateTransfersModelResponse getCreateModel( + io.codat.lending.models.operations.GetCreateTransfersModelRequest request) throws Exception; + } + + + public interface MethodCallGetCreateOperation { + io.codat.lending.models.operations.GetCreateOperationResponse get( + io.codat.lending.models.operations.GetCreateOperationRequest request) throws Exception; + } + + + public interface MethodCallListCreateOperations { + io.codat.lending.models.operations.ListCreateOperationsResponse list( + io.codat.lending.models.operations.ListCreateOperationsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingAccount { + io.codat.lending.models.operations.GetAccountingAccountResponse get( + io.codat.lending.models.operations.GetAccountingAccountRequest request) throws Exception; + } + + + public interface MethodCallListAccountingAccounts { + io.codat.lending.models.operations.ListAccountingAccountsResponse list( + io.codat.lending.models.operations.ListAccountingAccountsRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingBalanceSheet { + io.codat.lending.models.operations.GetAccountingBalanceSheetResponse get( + io.codat.lending.models.operations.GetAccountingBalanceSheetRequest request) throws Exception; + } + + + public interface MethodCallGetCategorizedBalanceSheetStatement { + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementResponse getCategorizedAccounts( + io.codat.lending.models.operations.GetCategorizedBalanceSheetStatementRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingCashFlowStatement { + io.codat.lending.models.operations.GetAccountingCashFlowStatementResponse get( + io.codat.lending.models.operations.GetAccountingCashFlowStatementRequest request) throws Exception; + } + + + public interface MethodCallGetAccountingProfitAndLoss { + io.codat.lending.models.operations.GetAccountingProfitAndLossResponse get( + io.codat.lending.models.operations.GetAccountingProfitAndLossRequest request) throws Exception; + } + + + public interface MethodCallGetCategorizedProfitAndLossStatement { + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementResponse getCategorizedAccounts( + io.codat.lending.models.operations.GetCategorizedProfitAndLossStatementRequest request) throws Exception; + } + + + public interface MethodCallGetDataStatus { + io.codat.lending.models.operations.GetDataStatusResponse getStatus( + io.codat.lending.models.operations.GetDataStatusRequest request) throws Exception; + } + + + public interface MethodCallRefreshAllDataTypes { + io.codat.lending.models.operations.RefreshAllDataTypesResponse allDataTypes( + io.codat.lending.models.operations.RefreshAllDataTypesRequest request) throws Exception; + } + + + public interface MethodCallRefreshDataType { + io.codat.lending.models.operations.RefreshDataTypeResponse dataType( + io.codat.lending.models.operations.RefreshDataTypeRequest request) throws Exception; + } + + + public interface MethodCallGetPullOperation { + io.codat.lending.models.operations.GetPullOperationResponse get( + io.codat.lending.models.operations.GetPullOperationRequest request) throws Exception; + } + + + public interface MethodCallListPullOperations { + io.codat.lending.models.operations.ListPullOperationsResponse list( + io.codat.lending.models.operations.ListPullOperationsRequest request) throws Exception; + } + + + public interface MethodCallGenerateLoanSummary { + io.codat.lending.models.operations.GenerateLoanSummaryResponse generateLoanSummary( + io.codat.lending.models.operations.GenerateLoanSummaryRequest request) throws Exception; + } + + + public interface MethodCallGenerateLoanTransactions { + io.codat.lending.models.operations.GenerateLoanTransactionsResponse generateLoanTransactions( + io.codat.lending.models.operations.GenerateLoanTransactionsRequest request) throws Exception; + } + + + public interface MethodCallGetLoanSummary { + io.codat.lending.models.operations.GetLoanSummaryResponse getLoanSummary( + io.codat.lending.models.operations.GetLoanSummaryRequest request) throws Exception; + } + + + public interface MethodCallListLoanTransactions { + io.codat.lending.models.operations.ListLoanTransactionsResponse listLoanTransactions( + io.codat.lending.models.operations.ListLoanTransactionsRequest request) throws Exception; + } + + + public interface MethodCallListDataIntegrityDetails { + io.codat.lending.models.operations.ListDataIntegrityDetailsResponse details( + io.codat.lending.models.operations.ListDataIntegrityDetailsRequest request) throws Exception; + } + + + public interface MethodCallGetDataIntegrityStatus { + io.codat.lending.models.operations.GetDataIntegrityStatusResponse status( + io.codat.lending.models.operations.GetDataIntegrityStatusRequest request) throws Exception; + } + + + public interface MethodCallGetDataIntegritySummaries { + io.codat.lending.models.operations.GetDataIntegritySummariesResponse summaries( + io.codat.lending.models.operations.GetDataIntegritySummariesRequest request) throws Exception; + } + + + public interface MethodCallDownloadExcelReport { + io.codat.lending.models.operations.DownloadExcelReportResponse download( + io.codat.lending.models.operations.DownloadExcelReportRequest request) throws Exception; + } + + + public interface MethodCallGenerateExcelReport { + io.codat.lending.models.operations.GenerateExcelReportResponse generate( + io.codat.lending.models.operations.GenerateExcelReportRequest request) throws Exception; + } + + + public interface MethodCallGetExcelReportGenerationStatus { + io.codat.lending.models.operations.GetExcelReportGenerationStatusResponse getStatus( + io.codat.lending.models.operations.GetExcelReportGenerationStatusRequest request) throws Exception; + } + +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/SourceType.java b/lending/lib/src/main/java/io/codat/lending/models/operations/SourceType.java new file mode 100644 index 00000000..a163c77c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/SourceType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * SourceType - Data source type. + */ +public enum SourceType { + BANKING("banking"), + COMMERCE("commerce"), + ACCOUNTING("accounting"); + + @JsonValue + private final String value; + + private SourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequest.java new file mode 100644 index 00000000..7d3853dc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequest.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class UnlinkConnectionRequest { + + @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; + + public UnlinkConnectionRequest( + 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 Optional requestBody() { + return requestBody; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + public UnlinkConnectionRequest withRequestBody(UnlinkConnectionUpdateConnection requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.ofNullable(requestBody); + return this; + } + + public UnlinkConnectionRequest withRequestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public UnlinkConnectionRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public UnlinkConnectionRequest 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; + } + UnlinkConnectionRequest other = (UnlinkConnectionRequest) o; + return + java.util.Objects.deepEquals(this.requestBody, other.requestBody) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + requestBody, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(UnlinkConnectionRequest.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(UnlinkConnectionUpdateConnection 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 UnlinkConnectionRequest build() { + return new UnlinkConnectionRequest( + requestBody, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequestBuilder.java new file mode 100644 index 00000000..d289cbc1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class UnlinkConnectionRequestBuilder { + + private UnlinkConnectionRequest request; + + private final SDKMethodInterfaces.MethodCallUnlinkConnection sdk; + + public UnlinkConnectionRequestBuilder(SDKMethodInterfaces.MethodCallUnlinkConnection sdk) { + this.sdk = sdk; + } + + public UnlinkConnectionRequestBuilder request(UnlinkConnectionRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UnlinkConnectionResponse call() throws Exception { + return sdk.unlink( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionResponse.java new file mode 100644 index 00000000..519bc747 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UnlinkConnectionResponse { + + /** + * OK + */ + private Optional connection; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public UnlinkConnectionResponse( + Optional connection, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(connection, "connection"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.connection = connection; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional connection() { + return connection; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public UnlinkConnectionResponse withConnection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public UnlinkConnectionResponse withConnection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public UnlinkConnectionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public UnlinkConnectionResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public UnlinkConnectionResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UnlinkConnectionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UnlinkConnectionResponse 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; + } + UnlinkConnectionResponse other = (UnlinkConnectionResponse) o; + return + java.util.Objects.deepEquals(this.connection, other.connection) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UnlinkConnectionResponse.class, + "connection", connection, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional connection = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder connection(io.codat.lending.models.shared.Connection connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = Optional.ofNullable(connection); + return this; + } + + /** + * OK + */ + public Builder connection(Optional connection) { + Utils.checkNotNull(connection, "connection"); + this.connection = connection; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 UnlinkConnectionResponse build() { + return new UnlinkConnectionResponse( + connection, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionUpdateConnection.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionUpdateConnection.java new file mode 100644 index 00000000..ec30c516 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UnlinkConnectionUpdateConnection.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class UnlinkConnectionUpdateConnection { + + /** + * The current authorization status of the data connection. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + public UnlinkConnectionUpdateConnection( + @JsonProperty("status") Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + } + + /** + * The current authorization status of the data connection. + */ + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The current authorization status of the data connection. + */ + public UnlinkConnectionUpdateConnection withStatus(io.codat.lending.models.shared.DataConnectionStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The current authorization status of the data connection. + */ + public UnlinkConnectionUpdateConnection withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlinkConnectionUpdateConnection other = (UnlinkConnectionUpdateConnection) o; + return + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + status); + } + + @Override + public String toString() { + return Utils.toString(UnlinkConnectionUpdateConnection.class, + "status", status); + } + + public final static class Builder { + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The current authorization status of the data connection. + */ + public Builder status(io.codat.lending.models.shared.DataConnectionStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The current authorization status of the data connection. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public UnlinkConnectionUpdateConnection build() { + return new UnlinkConnectionUpdateConnection( + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequest.java new file mode 100644 index 00000000..6fd82a3a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequest.java @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class UpdateCompanyRequest { + + @SpeakeasyMetadata("request:mediaType=application/json") + private Optional companyRequestBody; + + /** + * Unique identifier for a company. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId") + private String companyId; + + public UpdateCompanyRequest( + Optional companyRequestBody, + String companyId) { + Utils.checkNotNull(companyRequestBody, "companyRequestBody"); + Utils.checkNotNull(companyId, "companyId"); + this.companyRequestBody = companyRequestBody; + this.companyId = companyId; + } + + public Optional companyRequestBody() { + return companyRequestBody; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + public final static Builder builder() { + return new Builder(); + } + + public UpdateCompanyRequest withCompanyRequestBody(io.codat.lending.models.shared.CompanyRequestBody companyRequestBody) { + Utils.checkNotNull(companyRequestBody, "companyRequestBody"); + this.companyRequestBody = Optional.ofNullable(companyRequestBody); + return this; + } + + public UpdateCompanyRequest withCompanyRequestBody(Optional companyRequestBody) { + Utils.checkNotNull(companyRequestBody, "companyRequestBody"); + this.companyRequestBody = companyRequestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public UpdateCompanyRequest 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; + } + UpdateCompanyRequest other = (UpdateCompanyRequest) o; + return + java.util.Objects.deepEquals(this.companyRequestBody, other.companyRequestBody) && + java.util.Objects.deepEquals(this.companyId, other.companyId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyRequestBody, + companyId); + } + + @Override + public String toString() { + return Utils.toString(UpdateCompanyRequest.class, + "companyRequestBody", companyRequestBody, + "companyId", companyId); + } + + public final static class Builder { + + private Optional companyRequestBody = Optional.empty(); + + private String companyId; + + private Builder() { + // force use of static builder() method + } + + public Builder companyRequestBody(io.codat.lending.models.shared.CompanyRequestBody companyRequestBody) { + Utils.checkNotNull(companyRequestBody, "companyRequestBody"); + this.companyRequestBody = Optional.ofNullable(companyRequestBody); + return this; + } + + public Builder companyRequestBody(Optional companyRequestBody) { + Utils.checkNotNull(companyRequestBody, "companyRequestBody"); + this.companyRequestBody = companyRequestBody; + return this; + } + + /** + * Unique identifier for a company. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public UpdateCompanyRequest build() { + return new UpdateCompanyRequest( + companyRequestBody, + companyId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequestBuilder.java new file mode 100644 index 00000000..638774ff --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class UpdateCompanyRequestBuilder { + + private UpdateCompanyRequest request; + + private final SDKMethodInterfaces.MethodCallUpdateCompany sdk; + + public UpdateCompanyRequestBuilder(SDKMethodInterfaces.MethodCallUpdateCompany sdk) { + this.sdk = sdk; + } + + public UpdateCompanyRequestBuilder request(UpdateCompanyRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UpdateCompanyResponse call() throws Exception { + return sdk.update( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyResponse.java new file mode 100644 index 00000000..775cf6f2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UpdateCompanyResponse.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UpdateCompanyResponse { + + /** + * OK + */ + private Optional company; + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * Your API request was not properly authorized. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public UpdateCompanyResponse( + Optional company, + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(company, "company"); + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.company = company; + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * OK + */ + public Optional company() { + return company; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * Your API request was not properly authorized. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * OK + */ + public UpdateCompanyResponse withCompany(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public UpdateCompanyResponse withCompany(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public UpdateCompanyResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public UpdateCompanyResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public UpdateCompanyResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdateCompanyResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdateCompanyResponse 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; + } + UpdateCompanyResponse other = (UpdateCompanyResponse) o; + return + java.util.Objects.deepEquals(this.company, other.company) && + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdateCompanyResponse.class, + "company", company, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private Optional company = Optional.empty(); + + private String contentType; + + private Optional errorMessage = Optional.empty(); + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + /** + * OK + */ + public Builder company(io.codat.lending.models.shared.Company company) { + Utils.checkNotNull(company, "company"); + this.company = Optional.ofNullable(company); + return this; + } + + /** + * OK + */ + public Builder company(Optional company) { + Utils.checkNotNull(company, "company"); + this.company = company; + return this; + } + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Your API request was not properly authorized. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 UpdateCompanyResponse build() { + return new UpdateCompanyResponse( + company, + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequest.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequest.java new file mode 100644 index 00000000..508b957e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequest.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class UploadFilesRequest { + + @SpeakeasyMetadata("request:mediaType=multipart/form-data") + private Optional fileUpload; + + /** + * 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; + + public UploadFilesRequest( + Optional fileUpload, + String companyId, + String connectionId) { + Utils.checkNotNull(fileUpload, "fileUpload"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(connectionId, "connectionId"); + this.fileUpload = fileUpload; + this.companyId = companyId; + this.connectionId = connectionId; + } + + public Optional fileUpload() { + return fileUpload; + } + + /** + * Unique identifier for a company. + */ + public String companyId() { + return companyId; + } + + /** + * Unique identifier for a connection. + */ + public String connectionId() { + return connectionId; + } + + public final static Builder builder() { + return new Builder(); + } + + public UploadFilesRequest withFileUpload(io.codat.lending.models.shared.FileUpload fileUpload) { + Utils.checkNotNull(fileUpload, "fileUpload"); + this.fileUpload = Optional.ofNullable(fileUpload); + return this; + } + + public UploadFilesRequest withFileUpload(Optional fileUpload) { + Utils.checkNotNull(fileUpload, "fileUpload"); + this.fileUpload = fileUpload; + return this; + } + + /** + * Unique identifier for a company. + */ + public UploadFilesRequest withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + /** + * Unique identifier for a connection. + */ + public UploadFilesRequest 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; + } + UploadFilesRequest other = (UploadFilesRequest) o; + return + java.util.Objects.deepEquals(this.fileUpload, other.fileUpload) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + fileUpload, + companyId, + connectionId); + } + + @Override + public String toString() { + return Utils.toString(UploadFilesRequest.class, + "fileUpload", fileUpload, + "companyId", companyId, + "connectionId", connectionId); + } + + public final static class Builder { + + private Optional fileUpload = Optional.empty(); + + private String companyId; + + private String connectionId; + + private Builder() { + // force use of static builder() method + } + + public Builder fileUpload(io.codat.lending.models.shared.FileUpload fileUpload) { + Utils.checkNotNull(fileUpload, "fileUpload"); + this.fileUpload = Optional.ofNullable(fileUpload); + return this; + } + + public Builder fileUpload(Optional fileUpload) { + Utils.checkNotNull(fileUpload, "fileUpload"); + this.fileUpload = fileUpload; + 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 UploadFilesRequest build() { + return new UploadFilesRequest( + fileUpload, + companyId, + connectionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequestBuilder.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequestBuilder.java new file mode 100644 index 00000000..d9b13b2c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesRequestBuilder.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import com.fasterxml.jackson.core.type.TypeReference; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +import io.codat.lending.CodatLending; +import io.codat.lending.utils.Utils; +import io.codat.lending.utils.LazySingletonValue; + +public class UploadFilesRequestBuilder { + + private UploadFilesRequest request; + + private final SDKMethodInterfaces.MethodCallUploadFiles sdk; + + public UploadFilesRequestBuilder(SDKMethodInterfaces.MethodCallUploadFiles sdk) { + this.sdk = sdk; + } + + public UploadFilesRequestBuilder request(UploadFilesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public UploadFilesResponse call() throws Exception { + return sdk.upload( + request); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesResponse.java b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesResponse.java new file mode 100644 index 00000000..9705e14b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/operations/UploadFilesResponse.java @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.operations; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class UploadFilesResponse { + + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * The request made is not valid. + */ + private Optional errorMessage; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + public UploadFilesResponse( + String contentType, + Optional errorMessage, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.errorMessage = errorMessage; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * The request made is not valid. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public UploadFilesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * The request made is not valid. + */ + public UploadFilesResponse withErrorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public UploadFilesResponse withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UploadFilesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadFilesResponse 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; + } + UploadFilesResponse other = (UploadFilesResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + errorMessage, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UploadFilesResponse.class, + "contentType", contentType, + "errorMessage", errorMessage, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + private Optional errorMessage = 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; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(io.codat.lending.models.shared.ErrorMessage errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * The request made is not valid. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 UploadFilesResponse build() { + return new UploadFilesResponse( + contentType, + errorMessage, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalance.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalance.java new file mode 100644 index 00000000..bc34405d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalance.java @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountBalance { + + /** + * The account's current balance + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("available") + private Optional available; + + /** + * The currency of the account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Funds that are not yet available in the balance + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pending") + private Optional pending; + + /** + * Funds reserved as holdings + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reserved") + private Optional reserved; + + public AccountBalance( + @JsonProperty("available") Optional available, + @JsonProperty("currency") Optional currency, + @JsonProperty("pending") Optional pending, + @JsonProperty("reserved") Optional reserved) { + Utils.checkNotNull(available, "available"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(pending, "pending"); + Utils.checkNotNull(reserved, "reserved"); + this.available = available; + this.currency = currency; + this.pending = pending; + this.reserved = reserved; + } + + /** + * The account's current balance + */ + public Optional available() { + return available; + } + + /** + * The currency of the account + */ + public Optional currency() { + return currency; + } + + /** + * Funds that are not yet available in the balance + */ + public Optional pending() { + return pending; + } + + /** + * Funds reserved as holdings + */ + public Optional reserved() { + return reserved; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The account's current balance + */ + public AccountBalance withAvailable(double available) { + Utils.checkNotNull(available, "available"); + this.available = Optional.ofNullable(available); + return this; + } + + /** + * The account's current balance + */ + public AccountBalance withAvailable(Optional available) { + Utils.checkNotNull(available, "available"); + this.available = available; + return this; + } + + /** + * The currency of the account + */ + public AccountBalance withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency of the account + */ + public AccountBalance withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Funds that are not yet available in the balance + */ + public AccountBalance withPending(double pending) { + Utils.checkNotNull(pending, "pending"); + this.pending = Optional.ofNullable(pending); + return this; + } + + /** + * Funds that are not yet available in the balance + */ + public AccountBalance withPending(Optional pending) { + Utils.checkNotNull(pending, "pending"); + this.pending = pending; + return this; + } + + /** + * Funds reserved as holdings + */ + public AccountBalance withReserved(java.lang.Object reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = Optional.ofNullable(reserved); + return this; + } + + /** + * Funds reserved as holdings + */ + public AccountBalance withReserved(Optional reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountBalance other = (AccountBalance) o; + return + java.util.Objects.deepEquals(this.available, other.available) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.pending, other.pending) && + java.util.Objects.deepEquals(this.reserved, other.reserved); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + available, + currency, + pending, + reserved); + } + + @Override + public String toString() { + return Utils.toString(AccountBalance.class, + "available", available, + "currency", currency, + "pending", pending, + "reserved", reserved); + } + + public final static class Builder { + + private Optional available = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional pending = Optional.empty(); + + private Optional reserved = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The account's current balance + */ + public Builder available(double available) { + Utils.checkNotNull(available, "available"); + this.available = Optional.ofNullable(available); + return this; + } + + /** + * The account's current balance + */ + public Builder available(Optional available) { + Utils.checkNotNull(available, "available"); + this.available = available; + return this; + } + + /** + * The currency of the account + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency of the account + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Funds that are not yet available in the balance + */ + public Builder pending(double pending) { + Utils.checkNotNull(pending, "pending"); + this.pending = Optional.ofNullable(pending); + return this; + } + + /** + * Funds that are not yet available in the balance + */ + public Builder pending(Optional pending) { + Utils.checkNotNull(pending, "pending"); + this.pending = pending; + return this; + } + + /** + * Funds reserved as holdings + */ + public Builder reserved(java.lang.Object reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = Optional.ofNullable(reserved); + return this; + } + + /** + * Funds reserved as holdings + */ + public Builder reserved(Optional reserved) { + Utils.checkNotNull(reserved, "reserved"); + this.reserved = reserved; + return this; + } + + public AccountBalance build() { + return new AccountBalance( + available, + currency, + pending, + reserved); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalanceAmounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalanceAmounts.java new file mode 100644 index 00000000..b171d723 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountBalanceAmounts.java @@ -0,0 +1,238 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountBalanceAmounts - Depending on the data provided by the underlying bank, not all balances are always available. + */ + +public class AccountBalanceAmounts { + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("available") + private JsonNullable available; + + /** + * The balance of the account only including cleared transactions. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("current") + private Optional current; + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("limit") + private JsonNullable limit; + + public AccountBalanceAmounts( + @JsonProperty("available") JsonNullable available, + @JsonProperty("current") Optional current, + @JsonProperty("limit") JsonNullable limit) { + Utils.checkNotNull(available, "available"); + Utils.checkNotNull(current, "current"); + Utils.checkNotNull(limit, "limit"); + this.available = available; + this.current = current; + this.limit = limit; + } + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + public JsonNullable available() { + return available; + } + + /** + * The balance of the account only including cleared transactions. + */ + public Optional current() { + return current; + } + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + public JsonNullable limit() { + return limit; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + public AccountBalanceAmounts withAvailable(double available) { + Utils.checkNotNull(available, "available"); + this.available = JsonNullable.of(available); + return this; + } + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + public AccountBalanceAmounts withAvailable(JsonNullable available) { + Utils.checkNotNull(available, "available"); + this.available = available; + return this; + } + + /** + * The balance of the account only including cleared transactions. + */ + public AccountBalanceAmounts withCurrent(double current) { + Utils.checkNotNull(current, "current"); + this.current = Optional.ofNullable(current); + return this; + } + + /** + * The balance of the account only including cleared transactions. + */ + public AccountBalanceAmounts withCurrent(Optional current) { + Utils.checkNotNull(current, "current"); + this.current = current; + return this; + } + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + public AccountBalanceAmounts withLimit(double limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = JsonNullable.of(limit); + return this; + } + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + public AccountBalanceAmounts withLimit(JsonNullable limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountBalanceAmounts other = (AccountBalanceAmounts) o; + return + java.util.Objects.deepEquals(this.available, other.available) && + java.util.Objects.deepEquals(this.current, other.current) && + java.util.Objects.deepEquals(this.limit, other.limit); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + available, + current, + limit); + } + + @Override + public String toString() { + return Utils.toString(AccountBalanceAmounts.class, + "available", available, + "current", current, + "limit", limit); + } + + public final static class Builder { + + private JsonNullable available = JsonNullable.undefined(); + + private Optional current = Optional.empty(); + + private JsonNullable limit = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + public Builder available(double available) { + Utils.checkNotNull(available, "available"); + this.available = JsonNullable.of(available); + return this; + } + + /** + * The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. + */ + public Builder available(JsonNullable available) { + Utils.checkNotNull(available, "available"); + this.available = available; + return this; + } + + /** + * The balance of the account only including cleared transactions. + */ + public Builder current(double current) { + Utils.checkNotNull(current, "current"); + this.current = Optional.ofNullable(current); + return this; + } + + /** + * The balance of the account only including cleared transactions. + */ + public Builder current(Optional current) { + Utils.checkNotNull(current, "current"); + this.current = current; + return this; + } + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + public Builder limit(double limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = JsonNullable.of(limit); + return this; + } + + /** + * The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. + */ + public Builder limit(JsonNullable limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + public AccountBalanceAmounts build() { + return new AccountBalanceAmounts( + available, + current, + limit); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhook.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhook.java new file mode 100644 index 00000000..12ff0905 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhook.java @@ -0,0 +1,573 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountCategoriesUpdatedWebhook - Webhook request body for account categories updated. + */ + +public class AccountCategoriesUpdatedWebhook { + + /** + * Unique identifier of the webhook event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("AlertId") + private Optional alertId; + + /** + * Unique identifier for your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientId") + private Optional clientId; + + /** + * Name of your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientName") + private Optional clientName; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("CompanyId") + private Optional companyId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Data") + private Optional data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("DataConnectionId") + private Optional dataConnectionId; + + /** + * A human readable message about the webhook. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Message") + private Optional message; + + /** + * Unique identifier for the rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleId") + private Optional ruleId; + + /** + * The type of rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleType") + private Optional ruleType; + + public AccountCategoriesUpdatedWebhook( + @JsonProperty("AlertId") Optional alertId, + @JsonProperty("ClientId") Optional clientId, + @JsonProperty("ClientName") Optional clientName, + @JsonProperty("CompanyId") Optional companyId, + @JsonProperty("Data") Optional data, + @JsonProperty("DataConnectionId") Optional dataConnectionId, + @JsonProperty("Message") Optional message, + @JsonProperty("RuleId") Optional ruleId, + @JsonProperty("RuleType") Optional ruleType) { + Utils.checkNotNull(alertId, "alertId"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(clientName, "clientName"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(ruleId, "ruleId"); + Utils.checkNotNull(ruleType, "ruleType"); + this.alertId = alertId; + this.clientId = clientId; + this.clientName = clientName; + this.companyId = companyId; + this.data = data; + this.dataConnectionId = dataConnectionId; + this.message = message; + this.ruleId = ruleId; + this.ruleType = ruleType; + } + + /** + * Unique identifier of the webhook event. + */ + public Optional alertId() { + return alertId; + } + + /** + * Unique identifier for your client in Codat. + */ + public Optional clientId() { + return clientId; + } + + /** + * Name of your client in Codat. + */ + public Optional clientName() { + return clientName; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Optional companyId() { + return companyId; + } + + public Optional data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public Optional dataConnectionId() { + return dataConnectionId; + } + + /** + * A human readable message about the webhook. + */ + public Optional message() { + return message; + } + + /** + * Unique identifier for the rule. + */ + public Optional ruleId() { + return ruleId; + } + + /** + * The type of rule. + */ + public Optional ruleType() { + return ruleType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier of the webhook event. + */ + public AccountCategoriesUpdatedWebhook withAlertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public AccountCategoriesUpdatedWebhook withAlertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public AccountCategoriesUpdatedWebhook withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public AccountCategoriesUpdatedWebhook withClientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public AccountCategoriesUpdatedWebhook withClientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public AccountCategoriesUpdatedWebhook withClientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountCategoriesUpdatedWebhook withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountCategoriesUpdatedWebhook withCompanyId(Optional companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public AccountCategoriesUpdatedWebhook withData(AccountCategoriesUpdatedWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public AccountCategoriesUpdatedWebhook withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountCategoriesUpdatedWebhook withDataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountCategoriesUpdatedWebhook withDataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * A human readable message about the webhook. + */ + public AccountCategoriesUpdatedWebhook withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public AccountCategoriesUpdatedWebhook withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public AccountCategoriesUpdatedWebhook withRuleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public AccountCategoriesUpdatedWebhook withRuleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public AccountCategoriesUpdatedWebhook withRuleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public AccountCategoriesUpdatedWebhook withRuleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountCategoriesUpdatedWebhook other = (AccountCategoriesUpdatedWebhook) o; + return + java.util.Objects.deepEquals(this.alertId, other.alertId) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.clientName, other.clientName) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionId, other.dataConnectionId) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.ruleId, other.ruleId) && + java.util.Objects.deepEquals(this.ruleType, other.ruleType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + alertId, + clientId, + clientName, + companyId, + data, + dataConnectionId, + message, + ruleId, + ruleType); + } + + @Override + public String toString() { + return Utils.toString(AccountCategoriesUpdatedWebhook.class, + "alertId", alertId, + "clientId", clientId, + "clientName", clientName, + "companyId", companyId, + "data", data, + "dataConnectionId", dataConnectionId, + "message", message, + "ruleId", ruleId, + "ruleType", ruleType); + } + + public final static class Builder { + + private Optional alertId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientName = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional dataConnectionId = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional ruleId = Optional.empty(); + + private Optional ruleType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(Optional companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + return this; + } + + public Builder data(AccountCategoriesUpdatedWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + public AccountCategoriesUpdatedWebhook build() { + return new AccountCategoriesUpdatedWebhook( + alertId, + clientId, + clientName, + companyId, + data, + dataConnectionId, + message, + ruleId, + ruleType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhookData.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhookData.java new file mode 100644 index 00000000..e0f1ab1f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoriesUpdatedWebhookData.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountCategoriesUpdatedWebhookData { + + /** + * The date on which this account categories were last modified in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + public AccountCategoriesUpdatedWebhookData( + @JsonProperty("modifiedDate") Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + } + + /** + * The date on which this account categories were last modified in Codat. + */ + public Optional modifiedDate() { + return modifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The date on which this account categories were last modified in Codat. + */ + public AccountCategoriesUpdatedWebhookData withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + /** + * The date on which this account categories were last modified in Codat. + */ + public AccountCategoriesUpdatedWebhookData withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountCategoriesUpdatedWebhookData other = (AccountCategoriesUpdatedWebhookData) o; + return + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + modifiedDate); + } + + @Override + public String toString() { + return Utils.toString(AccountCategoriesUpdatedWebhookData.class, + "modifiedDate", modifiedDate); + } + + public final static class Builder { + + private Optional modifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The date on which this account categories were last modified in Codat. + */ + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + /** + * The date on which this account categories were last modified in Codat. + */ + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public AccountCategoriesUpdatedWebhookData build() { + return new AccountCategoriesUpdatedWebhookData( + modifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoryLevel.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoryLevel.java new file mode 100644 index 00000000..746022ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountCategoryLevel.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountCategoryLevel - An object containing an ordered list of account category levels. + */ + +public class AccountCategoryLevel { + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("confidence") + private Optional confidence; + + /** + * Account category name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("levelName") + private Optional levelName; + + public AccountCategoryLevel( + @JsonProperty("confidence") Optional confidence, + @JsonProperty("levelName") Optional levelName) { + Utils.checkNotNull(confidence, "confidence"); + Utils.checkNotNull(levelName, "levelName"); + this.confidence = confidence; + this.levelName = levelName; + } + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + public Optional confidence() { + return confidence; + } + + /** + * Account category name. + */ + public Optional levelName() { + return levelName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + public AccountCategoryLevel withConfidence(double confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = Optional.ofNullable(confidence); + return this; + } + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + public AccountCategoryLevel withConfidence(Optional confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = confidence; + return this; + } + + /** + * Account category name. + */ + public AccountCategoryLevel withLevelName(String levelName) { + Utils.checkNotNull(levelName, "levelName"); + this.levelName = Optional.ofNullable(levelName); + return this; + } + + /** + * Account category name. + */ + public AccountCategoryLevel withLevelName(Optional levelName) { + Utils.checkNotNull(levelName, "levelName"); + this.levelName = levelName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountCategoryLevel other = (AccountCategoryLevel) o; + return + java.util.Objects.deepEquals(this.confidence, other.confidence) && + java.util.Objects.deepEquals(this.levelName, other.levelName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + confidence, + levelName); + } + + @Override + public String toString() { + return Utils.toString(AccountCategoryLevel.class, + "confidence", confidence, + "levelName", levelName); + } + + public final static class Builder { + + private Optional confidence = Optional.empty(); + + private Optional levelName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + public Builder confidence(double confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = Optional.ofNullable(confidence); + return this; + } + + /** + * Confidence level of the category. This will only be populated where `status` is `Suggested`. + */ + public Builder confidence(Optional confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = confidence; + return this; + } + + /** + * Account category name. + */ + public Builder levelName(String levelName) { + Utils.checkNotNull(levelName, "levelName"); + this.levelName = Optional.ofNullable(levelName); + return this; + } + + /** + * Account category name. + */ + public Builder levelName(Optional levelName) { + Utils.checkNotNull(levelName, "levelName"); + this.levelName = levelName; + return this; + } + + public AccountCategoryLevel build() { + return new AccountCategoryLevel( + confidence, + levelName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifierType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifierType.java new file mode 100644 index 00000000..f934359c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifierType.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountIdentifierType - Type of account + */ +public enum AccountIdentifierType { + ACCOUNT("Account"), + CARD("Card"), + CREDIT("Credit"), + DEPOSITORY("Depository"), + INVESTMENT("Investment"), + LOAN("Loan"), + OTHER("Other"); + + @JsonValue + private final String value; + + private AccountIdentifierType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifiers.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifiers.java new file mode 100644 index 00000000..4c776aeb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountIdentifiers.java @@ -0,0 +1,484 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountIdentifiers - An object containing bank account identification information. + */ + +public class AccountIdentifiers { + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bankCode") + private JsonNullable bankCode; + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bic") + private JsonNullable bic; + + /** + * The international bank account number (IBAN) for the account, if known. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("iban") + private JsonNullable iban; + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("maskedAccountNumber") + private JsonNullable maskedAccountNumber; + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("number") + private JsonNullable number; + + /** + * Detailed account category + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subtype") + private JsonNullable subtype; + + /** + * Type of account + */ + @JsonProperty("type") + private AccountIdentifierType type; + + public AccountIdentifiers( + @JsonProperty("bankCode") JsonNullable bankCode, + @JsonProperty("bic") JsonNullable bic, + @JsonProperty("iban") JsonNullable iban, + @JsonProperty("maskedAccountNumber") JsonNullable maskedAccountNumber, + @JsonProperty("number") JsonNullable number, + @JsonProperty("subtype") JsonNullable subtype, + @JsonProperty("type") AccountIdentifierType type) { + Utils.checkNotNull(bankCode, "bankCode"); + Utils.checkNotNull(bic, "bic"); + Utils.checkNotNull(iban, "iban"); + Utils.checkNotNull(maskedAccountNumber, "maskedAccountNumber"); + Utils.checkNotNull(number, "number"); + Utils.checkNotNull(subtype, "subtype"); + Utils.checkNotNull(type, "type"); + this.bankCode = bankCode; + this.bic = bic; + this.iban = iban; + this.maskedAccountNumber = maskedAccountNumber; + this.number = number; + this.subtype = subtype; + this.type = type; + } + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + public JsonNullable bankCode() { + return bankCode; + } + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + public JsonNullable bic() { + return bic; + } + + /** + * The international bank account number (IBAN) for the account, if known. + */ + public JsonNullable iban() { + return iban; + } + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + public JsonNullable maskedAccountNumber() { + return maskedAccountNumber; + } + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + public JsonNullable number() { + return number; + } + + /** + * Detailed account category + */ + public JsonNullable subtype() { + return subtype; + } + + /** + * Type of account + */ + public AccountIdentifierType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + public AccountIdentifiers withBankCode(String bankCode) { + Utils.checkNotNull(bankCode, "bankCode"); + this.bankCode = JsonNullable.of(bankCode); + return this; + } + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + public AccountIdentifiers withBankCode(JsonNullable bankCode) { + Utils.checkNotNull(bankCode, "bankCode"); + this.bankCode = bankCode; + return this; + } + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + public AccountIdentifiers withBic(String bic) { + Utils.checkNotNull(bic, "bic"); + this.bic = JsonNullable.of(bic); + return this; + } + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + public AccountIdentifiers withBic(JsonNullable bic) { + Utils.checkNotNull(bic, "bic"); + this.bic = bic; + return this; + } + + /** + * The international bank account number (IBAN) for the account, if known. + */ + public AccountIdentifiers withIban(String iban) { + Utils.checkNotNull(iban, "iban"); + this.iban = JsonNullable.of(iban); + return this; + } + + /** + * The international bank account number (IBAN) for the account, if known. + */ + public AccountIdentifiers withIban(JsonNullable iban) { + Utils.checkNotNull(iban, "iban"); + this.iban = iban; + return this; + } + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + public AccountIdentifiers withMaskedAccountNumber(String maskedAccountNumber) { + Utils.checkNotNull(maskedAccountNumber, "maskedAccountNumber"); + this.maskedAccountNumber = JsonNullable.of(maskedAccountNumber); + return this; + } + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + public AccountIdentifiers withMaskedAccountNumber(JsonNullable maskedAccountNumber) { + Utils.checkNotNull(maskedAccountNumber, "maskedAccountNumber"); + this.maskedAccountNumber = maskedAccountNumber; + return this; + } + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + public AccountIdentifiers withNumber(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + public AccountIdentifiers withNumber(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * Detailed account category + */ + public AccountIdentifiers withSubtype(String subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = JsonNullable.of(subtype); + return this; + } + + /** + * Detailed account category + */ + public AccountIdentifiers withSubtype(JsonNullable subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = subtype; + return this; + } + + /** + * Type of account + */ + public AccountIdentifiers withType(AccountIdentifierType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountIdentifiers other = (AccountIdentifiers) o; + return + java.util.Objects.deepEquals(this.bankCode, other.bankCode) && + java.util.Objects.deepEquals(this.bic, other.bic) && + java.util.Objects.deepEquals(this.iban, other.iban) && + java.util.Objects.deepEquals(this.maskedAccountNumber, other.maskedAccountNumber) && + java.util.Objects.deepEquals(this.number, other.number) && + java.util.Objects.deepEquals(this.subtype, other.subtype) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankCode, + bic, + iban, + maskedAccountNumber, + number, + subtype, + type); + } + + @Override + public String toString() { + return Utils.toString(AccountIdentifiers.class, + "bankCode", bankCode, + "bic", bic, + "iban", iban, + "maskedAccountNumber", maskedAccountNumber, + "number", number, + "subtype", subtype, + "type", type); + } + + public final static class Builder { + + private JsonNullable bankCode = JsonNullable.undefined(); + + private JsonNullable bic = JsonNullable.undefined(); + + private JsonNullable iban = JsonNullable.undefined(); + + private JsonNullable maskedAccountNumber = JsonNullable.undefined(); + + private JsonNullable number = JsonNullable.undefined(); + + private JsonNullable subtype = JsonNullable.undefined(); + + private AccountIdentifierType type; + + private Builder() { + // force use of static builder() method + } + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + public Builder bankCode(String bankCode) { + Utils.checkNotNull(bankCode, "bankCode"); + this.bankCode = JsonNullable.of(bankCode); + return this; + } + + /** + * The local (usually national) routing number for the account. + * + * This is known by different names in different countries: + * * BSB code (Australia) + * * routing number (Canada, USA) + * * sort code (UK) + */ + public Builder bankCode(JsonNullable bankCode) { + Utils.checkNotNull(bankCode, "bankCode"); + this.bankCode = bankCode; + return this; + } + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + public Builder bic(String bic) { + Utils.checkNotNull(bic, "bic"); + this.bic = JsonNullable.of(bic); + return this; + } + + /** + * The ISO 9362 code (commonly called SWIFT code, SWIFT-BIC or BIC) for the account. + */ + public Builder bic(JsonNullable bic) { + Utils.checkNotNull(bic, "bic"); + this.bic = bic; + return this; + } + + /** + * The international bank account number (IBAN) for the account, if known. + */ + public Builder iban(String iban) { + Utils.checkNotNull(iban, "iban"); + this.iban = JsonNullable.of(iban); + return this; + } + + /** + * The international bank account number (IBAN) for the account, if known. + */ + public Builder iban(JsonNullable iban) { + Utils.checkNotNull(iban, "iban"); + this.iban = iban; + return this; + } + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + public Builder maskedAccountNumber(String maskedAccountNumber) { + Utils.checkNotNull(maskedAccountNumber, "maskedAccountNumber"); + this.maskedAccountNumber = JsonNullable.of(maskedAccountNumber); + return this; + } + + /** + * A portion of the actual account `number` to help account identification where number is tokenised (Plaid only) + */ + public Builder maskedAccountNumber(JsonNullable maskedAccountNumber) { + Utils.checkNotNull(maskedAccountNumber, "maskedAccountNumber"); + this.maskedAccountNumber = maskedAccountNumber; + return this; + } + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + public Builder number(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The account number for the account. When combined with the`bankCode`, this is usually enough to uniquely identify an account within a jurisdiction. + */ + public Builder number(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * Detailed account category + */ + public Builder subtype(String subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = JsonNullable.of(subtype); + return this; + } + + /** + * Detailed account category + */ + public Builder subtype(JsonNullable subtype) { + Utils.checkNotNull(subtype, "subtype"); + this.subtype = subtype; + return this; + } + + /** + * Type of account + */ + public Builder type(AccountIdentifierType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public AccountIdentifiers build() { + return new AccountIdentifiers( + bankCode, + bic, + iban, + maskedAccountNumber, + number, + subtype, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountInstitution.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountInstitution.java new file mode 100644 index 00000000..b09b31c3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountInstitution.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountInstitution - The bank or other financial institution providing the account. + */ + +public class AccountInstitution { + + /** + * The institution's ID, according to the provider. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The institution's name, according to the underlying provider. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public AccountInstitution( + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The institution's ID, according to the provider. + */ + public Optional id() { + return id; + } + + /** + * The institution's name, according to the underlying provider. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The institution's ID, according to the provider. + */ + public AccountInstitution withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The institution's ID, according to the provider. + */ + public AccountInstitution withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution's name, according to the underlying provider. + */ + public AccountInstitution withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The institution's name, according to the underlying provider. + */ + public AccountInstitution withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountInstitution other = (AccountInstitution) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(AccountInstitution.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The institution's ID, according to the provider. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The institution's ID, according to the provider. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution's name, according to the underlying provider. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The institution's name, according to the underlying provider. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AccountInstitution build() { + return new AccountInstitution( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountPrototype.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountPrototype.java new file mode 100644 index 00000000..fc76f22c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountPrototype.java @@ -0,0 +1,844 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountPrototype { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Current balance in the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currentBalance") + private JsonNullable currentBalance; + + /** + * Description for the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedCategory") + private JsonNullable fullyQualifiedCategory; + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedName") + private JsonNullable fullyQualifiedName; + + /** + * Confirms whether the account is a bank account or not. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isBankAccount") + private Optional isBankAccount; + + /** + * Name of the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nominalCode") + private JsonNullable nominalCode; + + /** + * Status of the account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Type of account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validDatatypeLinks") + private JsonNullable> validDatatypeLinks; + + public AccountPrototype( + @JsonProperty("currency") Optional currency, + @JsonProperty("currentBalance") JsonNullable currentBalance, + @JsonProperty("description") JsonNullable description, + @JsonProperty("fullyQualifiedCategory") JsonNullable fullyQualifiedCategory, + @JsonProperty("fullyQualifiedName") JsonNullable fullyQualifiedName, + @JsonProperty("isBankAccount") Optional isBankAccount, + @JsonProperty("name") JsonNullable name, + @JsonProperty("nominalCode") JsonNullable nominalCode, + @JsonProperty("status") Optional status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("type") Optional type, + @JsonProperty("validDatatypeLinks") JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currentBalance, "currentBalance"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + Utils.checkNotNull(isBankAccount, "isBankAccount"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(nominalCode, "nominalCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.currency = currency; + this.currentBalance = currentBalance; + this.description = description; + this.fullyQualifiedCategory = fullyQualifiedCategory; + this.fullyQualifiedName = fullyQualifiedName; + this.isBankAccount = isBankAccount; + this.name = name; + this.nominalCode = nominalCode; + this.status = status; + this.supplementalData = supplementalData; + this.type = type; + this.validDatatypeLinks = validDatatypeLinks; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Current balance in the account. + */ + public JsonNullable currentBalance() { + return currentBalance; + } + + /** + * Description for the account. + */ + public JsonNullable description() { + return description; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public JsonNullable fullyQualifiedCategory() { + return fullyQualifiedCategory; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public JsonNullable fullyQualifiedName() { + return fullyQualifiedName; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Optional isBankAccount() { + return isBankAccount; + } + + /** + * Name of the account. + */ + public JsonNullable name() { + return name; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public JsonNullable nominalCode() { + return nominalCode; + } + + /** + * Status of the account + */ + public Optional status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Type of account + */ + public Optional type() { + return type; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public JsonNullable> validDatatypeLinks() { + return validDatatypeLinks; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountPrototype withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountPrototype withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public AccountPrototype withCurrentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public AccountPrototype withCurrentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public AccountPrototype withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public AccountPrototype withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountPrototype withFullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountPrototype withFullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountPrototype withFullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountPrototype withFullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountPrototype withIsBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountPrototype withIsBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + /** + * Name of the account. + */ + public AccountPrototype withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public AccountPrototype withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountPrototype withNominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountPrototype withNominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Status of the account + */ + public AccountPrototype withStatus(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public AccountPrototype withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountPrototype withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountPrototype withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public AccountPrototype withType(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public AccountPrototype withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountPrototype withValidDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountPrototype withValidDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountPrototype other = (AccountPrototype) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currentBalance, other.currentBalance) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.fullyQualifiedCategory, other.fullyQualifiedCategory) && + java.util.Objects.deepEquals(this.fullyQualifiedName, other.fullyQualifiedName) && + java.util.Objects.deepEquals(this.isBankAccount, other.isBankAccount) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.nominalCode, other.nominalCode) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.validDatatypeLinks, other.validDatatypeLinks); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + isBankAccount, + name, + nominalCode, + status, + supplementalData, + type, + validDatatypeLinks); + } + + @Override + public String toString() { + return Utils.toString(AccountPrototype.class, + "currency", currency, + "currentBalance", currentBalance, + "description", description, + "fullyQualifiedCategory", fullyQualifiedCategory, + "fullyQualifiedName", fullyQualifiedName, + "isBankAccount", isBankAccount, + "name", name, + "nominalCode", nominalCode, + "status", status, + "supplementalData", supplementalData, + "type", type, + "validDatatypeLinks", validDatatypeLinks); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private JsonNullable currentBalance = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedCategory = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedName = JsonNullable.undefined(); + + private Optional isBankAccount = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable nominalCode = JsonNullable.undefined(); + + private Optional status = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional type = Optional.empty(); + + private JsonNullable> validDatatypeLinks = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + /** + * Name of the account. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Status of the account + */ + public Builder status(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public Builder type(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + public AccountPrototype build() { + return new AccountPrototype( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + isBankAccount, + name, + nominalCode, + status, + supplementalData, + type, + validDatatypeLinks); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountRef.java new file mode 100644 index 00000000..c7247efe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountRef.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountRef - Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + +public class AccountRef { + + /** + * 'id' from the Accounts data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * 'name' from the Accounts data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public AccountRef( + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * 'id' from the Accounts data type. + */ + public Optional id() { + return id; + } + + /** + * 'name' from the Accounts data type. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 'id' from the Accounts data type. + */ + public AccountRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' from the Accounts data type. + */ + public AccountRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * 'name' from the Accounts data type. + */ + public AccountRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * 'name' from the Accounts data type. + */ + public AccountRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountRef other = (AccountRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(AccountRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 'id' from the Accounts data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' from the Accounts data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * 'name' from the Accounts data type. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * 'name' from the Accounts data type. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AccountRef build() { + return new AccountRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountStatus.java new file mode 100644 index 00000000..097beeb8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountStatus.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountStatus - Status of the account + */ +public enum AccountStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"), + PENDING("Pending"); + + @JsonValue + private final String value; + + private AccountStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLine.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLine.java new file mode 100644 index 00000000..1074e76f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLine.java @@ -0,0 +1,235 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountTransactionLine { + + /** + * Amount in the bill payment currency. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * Description of the account transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Links an account transaction line to the underlying record that created it. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRef") + private Optional recordRef; + + public AccountTransactionLine( + @JsonProperty("amount") Optional amount, + @JsonProperty("description") JsonNullable description, + @JsonProperty("recordRef") Optional recordRef) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(recordRef, "recordRef"); + this.amount = amount; + this.description = description; + this.recordRef = recordRef; + } + + /** + * Amount in the bill payment currency. + */ + public Optional amount() { + return amount; + } + + /** + * Description of the account transaction. + */ + public JsonNullable description() { + return description; + } + + /** + * Links an account transaction line to the underlying record that created it. + */ + public Optional recordRef() { + return recordRef; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount in the bill payment currency. + */ + public AccountTransactionLine withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Amount in the bill payment currency. + */ + public AccountTransactionLine withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Description of the account transaction. + */ + public AccountTransactionLine withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the account transaction. + */ + public AccountTransactionLine withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Links an account transaction line to the underlying record that created it. + */ + public AccountTransactionLine withRecordRef(AccountTransactionLineRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links an account transaction line to the underlying record that created it. + */ + public AccountTransactionLine withRecordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountTransactionLine other = (AccountTransactionLine) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.recordRef, other.recordRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + description, + recordRef); + } + + @Override + public String toString() { + return Utils.toString(AccountTransactionLine.class, + "amount", amount, + "description", description, + "recordRef", recordRef); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private Optional recordRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Amount in the bill payment currency. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Amount in the bill payment currency. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Description of the account transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the account transaction. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Links an account transaction line to the underlying record that created it. + */ + public Builder recordRef(AccountTransactionLineRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links an account transaction line to the underlying record that created it. + */ + public Builder recordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + public AccountTransactionLine build() { + return new AccountTransactionLine( + amount, + description, + recordRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRef.java new file mode 100644 index 00000000..215251a5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRef.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountTransactionLineRecordRef - Links an account transaction line to the underlying record that created it. + */ + +public class AccountTransactionLineRecordRef { + + /** + * Name of underlying data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record or data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public AccountTransactionLineRecordRef( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Name of underlying data type. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record or data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of underlying data type. + */ + public AccountTransactionLineRecordRef withDataType(AccountTransactionLineRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public AccountTransactionLineRecordRef withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public AccountTransactionLineRecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public AccountTransactionLineRecordRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountTransactionLineRecordRef other = (AccountTransactionLineRecordRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(AccountTransactionLineRecordRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of underlying data type. + */ + public Builder dataType(AccountTransactionLineRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountTransactionLineRecordRef build() { + return new AccountTransactionLineRecordRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRefDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRefDataType.java new file mode 100644 index 00000000..3c0e0ce8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountTransactionLineRecordRefDataType.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountTransactionLineRecordRefDataType - Name of underlying data type. + */ +public enum AccountTransactionLineRecordRefDataType { + BANK_TRANSACTIONS("bankTransactions"), + BILL_CREDIT_NOTES("billCreditNotes"), + BILL_PAYMENTS("billPayments"), + BILLS("bills"), + CREDIT_NOTES("creditNotes"), + DIRECT_COSTS("directCosts"), + DIRECT_INCOMES("directIncomes"), + INVOICES("invoices"), + JOURNAL_ENTRIES("journalEntries"), + PAYMENTS("payments"), + TRANSFERS("transfers"); + + @JsonValue + private final String value; + + private AccountTransactionLineRecordRefDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountType.java new file mode 100644 index 00000000..efe0e3e9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountType.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountType - Type of account + */ +public enum AccountType { + UNKNOWN("Unknown"), + ASSET("Asset"), + EXPENSE("Expense"), + INCOME("Income"), + LIABILITY("Liability"), + EQUITY("Equity"); + + @JsonValue + private final String value; + + private AccountType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccount.java new file mode 100644 index 00000000..57570ac4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccount.java @@ -0,0 +1,1056 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingAccount - > **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + * + * View the coverage for accounts in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + * + * The categories for an account include: + * * Asset + * * Expense + * * Income + * * Liability + * * Equity. + * + * The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + * + * At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + * + * To determine the list of allowed categories for a specific integration, you can: + * - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). + * - Refer to the integration's own documentation. + * + * > **Accounts with no category** + * > + * > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + * > + * > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + */ + +public class AccountingAccount { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Current balance in the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currentBalance") + private JsonNullable currentBalance; + + /** + * Description for the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedCategory") + private JsonNullable fullyQualifiedCategory; + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedName") + private JsonNullable fullyQualifiedName; + + /** + * Identifier for the account, unique for the company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Confirms whether the account is a bank account or not. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isBankAccount") + private Optional isBankAccount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nominalCode") + private JsonNullable nominalCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Type of account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validDatatypeLinks") + private JsonNullable> validDatatypeLinks; + + public AccountingAccount( + @JsonProperty("currency") Optional currency, + @JsonProperty("currentBalance") JsonNullable currentBalance, + @JsonProperty("description") JsonNullable description, + @JsonProperty("fullyQualifiedCategory") JsonNullable fullyQualifiedCategory, + @JsonProperty("fullyQualifiedName") JsonNullable fullyQualifiedName, + @JsonProperty("id") Optional id, + @JsonProperty("isBankAccount") Optional isBankAccount, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") JsonNullable name, + @JsonProperty("nominalCode") JsonNullable nominalCode, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("type") Optional type, + @JsonProperty("validDatatypeLinks") JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currentBalance, "currentBalance"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(isBankAccount, "isBankAccount"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(nominalCode, "nominalCode"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.currency = currency; + this.currentBalance = currentBalance; + this.description = description; + this.fullyQualifiedCategory = fullyQualifiedCategory; + this.fullyQualifiedName = fullyQualifiedName; + this.id = id; + this.isBankAccount = isBankAccount; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.name = name; + this.nominalCode = nominalCode; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + this.type = type; + this.validDatatypeLinks = validDatatypeLinks; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Current balance in the account. + */ + public JsonNullable currentBalance() { + return currentBalance; + } + + /** + * Description for the account. + */ + public JsonNullable description() { + return description; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public JsonNullable fullyQualifiedCategory() { + return fullyQualifiedCategory; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public JsonNullable fullyQualifiedName() { + return fullyQualifiedName; + } + + /** + * Identifier for the account, unique for the company. + */ + public Optional id() { + return id; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Optional isBankAccount() { + return isBankAccount; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of the account. + */ + public JsonNullable name() { + return name; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public JsonNullable nominalCode() { + return nominalCode; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the account + */ + public Optional status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Type of account + */ + public Optional type() { + return type; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public JsonNullable> validDatatypeLinks() { + return validDatatypeLinks; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingAccount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public AccountingAccount withCurrentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public AccountingAccount withCurrentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public AccountingAccount withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public AccountingAccount withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountingAccount withFullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountingAccount withFullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountingAccount withFullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountingAccount withFullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public AccountingAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public AccountingAccount withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountingAccount withIsBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountingAccount withIsBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + public AccountingAccount withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingAccount withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingAccount withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingAccount withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the account. + */ + public AccountingAccount withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public AccountingAccount withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountingAccount withNominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountingAccount withNominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + public AccountingAccount withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingAccount withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the account + */ + public AccountingAccount withStatus(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public AccountingAccount withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingAccount withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingAccount withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public AccountingAccount withType(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public AccountingAccount withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountingAccount withValidDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountingAccount withValidDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAccount other = (AccountingAccount) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currentBalance, other.currentBalance) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.fullyQualifiedCategory, other.fullyQualifiedCategory) && + java.util.Objects.deepEquals(this.fullyQualifiedName, other.fullyQualifiedName) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.isBankAccount, other.isBankAccount) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.nominalCode, other.nominalCode) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.validDatatypeLinks, other.validDatatypeLinks); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + id, + isBankAccount, + metadata, + modifiedDate, + name, + nominalCode, + sourceModifiedDate, + status, + supplementalData, + type, + validDatatypeLinks); + } + + @Override + public String toString() { + return Utils.toString(AccountingAccount.class, + "currency", currency, + "currentBalance", currentBalance, + "description", description, + "fullyQualifiedCategory", fullyQualifiedCategory, + "fullyQualifiedName", fullyQualifiedName, + "id", id, + "isBankAccount", isBankAccount, + "metadata", metadata, + "modifiedDate", modifiedDate, + "name", name, + "nominalCode", nominalCode, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData, + "type", type, + "validDatatypeLinks", validDatatypeLinks); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private JsonNullable currentBalance = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedCategory = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedName = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional isBankAccount = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable nominalCode = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional type = Optional.empty(); + + private JsonNullable> validDatatypeLinks = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the account. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the account + */ + public Builder status(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public Builder type(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + public AccountingAccount build() { + return new AccountingAccount( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + id, + isBankAccount, + metadata, + modifiedDate, + name, + nominalCode, + sourceModifiedDate, + status, + supplementalData, + type, + validDatatypeLinks); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransaction.java new file mode 100644 index 00000000..7e5dfda7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransaction.java @@ -0,0 +1,1120 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingAccountTransaction - > **Language tip:** In Codat, account transactions represent all transactions posted to a bank account within an accounting platform. For bank transactions posted within a banking platform, refer to [Banking transactions](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions). + * + * > View the coverage for account transactions in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=accountTransactions" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * In Codat’s data model, account transactions represent bank activity within an accounting platform. All transactions that go through a bank account are recorded as account transactions. + * + * Account transactions are created as a result of different business activities, for example: + * + * * Payments: for example, receiving money for payment against an invoice. + * * Bill payments: for example, spending money for a payment against a bill. + * * Direct costs: for example, withdrawing money from a bank account, either for cash purposes or to make a payment. + * * Direct incomes: for example, selling an item directly to a contact and receiving payment at point of sale. + * * Transfers: for example, transferring money between two bank accounts. + * + * Account transactions is the parent data type of [payments](https://docs.codat.io/lending-api#/schemas/Payment), [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment), [direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost), [direct incomes](https://docs.codat.io/lending-api#/schemas/DirectIncome), and [transfers](https://docs.codat.io/lending-api#/schemas/Transfer). + */ + +public class AccountingAccountTransaction { + + /** + * Links to the Account transactions data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bankAccountRef") + private Optional bankAccountRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * Identifier of the direct cost (unique to the company). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Array of account transaction lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lines") + private JsonNullable> lines; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Additional information about the account transaction, if available. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The status of the account transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Total amount of the account transactions, inclusive of tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + /** + * Identifier of the transaction (unique to the company). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactionId") + private JsonNullable transactionId; + + public AccountingAccountTransaction( + @JsonProperty("bankAccountRef") Optional bankAccountRef, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("date") Optional date, + @JsonProperty("id") Optional id, + @JsonProperty("lines") JsonNullable> lines, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("totalAmount") Optional totalAmount, + @JsonProperty("transactionId") JsonNullable transactionId) { + Utils.checkNotNull(bankAccountRef, "bankAccountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lines, "lines"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(transactionId, "transactionId"); + this.bankAccountRef = bankAccountRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.date = date; + this.id = id; + this.lines = lines; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.totalAmount = totalAmount; + this.transactionId = transactionId; + } + + /** + * Links to the Account transactions data type. + */ + public Optional bankAccountRef() { + return bankAccountRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * Identifier of the direct cost (unique to the company). + */ + public Optional id() { + return id; + } + + /** + * Array of account transaction lines. + */ + public JsonNullable> lines() { + return lines; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Additional information about the account transaction, if available. + */ + public JsonNullable note() { + return note; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The status of the account transaction. + */ + public Optional status() { + return status; + } + + /** + * Total amount of the account transactions, inclusive of tax. + */ + public Optional totalAmount() { + return totalAmount; + } + + /** + * Identifier of the transaction (unique to the company). + */ + public JsonNullable transactionId() { + return transactionId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Links to the Account transactions data type. + */ + public AccountingAccountTransaction withBankAccountRef(BankAccountRef bankAccountRef) { + Utils.checkNotNull(bankAccountRef, "bankAccountRef"); + this.bankAccountRef = Optional.ofNullable(bankAccountRef); + return this; + } + + /** + * Links to the Account transactions data type. + */ + public AccountingAccountTransaction withBankAccountRef(Optional bankAccountRef) { + Utils.checkNotNull(bankAccountRef, "bankAccountRef"); + this.bankAccountRef = bankAccountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingAccountTransaction withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingAccountTransaction withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingAccountTransaction withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingAccountTransaction withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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 AccountingAccountTransaction 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 AccountingAccountTransaction withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier of the direct cost (unique to the company). + */ + public AccountingAccountTransaction withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost (unique to the company). + */ + public AccountingAccountTransaction withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Array of account transaction lines. + */ + public AccountingAccountTransaction withLines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * Array of account transaction lines. + */ + public AccountingAccountTransaction withLines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public AccountingAccountTransaction withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingAccountTransaction withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingAccountTransaction withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingAccountTransaction withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Additional information about the account transaction, if available. + */ + public AccountingAccountTransaction withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Additional information about the account transaction, if available. + */ + public AccountingAccountTransaction withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public AccountingAccountTransaction withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingAccountTransaction withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the account transaction. + */ + public AccountingAccountTransaction withStatus(Status status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the account transaction. + */ + public AccountingAccountTransaction withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the account transactions, inclusive of tax. + */ + public AccountingAccountTransaction withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the account transactions, inclusive of tax. + */ + public AccountingAccountTransaction withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Identifier of the transaction (unique to the company). + */ + public AccountingAccountTransaction withTransactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = JsonNullable.of(transactionId); + return this; + } + + /** + * Identifier of the transaction (unique to the company). + */ + public AccountingAccountTransaction withTransactionId(JsonNullable transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAccountTransaction other = (AccountingAccountTransaction) o; + return + java.util.Objects.deepEquals(this.bankAccountRef, other.bankAccountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lines, other.lines) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.transactionId, other.transactionId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + bankAccountRef, + currency, + currencyRate, + date, + id, + lines, + metadata, + modifiedDate, + note, + sourceModifiedDate, + status, + totalAmount, + transactionId); + } + + @Override + public String toString() { + return Utils.toString(AccountingAccountTransaction.class, + "bankAccountRef", bankAccountRef, + "currency", currency, + "currencyRate", currencyRate, + "date", date, + "id", id, + "lines", lines, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "totalAmount", totalAmount, + "transactionId", transactionId); + } + + public final static class Builder { + + private Optional bankAccountRef = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional date = Optional.empty(); + + private Optional id = Optional.empty(); + + private JsonNullable> lines = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private JsonNullable transactionId = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Links to the Account transactions data type. + */ + public Builder bankAccountRef(BankAccountRef bankAccountRef) { + Utils.checkNotNull(bankAccountRef, "bankAccountRef"); + this.bankAccountRef = Optional.ofNullable(bankAccountRef); + return this; + } + + /** + * Links to the Account transactions data type. + */ + public Builder bankAccountRef(Optional bankAccountRef) { + Utils.checkNotNull(bankAccountRef, "bankAccountRef"); + this.bankAccountRef = bankAccountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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(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; + } + + /** + * Identifier of the direct cost (unique to the company). + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost (unique to the company). + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Array of account transaction lines. + */ + public Builder lines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * Array of account transaction lines. + */ + public Builder lines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Additional information about the account transaction, if available. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Additional information about the account transaction, if available. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the account transaction. + */ + public Builder status(Status status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the account transaction. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the account transactions, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the account transactions, inclusive of tax. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Identifier of the transaction (unique to the company). + */ + public Builder transactionId(String transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = JsonNullable.of(transactionId); + return this; + } + + /** + * Identifier of the transaction (unique to the company). + */ + public Builder transactionId(JsonNullable transactionId) { + Utils.checkNotNull(transactionId, "transactionId"); + this.transactionId = transactionId; + return this; + } + + public AccountingAccountTransaction build() { + return new AccountingAccountTransaction( + bankAccountRef, + currency, + currencyRate, + date, + id, + lines, + metadata, + modifiedDate, + note, + sourceModifiedDate, + status, + totalAmount, + transactionId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransactions.java new file mode 100644 index 00000000..76f37a5f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountTransactions.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingAccountTransactions { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingAccountTransactions( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingAccountTransactions withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingAccountTransactions withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingAccountTransactions withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingAccountTransactions withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingAccountTransactions withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingAccountTransactions withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAccountTransactions other = (AccountingAccountTransactions) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingAccountTransactions.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingAccountTransactions build() { + return new AccountingAccountTransactions( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountValidDataTypeLinks.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountValidDataTypeLinks.java new file mode 100644 index 00000000..e9fd0a36 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccountValidDataTypeLinks.java @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingAccountValidDataTypeLinks - When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + * + * For example, `validDatatypeLinks` might indicate the following references: + * + * - Which tax rates are valid to use on the line item of a bill. + * - Which items can be used when creating an invoice. + * + * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + * + * ## `validDatatypeLinks` example + * + * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + * + * ```json validDatatypeLinks for an account + * { + * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + * "nominalCode": "090", + * "name": "Business Bank Account", + * #... + * "validDatatypeLinks": [ + * { + * "property": "Id", + * "links": [ + * "Payment.AccountRef.Id", + * "BillPayment.AccountRef.Id", + * "DirectIncome.LineItems.AccountRef.Id", + * "DirectCost.LineItems.AccountRef.Id" + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Support for `validDatatypeLinks` + * + * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + * + * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our <a href="https://portal.productboard.com/codat/5-product-roadmap">Product Roadmap</a>. + */ + +public class AccountingAccountValidDataTypeLinks { + + /** + * Supported `dataTypes` that the record can be linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private JsonNullable> links; + + /** + * The property from the account that can be linked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("property") + private JsonNullable property; + + public AccountingAccountValidDataTypeLinks( + @JsonProperty("links") JsonNullable> links, + @JsonProperty("property") JsonNullable property) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(property, "property"); + this.links = links; + this.property = property; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public JsonNullable> links() { + return links; + } + + /** + * The property from the account that can be linked. + */ + public JsonNullable property() { + return property; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public AccountingAccountValidDataTypeLinks withLinks(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public AccountingAccountValidDataTypeLinks withLinks(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public AccountingAccountValidDataTypeLinks withProperty(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public AccountingAccountValidDataTypeLinks withProperty(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAccountValidDataTypeLinks other = (AccountingAccountValidDataTypeLinks) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + property); + } + + @Override + public String toString() { + return Utils.toString(AccountingAccountValidDataTypeLinks.class, + "links", links, + "property", property); + } + + public final static class Builder { + + private JsonNullable> links = JsonNullable.undefined(); + + private JsonNullable property = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + public AccountingAccountValidDataTypeLinks build() { + return new AccountingAccountValidDataTypeLinks( + links, + property); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccounts.java new file mode 100644 index 00000000..e8407a69 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAccounts.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingAccounts { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingAccounts( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingAccounts withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingAccounts withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingAccounts withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingAccounts withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingAccounts withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingAccounts withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAccounts other = (AccountingAccounts) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingAccounts.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingAccounts build() { + return new AccountingAccounts( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddress.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddress.java new file mode 100644 index 00000000..b0812bbe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddress.java @@ -0,0 +1,451 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingAddress { + + /** + * City of the customer address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("city") + private JsonNullable city; + + /** + * Country of the customer address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private JsonNullable country; + + /** + * Line 1 of the customer address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("line1") + private JsonNullable line1; + + /** + * Line 2 of the customer address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("line2") + private JsonNullable line2; + + /** + * Postal code or zip code. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("postalCode") + private JsonNullable postalCode; + + /** + * Region of the customer address. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("region") + private JsonNullable region; + + /** + * The type of the address + */ + @JsonProperty("type") + private AccountingAddressType type; + + public AccountingAddress( + @JsonProperty("city") JsonNullable city, + @JsonProperty("country") JsonNullable country, + @JsonProperty("line1") JsonNullable line1, + @JsonProperty("line2") JsonNullable line2, + @JsonProperty("postalCode") JsonNullable postalCode, + @JsonProperty("region") JsonNullable region, + @JsonProperty("type") AccountingAddressType type) { + Utils.checkNotNull(city, "city"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(line1, "line1"); + Utils.checkNotNull(line2, "line2"); + Utils.checkNotNull(postalCode, "postalCode"); + Utils.checkNotNull(region, "region"); + Utils.checkNotNull(type, "type"); + this.city = city; + this.country = country; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.region = region; + this.type = type; + } + + /** + * City of the customer address. + */ + public JsonNullable city() { + return city; + } + + /** + * Country of the customer address. + */ + public JsonNullable country() { + return country; + } + + /** + * Line 1 of the customer address. + */ + public JsonNullable line1() { + return line1; + } + + /** + * Line 2 of the customer address. + */ + public JsonNullable line2() { + return line2; + } + + /** + * Postal code or zip code. + */ + public JsonNullable postalCode() { + return postalCode; + } + + /** + * Region of the customer address. + */ + public JsonNullable region() { + return region; + } + + /** + * The type of the address + */ + public AccountingAddressType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * City of the customer address. + */ + public AccountingAddress withCity(String city) { + Utils.checkNotNull(city, "city"); + this.city = JsonNullable.of(city); + return this; + } + + /** + * City of the customer address. + */ + public AccountingAddress withCity(JsonNullable city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + /** + * Country of the customer address. + */ + public AccountingAddress withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = JsonNullable.of(country); + return this; + } + + /** + * Country of the customer address. + */ + public AccountingAddress withCountry(JsonNullable country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + /** + * Line 1 of the customer address. + */ + public AccountingAddress withLine1(String line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = JsonNullable.of(line1); + return this; + } + + /** + * Line 1 of the customer address. + */ + public AccountingAddress withLine1(JsonNullable line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = line1; + return this; + } + + /** + * Line 2 of the customer address. + */ + public AccountingAddress withLine2(String line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = JsonNullable.of(line2); + return this; + } + + /** + * Line 2 of the customer address. + */ + public AccountingAddress withLine2(JsonNullable line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = line2; + return this; + } + + /** + * Postal code or zip code. + */ + public AccountingAddress withPostalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = JsonNullable.of(postalCode); + return this; + } + + /** + * Postal code or zip code. + */ + public AccountingAddress withPostalCode(JsonNullable postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + /** + * Region of the customer address. + */ + public AccountingAddress withRegion(String region) { + Utils.checkNotNull(region, "region"); + this.region = JsonNullable.of(region); + return this; + } + + /** + * Region of the customer address. + */ + public AccountingAddress withRegion(JsonNullable region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * The type of the address + */ + public AccountingAddress withType(AccountingAddressType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAddress other = (AccountingAddress) o; + return + java.util.Objects.deepEquals(this.city, other.city) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.line1, other.line1) && + java.util.Objects.deepEquals(this.line2, other.line2) && + java.util.Objects.deepEquals(this.postalCode, other.postalCode) && + java.util.Objects.deepEquals(this.region, other.region) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + city, + country, + line1, + line2, + postalCode, + region, + type); + } + + @Override + public String toString() { + return Utils.toString(AccountingAddress.class, + "city", city, + "country", country, + "line1", line1, + "line2", line2, + "postalCode", postalCode, + "region", region, + "type", type); + } + + public final static class Builder { + + private JsonNullable city = JsonNullable.undefined(); + + private JsonNullable country = JsonNullable.undefined(); + + private JsonNullable line1 = JsonNullable.undefined(); + + private JsonNullable line2 = JsonNullable.undefined(); + + private JsonNullable postalCode = JsonNullable.undefined(); + + private JsonNullable region = JsonNullable.undefined(); + + private AccountingAddressType type; + + private Builder() { + // force use of static builder() method + } + + /** + * City of the customer address. + */ + public Builder city(String city) { + Utils.checkNotNull(city, "city"); + this.city = JsonNullable.of(city); + return this; + } + + /** + * City of the customer address. + */ + public Builder city(JsonNullable city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + /** + * Country of the customer address. + */ + public Builder country(String country) { + Utils.checkNotNull(country, "country"); + this.country = JsonNullable.of(country); + return this; + } + + /** + * Country of the customer address. + */ + public Builder country(JsonNullable country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + /** + * Line 1 of the customer address. + */ + public Builder line1(String line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = JsonNullable.of(line1); + return this; + } + + /** + * Line 1 of the customer address. + */ + public Builder line1(JsonNullable line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = line1; + return this; + } + + /** + * Line 2 of the customer address. + */ + public Builder line2(String line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = JsonNullable.of(line2); + return this; + } + + /** + * Line 2 of the customer address. + */ + public Builder line2(JsonNullable line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = line2; + return this; + } + + /** + * Postal code or zip code. + */ + public Builder postalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = JsonNullable.of(postalCode); + return this; + } + + /** + * Postal code or zip code. + */ + public Builder postalCode(JsonNullable postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + /** + * Region of the customer address. + */ + public Builder region(String region) { + Utils.checkNotNull(region, "region"); + this.region = JsonNullable.of(region); + return this; + } + + /** + * Region of the customer address. + */ + public Builder region(JsonNullable region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * The type of the address + */ + public Builder type(AccountingAddressType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public AccountingAddress build() { + return new AccountingAddress( + city, + country, + line1, + line2, + postalCode, + region, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddressType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddressType.java new file mode 100644 index 00000000..44a38c0e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAddressType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountingAddressType - The type of the address + */ +public enum AccountingAddressType { + UNKNOWN("Unknown"), + BILLING("Billing"), + DELIVERY("Delivery"); + + @JsonValue + private final String value; + + private AccountingAddressType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedCreditorReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedCreditorReport.java new file mode 100644 index 00000000..9eb3fafd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedCreditorReport.java @@ -0,0 +1,484 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingAgedCreditorReport - The Aged Creditors report shows the total balance owed by a business to its suppliers over time. + * + * You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. + * + * Total assets or liabilities are grouped into 30-day periods for each supplier, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. + * + * > It is not guaranteed that write-offs are included in the Aged Creditors report. + * + * ## Underlying data + * + * The Aged Creditors report is generated from a set of required data types: [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier), [Bills](https://docs.codat.io/lending-api#/schemas/Bill), [Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote), and [Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). + * + * To generate the report, the underlying data types must have been synced within 24 hours of each other. Otherwise an error is displayed when you try to run the report. Sync the required data types by clicking the link in the error, and then run the report again. + * + * > The Aged Creditor report runs based on the **issue dates** of the underlying data types rather than the due date. + * + * ## Accessing the Aged Creditors report in Portal + * + * Apart from returning the report via the API as JSON and query, you can also return the Aged Creditors report in the Codat portal. + * + * 1. In the navigation bar, click **Companies**. + * 2. Click the name of the company you want to generate the report for. The company's data page is displayed. + * 3. Click the **Accounting** tab then click **Reports**. + * 4. Select **Aged Creditors**. + * 5. _(Optional)_ Edit the default reporting parameters. + * a. You can change the report date in the **Date** box. By default, the report includes transactions that occurred up to, but not including, today's date. To include transactions for today, enter tomorrow's date. + * b. In the **Period Length Days** box, select the default period length for each column (the default is 30 days). + * b. In the **Number of Periods** box, enter the number of periods to show as columns in the report (the default is 4 periods). + * 6. To run the report, click **Load aged creditors**. + * 7. The report is generated and displayed at the bottom of the page. + * + * The report will be grouped per supplier and depending on the periods requested. The details indicates whether the amounts owed come from outstanding bills or bill credit notes. + */ + +public class AccountingAgedCreditorReport { + + /** + * Array of aged creditor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private Optional> data; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generated") + private Optional generated; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportDate") + private Optional reportDate; + + public AccountingAgedCreditorReport( + @JsonProperty("data") Optional> data, + @JsonProperty("generated") Optional generated, + @JsonProperty("reportDate") Optional reportDate) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(generated, "generated"); + Utils.checkNotNull(reportDate, "reportDate"); + this.data = data; + this.generated = generated; + this.reportDate = reportDate; + } + + /** + * Array of aged creditor. + */ + public Optional> data() { + return data; + } + + /** + * 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 Optional generated() { + return generated; + } + + /** + * 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 Optional reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Array of aged creditor. + */ + public AccountingAgedCreditorReport withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Array of aged creditor. + */ + public AccountingAgedCreditorReport withData(Optional> data) { + Utils.checkNotNull(data, "data"); + this.data = data; + 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 AccountingAgedCreditorReport withGenerated(String generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = Optional.ofNullable(generated); + 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 AccountingAgedCreditorReport withGenerated(Optional generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = generated; + 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 AccountingAgedCreditorReport withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + 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 AccountingAgedCreditorReport withReportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAgedCreditorReport other = (AccountingAgedCreditorReport) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.generated, other.generated) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + generated, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(AccountingAgedCreditorReport.class, + "data", data, + "generated", generated, + "reportDate", reportDate); + } + + public final static class Builder { + + private Optional> data = Optional.empty(); + + private Optional generated = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Array of aged creditor. + */ + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Array of aged creditor. + */ + public Builder data(Optional> data) { + Utils.checkNotNull(data, "data"); + this.data = data; + 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 generated(String generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = Optional.ofNullable(generated); + 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 generated(Optional generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = generated; + 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 reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + 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 reportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public AccountingAgedCreditorReport build() { + return new AccountingAgedCreditorReport( + data, + generated, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedDebtorReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedDebtorReport.java new file mode 100644 index 00000000..914388db --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAgedDebtorReport.java @@ -0,0 +1,484 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingAgedDebtorReport - The Aged Debtors report shows the total outstanding balance due from customers to the business over time. + * + * You can generate it for a company based on recently synced data from your customers' accounting platforms. The report is available in the **Reports** tab in the Codat portal. + * + * Total assets or liabilities are grouped into 30-day periods for each customer, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency. + * + * > It is not guaranteed that write-offs are included in the Aged Debtors report. + * + * ## Underlying data + * + * The Aged Debtors report is generated from a set of required data types: [Customers](https://docs.codat.io/lending-api#/schemas/Customer), [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice), [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote), and [Payments](https://docs.codat.io/lending-api#/schemas/Payment). + * + * To generate the report, the underlying data types must have been synced within 24 hours of each other. Otherwise an error is displayed when you try to run the report. Sync the required data types by clicking the link in the error, and then run the report again. + * + * > The Aged Debtors report runs based on the **issue dates** of the underlying data types rather than the due date. + * + * ## Accessing the Aged Debtors report in Portal + * + * Apart from returning the report via the API as JSON and query, you can also return the Aged Debtors report in the Codat portal. + * + * 1. In the navigation bar, click **Companies**. + * 2. Click the name of the company you want to generate the report for. The company's data page is displayed. + * 3. Click the **Accounting** tab then click **Reports**. + * 4. Select **Aged Debtors**. + * 5. _(Optional)_ Edit the default reporting parameters. + * a. You can change the report date in the **Date** box. By default, the report includes transactions that occurred up to, but not including, today's date. To include transactions for today, enter tomorrow's date. + * b. In the **Period Length Days** box, select the default period length for each column (the default is 30 days). + * b. In the **Number of Periods** box, enter the number of periods to show as columns in the report (the default is 4 periods). + * 6. To run the report, click **Load aged debtors**. + * 7. The report is generated and displayed at the bottom of the page. + * + * The report will be grouped per supplier and depending on the periods requested. The details indicates whether the amounts owed come from outstanding invoices or credit notes. + */ + +public class AccountingAgedDebtorReport { + + /** + * Array of aged debtors. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private Optional> data; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generated") + private Optional generated; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportDate") + private Optional reportDate; + + public AccountingAgedDebtorReport( + @JsonProperty("data") Optional> data, + @JsonProperty("generated") Optional generated, + @JsonProperty("reportDate") Optional reportDate) { + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(generated, "generated"); + Utils.checkNotNull(reportDate, "reportDate"); + this.data = data; + this.generated = generated; + this.reportDate = reportDate; + } + + /** + * Array of aged debtors. + */ + public Optional> data() { + return data; + } + + /** + * 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 Optional generated() { + return generated; + } + + /** + * 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 Optional reportDate() { + return reportDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Array of aged debtors. + */ + public AccountingAgedDebtorReport withData(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Array of aged debtors. + */ + public AccountingAgedDebtorReport withData(Optional> data) { + Utils.checkNotNull(data, "data"); + this.data = data; + 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 AccountingAgedDebtorReport withGenerated(String generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = Optional.ofNullable(generated); + 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 AccountingAgedDebtorReport withGenerated(Optional generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = generated; + 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 AccountingAgedDebtorReport withReportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + 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 AccountingAgedDebtorReport withReportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAgedDebtorReport other = (AccountingAgedDebtorReport) o; + return + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.generated, other.generated) && + java.util.Objects.deepEquals(this.reportDate, other.reportDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + data, + generated, + reportDate); + } + + @Override + public String toString() { + return Utils.toString(AccountingAgedDebtorReport.class, + "data", data, + "generated", generated, + "reportDate", reportDate); + } + + public final static class Builder { + + private Optional> data = Optional.empty(); + + private Optional generated = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Array of aged debtors. + */ + public Builder data(java.util.List data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + /** + * Array of aged debtors. + */ + public Builder data(Optional> data) { + Utils.checkNotNull(data, "data"); + this.data = data; + 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 generated(String generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = Optional.ofNullable(generated); + 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 generated(Optional generated) { + Utils.checkNotNull(generated, "generated"); + this.generated = generated; + 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 reportDate(String reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = Optional.ofNullable(reportDate); + 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 reportDate(Optional reportDate) { + Utils.checkNotNull(reportDate, "reportDate"); + this.reportDate = reportDate; + return this; + } + + public AccountingAgedDebtorReport build() { + return new AccountingAgedDebtorReport( + data, + generated, + reportDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAttachment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAttachment.java new file mode 100644 index 00000000..cf8c369a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingAttachment.java @@ -0,0 +1,635 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingAttachment - The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + * + * > **Retrieving attachments** + * > + * > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + * + * Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + * + * Note that different integrations have different requirements to file size and extension of attachments. + * + * | Integration | File size | File extension | + * |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | + * | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | + * | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | + * | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state <a className="external" href="https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice" target="_blank">here</a> that "You can attach any type of file, such as text, image, or video files". | + * + * View the coverage for each integration in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting" target="_blank">Data coverage explorer</a>. + * + */ + +public class AccountingAttachment { + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contentType") + private JsonNullable contentType; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dateCreated") + private Optional dateCreated; + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fileSize") + private JsonNullable fileSize; + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("includeWhenSent") + private Optional includeWhenSent; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of the attachment file. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + public AccountingAttachment( + @JsonProperty("contentType") JsonNullable contentType, + @JsonProperty("dateCreated") Optional dateCreated, + @JsonProperty("fileSize") JsonNullable fileSize, + @JsonProperty("id") Optional id, + @JsonProperty("includeWhenSent") Optional includeWhenSent, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") JsonNullable name, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(dateCreated, "dateCreated"); + Utils.checkNotNull(fileSize, "fileSize"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(includeWhenSent, "includeWhenSent"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.contentType = contentType; + this.dateCreated = dateCreated; + this.fileSize = fileSize; + this.id = id; + this.includeWhenSent = includeWhenSent; + this.modifiedDate = modifiedDate; + this.name = name; + this.sourceModifiedDate = sourceModifiedDate; + } + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + public JsonNullable contentType() { + return contentType; + } + + /** + * 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 Optional dateCreated() { + return dateCreated; + } + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + public JsonNullable fileSize() { + return fileSize; + } + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + public Optional includeWhenSent() { + return includeWhenSent; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of the attachment file. + */ + public JsonNullable name() { + return name; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + public AccountingAttachment withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = JsonNullable.of(contentType); + return this; + } + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + public AccountingAttachment withContentType(JsonNullable contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + 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 AccountingAttachment withDateCreated(String dateCreated) { + Utils.checkNotNull(dateCreated, "dateCreated"); + this.dateCreated = Optional.ofNullable(dateCreated); + 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 AccountingAttachment withDateCreated(Optional dateCreated) { + Utils.checkNotNull(dateCreated, "dateCreated"); + this.dateCreated = dateCreated; + return this; + } + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + public AccountingAttachment withFileSize(int fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = JsonNullable.of(fileSize); + return this; + } + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + public AccountingAttachment withFileSize(JsonNullable fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = fileSize; + return this; + } + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + public AccountingAttachment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + public AccountingAttachment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + public AccountingAttachment withIncludeWhenSent(boolean includeWhenSent) { + Utils.checkNotNull(includeWhenSent, "includeWhenSent"); + this.includeWhenSent = Optional.ofNullable(includeWhenSent); + return this; + } + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + public AccountingAttachment withIncludeWhenSent(Optional includeWhenSent) { + Utils.checkNotNull(includeWhenSent, "includeWhenSent"); + this.includeWhenSent = includeWhenSent; + return this; + } + + public AccountingAttachment withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingAttachment withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the attachment file. + */ + public AccountingAttachment withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the attachment file. + */ + public AccountingAttachment withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AccountingAttachment withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingAttachment withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingAttachment other = (AccountingAttachment) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.dateCreated, other.dateCreated) && + java.util.Objects.deepEquals(this.fileSize, other.fileSize) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.includeWhenSent, other.includeWhenSent) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + dateCreated, + fileSize, + id, + includeWhenSent, + modifiedDate, + name, + sourceModifiedDate); + } + + @Override + public String toString() { + return Utils.toString(AccountingAttachment.class, + "contentType", contentType, + "dateCreated", dateCreated, + "fileSize", fileSize, + "id", id, + "includeWhenSent", includeWhenSent, + "modifiedDate", modifiedDate, + "name", name, + "sourceModifiedDate", sourceModifiedDate); + } + + public final static class Builder { + + private JsonNullable contentType = JsonNullable.undefined(); + + private Optional dateCreated = Optional.empty(); + + private JsonNullable fileSize = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional includeWhenSent = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = JsonNullable.of(contentType); + return this; + } + + /** + * File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + * + * Supported file types vary per platform. + */ + public Builder contentType(JsonNullable contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + 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 dateCreated(String dateCreated) { + Utils.checkNotNull(dateCreated, "dateCreated"); + this.dateCreated = Optional.ofNullable(dateCreated); + 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 dateCreated(Optional dateCreated) { + Utils.checkNotNull(dateCreated, "dateCreated"); + this.dateCreated = dateCreated; + return this; + } + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + public Builder fileSize(int fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = JsonNullable.of(fileSize); + return this; + } + + /** + * File size in bytes. For example, if this reads **46153**, then the file size is 46kb. + */ + public Builder fileSize(JsonNullable fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = fileSize; + return this; + } + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the attachment, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + public Builder includeWhenSent(boolean includeWhenSent) { + Utils.checkNotNull(includeWhenSent, "includeWhenSent"); + this.includeWhenSent = Optional.ofNullable(includeWhenSent); + return this; + } + + /** + * If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting platform allows this. + */ + public Builder includeWhenSent(Optional includeWhenSent) { + Utils.checkNotNull(includeWhenSent, "includeWhenSent"); + this.includeWhenSent = includeWhenSent; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the attachment file. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the attachment file. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + public AccountingAttachment build() { + return new AccountingAttachment( + contentType, + dateCreated, + fileSize, + id, + includeWhenSent, + modifiedDate, + name, + sourceModifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBalanceSheet.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBalanceSheet.java new file mode 100644 index 00000000..caf21c74 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBalanceSheet.java @@ -0,0 +1,515 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingBalanceSheet - > View the coverage for balance sheet in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=balanceSheet" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * The balance sheet is a snapshot of a company's accounts at a single point in time that provides a statement of the assets, liabilities and equity of an organization. It gives interested parties an idea of the company's financial position, in addition to displaying what the company owns and owes. + * + * > **Balance sheet or profit and loss report?** + * > + * > A profit and loss report summarises the total revenue, expenses, and profit or loss during a specified time period. A balance sheet report shows the financial position of a company at a specific moment in time. + * + * **Structure of this report** + * This report will reflect the structure and line descriptions that the business has set in their own accounting platform. + * + * **History** + * By default, Codat pulls (up to) 24 months of balance sheets for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `balanceSheet` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/update-sync-settings). + * + * **Want to pull this in a standardised structure?** + * Our [Enhanced Financials](https://docs.codat.io/assess/enhanced-financials/overview) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. + */ + +public class AccountingBalanceSheet { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("earliestAvailableMonth") + private Optional earliestAvailableMonth; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("mostRecentAvailableMonth") + private Optional mostRecentAvailableMonth; + + /** + * An array of balance sheet reports. + */ + @JsonProperty("reports") + private java.util.List reports; + + public AccountingBalanceSheet( + @JsonProperty("currency") String currency, + @JsonProperty("earliestAvailableMonth") Optional earliestAvailableMonth, + @JsonProperty("mostRecentAvailableMonth") Optional mostRecentAvailableMonth, + @JsonProperty("reports") java.util.List reports) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + Utils.checkNotNull(reports, "reports"); + this.currency = currency; + this.earliestAvailableMonth = earliestAvailableMonth; + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + this.reports = reports; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * 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 Optional earliestAvailableMonth() { + return earliestAvailableMonth; + } + + /** + * 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 Optional mostRecentAvailableMonth() { + return mostRecentAvailableMonth; + } + + /** + * An array of balance sheet reports. + */ + public java.util.List reports() { + return reports; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBalanceSheet withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 AccountingBalanceSheet withEarliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 AccountingBalanceSheet withEarliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 AccountingBalanceSheet withMostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 AccountingBalanceSheet withMostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * An array of balance sheet reports. + */ + public AccountingBalanceSheet withReports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBalanceSheet other = (AccountingBalanceSheet) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.earliestAvailableMonth, other.earliestAvailableMonth) && + java.util.Objects.deepEquals(this.mostRecentAvailableMonth, other.mostRecentAvailableMonth) && + java.util.Objects.deepEquals(this.reports, other.reports); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reports); + } + + @Override + public String toString() { + return Utils.toString(AccountingBalanceSheet.class, + "currency", currency, + "earliestAvailableMonth", earliestAvailableMonth, + "mostRecentAvailableMonth", mostRecentAvailableMonth, + "reports", reports); + } + + public final static class Builder { + + private String currency; + + private Optional earliestAvailableMonth = Optional.empty(); + + private Optional mostRecentAvailableMonth = Optional.empty(); + + private java.util.List reports; + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 earliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 earliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 mostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 mostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * An array of balance sheet reports. + */ + public Builder reports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + public AccountingBalanceSheet build() { + return new AccountingBalanceSheet( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reports); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccount.java new file mode 100644 index 00000000..ec5445d0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccount.java @@ -0,0 +1,1092 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingBankAccount - > **Accessing Bank Accounts through Banking API** + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > + * > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/schemas/Account) + * + * > View the coverage for bank accounts in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * A list of bank accounts associated with a company and a specific data connection. + * + * Bank accounts data includes: + * * The name and ID of the account in the accounting platform. + * * The currency and balance of the account. + * * The sort code and account number. + */ + +public class AccountingBankAccount { + + /** + * Name of the bank account in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountName") + private JsonNullable accountName; + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountNumber") + private JsonNullable accountNumber; + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountType") + private Optional accountType; + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("availableBalance") + private JsonNullable availableBalance; + + /** + * Balance of the bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private JsonNullable balance; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("iBan") + private JsonNullable iBan; + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The institution of the bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("institution") + private JsonNullable institution; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Code used to identify each nominal account for a business. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nominalCode") + private JsonNullable nominalCode; + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("overdraftLimit") + private JsonNullable overdraftLimit; + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sortCode") + private JsonNullable sortCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + public AccountingBankAccount( + @JsonProperty("accountName") JsonNullable accountName, + @JsonProperty("accountNumber") JsonNullable accountNumber, + @JsonProperty("accountType") Optional accountType, + @JsonProperty("availableBalance") JsonNullable availableBalance, + @JsonProperty("balance") JsonNullable balance, + @JsonProperty("currency") Optional currency, + @JsonProperty("iBan") JsonNullable iBan, + @JsonProperty("id") Optional id, + @JsonProperty("institution") JsonNullable institution, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("nominalCode") JsonNullable nominalCode, + @JsonProperty("overdraftLimit") JsonNullable overdraftLimit, + @JsonProperty("sortCode") JsonNullable sortCode, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData) { + Utils.checkNotNull(accountName, "accountName"); + Utils.checkNotNull(accountNumber, "accountNumber"); + Utils.checkNotNull(accountType, "accountType"); + Utils.checkNotNull(availableBalance, "availableBalance"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(iBan, "iBan"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(institution, "institution"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(nominalCode, "nominalCode"); + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + Utils.checkNotNull(sortCode, "sortCode"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + this.accountName = accountName; + this.accountNumber = accountNumber; + this.accountType = accountType; + this.availableBalance = availableBalance; + this.balance = balance; + this.currency = currency; + this.iBan = iBan; + this.id = id; + this.institution = institution; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.nominalCode = nominalCode; + this.overdraftLimit = overdraftLimit; + this.sortCode = sortCode; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + } + + /** + * Name of the bank account in the accounting platform. + */ + public JsonNullable accountName() { + return accountName; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public JsonNullable accountNumber() { + return accountNumber; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Optional accountType() { + return accountType; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public JsonNullable availableBalance() { + return availableBalance; + } + + /** + * Balance of the bank account. + */ + public JsonNullable balance() { + return balance; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public JsonNullable iBan() { + return iBan; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * The institution of the bank account. + */ + public JsonNullable institution() { + return institution; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Code used to identify each nominal account for a business. + */ + public JsonNullable nominalCode() { + return nominalCode; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public JsonNullable overdraftLimit() { + return overdraftLimit; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public JsonNullable sortCode() { + return sortCode; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the bank account in the accounting platform. + */ + public AccountingBankAccount withAccountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = JsonNullable.of(accountName); + return this; + } + + /** + * Name of the bank account in the accounting platform. + */ + public AccountingBankAccount withAccountName(JsonNullable accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public AccountingBankAccount withAccountNumber(String accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = JsonNullable.of(accountNumber); + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public AccountingBankAccount withAccountNumber(JsonNullable accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = accountNumber; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public AccountingBankAccount withAccountType(AccountingBankAccountType accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public AccountingBankAccount withAccountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public AccountingBankAccount withAvailableBalance(double availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = JsonNullable.of(availableBalance); + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public AccountingBankAccount withAvailableBalance(JsonNullable availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = availableBalance; + return this; + } + + /** + * Balance of the bank account. + */ + public AccountingBankAccount withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = JsonNullable.of(balance); + return this; + } + + /** + * Balance of the bank account. + */ + public AccountingBankAccount withBalance(JsonNullable balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBankAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBankAccount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public AccountingBankAccount withIBan(String iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = JsonNullable.of(iBan); + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public AccountingBankAccount withIBan(JsonNullable iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = iBan; + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public AccountingBankAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public AccountingBankAccount withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution of the bank account. + */ + public AccountingBankAccount withInstitution(String institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = JsonNullable.of(institution); + return this; + } + + /** + * The institution of the bank account. + */ + public AccountingBankAccount withInstitution(JsonNullable institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public AccountingBankAccount withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingBankAccount withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingBankAccount withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingBankAccount withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public AccountingBankAccount withNominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public AccountingBankAccount withNominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public AccountingBankAccount withOverdraftLimit(double overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = JsonNullable.of(overdraftLimit); + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public AccountingBankAccount withOverdraftLimit(JsonNullable overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = overdraftLimit; + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public AccountingBankAccount withSortCode(String sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = JsonNullable.of(sortCode); + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public AccountingBankAccount withSortCode(JsonNullable sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = sortCode; + return this; + } + + public AccountingBankAccount withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingBankAccount withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBankAccount withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBankAccount withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBankAccount other = (AccountingBankAccount) o; + return + java.util.Objects.deepEquals(this.accountName, other.accountName) && + java.util.Objects.deepEquals(this.accountNumber, other.accountNumber) && + java.util.Objects.deepEquals(this.accountType, other.accountType) && + java.util.Objects.deepEquals(this.availableBalance, other.availableBalance) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.iBan, other.iBan) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.institution, other.institution) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.nominalCode, other.nominalCode) && + java.util.Objects.deepEquals(this.overdraftLimit, other.overdraftLimit) && + java.util.Objects.deepEquals(this.sortCode, other.sortCode) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountName, + accountNumber, + accountType, + availableBalance, + balance, + currency, + iBan, + id, + institution, + metadata, + modifiedDate, + nominalCode, + overdraftLimit, + sortCode, + sourceModifiedDate, + supplementalData); + } + + @Override + public String toString() { + return Utils.toString(AccountingBankAccount.class, + "accountName", accountName, + "accountNumber", accountNumber, + "accountType", accountType, + "availableBalance", availableBalance, + "balance", balance, + "currency", currency, + "iBan", iBan, + "id", id, + "institution", institution, + "metadata", metadata, + "modifiedDate", modifiedDate, + "nominalCode", nominalCode, + "overdraftLimit", overdraftLimit, + "sortCode", sortCode, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData); + } + + public final static class Builder { + + private JsonNullable accountName = JsonNullable.undefined(); + + private JsonNullable accountNumber = JsonNullable.undefined(); + + private Optional accountType = Optional.empty(); + + private JsonNullable availableBalance = JsonNullable.undefined(); + + private JsonNullable balance = JsonNullable.undefined(); + + private Optional currency = Optional.empty(); + + private JsonNullable iBan = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private JsonNullable institution = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable nominalCode = JsonNullable.undefined(); + + private JsonNullable overdraftLimit = JsonNullable.undefined(); + + private JsonNullable sortCode = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the bank account in the accounting platform. + */ + public Builder accountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = JsonNullable.of(accountName); + return this; + } + + /** + * Name of the bank account in the accounting platform. + */ + public Builder accountName(JsonNullable accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public Builder accountNumber(String accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = JsonNullable.of(accountNumber); + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public Builder accountNumber(JsonNullable accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = accountNumber; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Builder accountType(AccountingBankAccountType accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Builder accountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public Builder availableBalance(double availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = JsonNullable.of(availableBalance); + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public Builder availableBalance(JsonNullable availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = availableBalance; + return this; + } + + /** + * Balance of the bank account. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = JsonNullable.of(balance); + return this; + } + + /** + * Balance of the bank account. + */ + public Builder balance(JsonNullable balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public Builder iBan(String iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = JsonNullable.of(iBan); + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public Builder iBan(JsonNullable iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = iBan; + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution of the bank account. + */ + public Builder institution(String institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = JsonNullable.of(institution); + return this; + } + + /** + * The institution of the bank account. + */ + public Builder institution(JsonNullable institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public Builder nominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public Builder nominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public Builder overdraftLimit(double overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = JsonNullable.of(overdraftLimit); + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public Builder overdraftLimit(JsonNullable overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = overdraftLimit; + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public Builder sortCode(String sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = JsonNullable.of(sortCode); + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public Builder sortCode(JsonNullable sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = sortCode; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public AccountingBankAccount build() { + return new AccountingBankAccount( + accountName, + accountNumber, + accountType, + availableBalance, + balance, + currency, + iBan, + id, + institution, + metadata, + modifiedDate, + nominalCode, + overdraftLimit, + sortCode, + sourceModifiedDate, + supplementalData); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccountType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccountType.java new file mode 100644 index 00000000..6bc0117a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccountType.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountingBankAccountType - The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ +public enum AccountingBankAccountType { + UNKNOWN("Unknown"), + CREDIT("Credit"), + DEBIT("Debit"); + + @JsonValue + private final String value; + + private AccountingBankAccountType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccounts.java new file mode 100644 index 00000000..c9a6d27a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankAccounts.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingBankAccounts { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingBankAccounts( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingBankAccounts withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingBankAccounts withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingBankAccounts withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingBankAccounts withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingBankAccounts withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingBankAccounts withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBankAccounts other = (AccountingBankAccounts) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingBankAccounts.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingBankAccounts build() { + return new AccountingBankAccounts( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransaction.java new file mode 100644 index 00000000..cba7cd2e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransaction.java @@ -0,0 +1,738 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingBankTransaction - > **Accessing Bank Accounts through Banking API** + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > + * > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/operations/list-all-banking-transactions) + * + * > View the coverage for bank transactions in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankTransactions" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Transactional banking data for a specific company and account. + * + * Bank transactions include the: + * * Amount of the transaction. + * * Current account balance. + * * Transaction type, for example, credit, debit, or transfer. + */ + +public class AccountingBankTransaction { + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private JsonNullable accountId; + + /** + * The amount transacted in the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * The remaining balance in the account with ID `accountId`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private Optional balance; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("clearedOnDate") + private Optional clearedOnDate; + + /** + * Description of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reconciled") + private Optional reconciled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Type of transaction for the bank statement line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactionType") + private Optional transactionType; + + public AccountingBankTransaction( + @JsonProperty("accountId") JsonNullable accountId, + @JsonProperty("amount") Optional amount, + @JsonProperty("balance") Optional balance, + @JsonProperty("clearedOnDate") Optional clearedOnDate, + @JsonProperty("description") JsonNullable description, + @JsonProperty("id") Optional id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("reconciled") Optional reconciled, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("transactionType") Optional transactionType) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(clearedOnDate, "clearedOnDate"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(reconciled, "reconciled"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(transactionType, "transactionType"); + this.accountId = accountId; + this.amount = amount; + this.balance = balance; + this.clearedOnDate = clearedOnDate; + this.description = description; + this.id = id; + this.modifiedDate = modifiedDate; + this.reconciled = reconciled; + this.sourceModifiedDate = sourceModifiedDate; + this.transactionType = transactionType; + } + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + public JsonNullable accountId() { + return accountId; + } + + /** + * The amount transacted in the bank transaction. + */ + public Optional amount() { + return amount; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Optional balance() { + return balance; + } + + /** + * 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 Optional clearedOnDate() { + return clearedOnDate; + } + + /** + * Description of the bank transaction. + */ + public JsonNullable description() { + return description; + } + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + public Optional reconciled() { + return reconciled; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Type of transaction for the bank statement line. + */ + public Optional transactionType() { + return transactionType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + public AccountingBankTransaction withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + public AccountingBankTransaction withAccountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public AccountingBankTransaction withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public AccountingBankTransaction withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public AccountingBankTransaction withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public AccountingBankTransaction withBalance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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 AccountingBankTransaction withClearedOnDate(String clearedOnDate) { + Utils.checkNotNull(clearedOnDate, "clearedOnDate"); + this.clearedOnDate = Optional.ofNullable(clearedOnDate); + 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 AccountingBankTransaction withClearedOnDate(Optional clearedOnDate) { + Utils.checkNotNull(clearedOnDate, "clearedOnDate"); + this.clearedOnDate = clearedOnDate; + return this; + } + + /** + * Description of the bank transaction. + */ + public AccountingBankTransaction withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the bank transaction. + */ + public AccountingBankTransaction withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + public AccountingBankTransaction withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + public AccountingBankTransaction withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingBankTransaction withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingBankTransaction withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + public AccountingBankTransaction withReconciled(boolean reconciled) { + Utils.checkNotNull(reconciled, "reconciled"); + this.reconciled = Optional.ofNullable(reconciled); + return this; + } + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + public AccountingBankTransaction withReconciled(Optional reconciled) { + Utils.checkNotNull(reconciled, "reconciled"); + this.reconciled = reconciled; + return this; + } + + public AccountingBankTransaction withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingBankTransaction withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Type of transaction for the bank statement line. + */ + public AccountingBankTransaction withTransactionType(BankTransactionType transactionType) { + Utils.checkNotNull(transactionType, "transactionType"); + this.transactionType = Optional.ofNullable(transactionType); + return this; + } + + /** + * Type of transaction for the bank statement line. + */ + public AccountingBankTransaction withTransactionType(Optional transactionType) { + Utils.checkNotNull(transactionType, "transactionType"); + this.transactionType = transactionType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBankTransaction other = (AccountingBankTransaction) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.clearedOnDate, other.clearedOnDate) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.reconciled, other.reconciled) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.transactionType, other.transactionType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + amount, + balance, + clearedOnDate, + description, + id, + modifiedDate, + reconciled, + sourceModifiedDate, + transactionType); + } + + @Override + public String toString() { + return Utils.toString(AccountingBankTransaction.class, + "accountId", accountId, + "amount", amount, + "balance", balance, + "clearedOnDate", clearedOnDate, + "description", description, + "id", id, + "modifiedDate", modifiedDate, + "reconciled", reconciled, + "sourceModifiedDate", sourceModifiedDate, + "transactionType", transactionType); + } + + public final static class Builder { + + private JsonNullable accountId = JsonNullable.undefined(); + + private Optional amount = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional clearedOnDate = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional reconciled = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional transactionType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Unique identifier to the `accountId` the bank transactions originates from. + */ + public Builder accountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Builder balance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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 clearedOnDate(String clearedOnDate) { + Utils.checkNotNull(clearedOnDate, "clearedOnDate"); + this.clearedOnDate = Optional.ofNullable(clearedOnDate); + 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 clearedOnDate(Optional clearedOnDate) { + Utils.checkNotNull(clearedOnDate, "clearedOnDate"); + this.clearedOnDate = clearedOnDate; + return this; + } + + /** + * Description of the bank transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the bank transaction. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bank transaction, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + public Builder reconciled(boolean reconciled) { + Utils.checkNotNull(reconciled, "reconciled"); + this.reconciled = Optional.ofNullable(reconciled); + return this; + } + + /** + * `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting platform. + */ + public Builder reconciled(Optional reconciled) { + Utils.checkNotNull(reconciled, "reconciled"); + this.reconciled = reconciled; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Type of transaction for the bank statement line. + */ + public Builder transactionType(BankTransactionType transactionType) { + Utils.checkNotNull(transactionType, "transactionType"); + this.transactionType = Optional.ofNullable(transactionType); + return this; + } + + /** + * Type of transaction for the bank statement line. + */ + public Builder transactionType(Optional transactionType) { + Utils.checkNotNull(transactionType, "transactionType"); + this.transactionType = transactionType; + return this; + } + + public AccountingBankTransaction build() { + return new AccountingBankTransaction( + accountId, + amount, + balance, + clearedOnDate, + description, + id, + modifiedDate, + reconciled, + sourceModifiedDate, + transactionType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransactions.java new file mode 100644 index 00000000..1019a5d3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBankTransactions.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingBankTransactions { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingBankTransactions( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingBankTransactions withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingBankTransactions withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingBankTransactions withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingBankTransactions withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingBankTransactions withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingBankTransactions withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBankTransactions other = (AccountingBankTransactions) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingBankTransactions.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingBankTransactions build() { + return new AccountingBankTransactions( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBill.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBill.java new file mode 100644 index 00000000..289b05b0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBill.java @@ -0,0 +1,1337 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingBill - > **Invoices or bills?** + * > + * > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + * > + * > See [Invoices](https://docs.codat.io/lending-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + * + * View the coverage for bills in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * In Codat, a bill contains details of: + * * When the bill was recorded in the accounting system. + * * How much the bill is for and the currency of the amount. + * * Who the bill was received from — the *supplier*. + * * What the bill is for — the *line items*. + * + * Some accounting platforms give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + * + * You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. + */ + +public class AccountingBill { + + /** + * Amount outstanding on the bill. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amountDue") + private JsonNullable amountDue; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonProperty("issueDate") + private String issueDate; + + /** + * Array of Bill line items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineItems") + private JsonNullable> lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any private, company notes about the bill, such as payment information. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentAllocations") + private JsonNullable> paymentAllocations; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("purchaseOrderRefs") + private JsonNullable> purchaseOrderRefs; + + /** + * User-friendly reference for the bill. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current state of the bill. + */ + @JsonProperty("status") + private BillStatus status; + + /** + * Total amount of the bill, excluding any taxes. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Reference to the supplier the record relates to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierRef") + private Optional supplierRef; + + /** + * Amount of tax on the bill. + */ + @JsonProperty("taxAmount") + private double taxAmount; + + /** + * Amount of the bill, including tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("withholdingTax") + private JsonNullable> withholdingTax; + + public AccountingBill( + @JsonProperty("amountDue") JsonNullable amountDue, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") JsonNullable> lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") JsonNullable> paymentAllocations, + @JsonProperty("purchaseOrderRefs") JsonNullable> purchaseOrderRefs, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") BillStatus status, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("supplierRef") Optional supplierRef, + @JsonProperty("taxAmount") double taxAmount, + @JsonProperty("totalAmount") double totalAmount, + @JsonProperty("withholdingTax") JsonNullable> withholdingTax) { + Utils.checkNotNull(amountDue, "amountDue"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(purchaseOrderRefs, "purchaseOrderRefs"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(supplierRef, "supplierRef"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.amountDue = amountDue; + this.currency = currency; + this.currencyRate = currencyRate; + this.dueDate = dueDate; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.purchaseOrderRefs = purchaseOrderRefs; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.supplierRef = supplierRef; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.withholdingTax = withholdingTax; + } + + /** + * Amount outstanding on the bill. + */ + public JsonNullable amountDue() { + return amountDue; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public Optional dueDate() { + return dueDate; + } + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public String issueDate() { + return issueDate; + } + + /** + * Array of Bill line items. + */ + public JsonNullable> lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any private, company notes about the bill, such as payment information. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public JsonNullable> paymentAllocations() { + return paymentAllocations; + } + + public JsonNullable> purchaseOrderRefs() { + return purchaseOrderRefs; + } + + /** + * User-friendly reference for the bill. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current state of the bill. + */ + public BillStatus status() { + return status; + } + + /** + * Total amount of the bill, excluding any taxes. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Reference to the supplier the record relates to. + */ + public Optional supplierRef() { + return supplierRef; + } + + /** + * Amount of tax on the bill. + */ + public double taxAmount() { + return taxAmount; + } + + /** + * Amount of the bill, including tax. + */ + public double totalAmount() { + return totalAmount; + } + + public JsonNullable> withholdingTax() { + return withholdingTax; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount outstanding on the bill. + */ + public AccountingBill withAmountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = JsonNullable.of(amountDue); + return this; + } + + /** + * Amount outstanding on the bill. + */ + public AccountingBill withAmountDue(JsonNullable amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBill withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBill withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBill withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBill withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingBill withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + public AccountingBill withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + public AccountingBill withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + public AccountingBill withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingBill withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * Array of Bill line items. + */ + public AccountingBill withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * Array of Bill line items. + */ + public AccountingBill withLineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingBill withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingBill withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingBill withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingBill withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any private, company notes about the bill, such as payment information. + */ + public AccountingBill withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any private, company notes about the bill, such as payment information. + */ + public AccountingBill withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingBill withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingBill withPaymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + public AccountingBill withPurchaseOrderRefs(java.util.List purchaseOrderRefs) { + Utils.checkNotNull(purchaseOrderRefs, "purchaseOrderRefs"); + this.purchaseOrderRefs = JsonNullable.of(purchaseOrderRefs); + return this; + } + + public AccountingBill withPurchaseOrderRefs(JsonNullable> purchaseOrderRefs) { + Utils.checkNotNull(purchaseOrderRefs, "purchaseOrderRefs"); + this.purchaseOrderRefs = purchaseOrderRefs; + return this; + } + + /** + * User-friendly reference for the bill. + */ + public AccountingBill withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the bill. + */ + public AccountingBill withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingBill withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingBill withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the bill. + */ + public AccountingBill withStatus(BillStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the bill, excluding any taxes. + */ + public AccountingBill withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBill withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBill withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public AccountingBill withSupplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public AccountingBill withSupplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Amount of tax on the bill. + */ + public AccountingBill withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Amount of the bill, including tax. + */ + public AccountingBill withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingBill withWithholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public AccountingBill withWithholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBill other = (AccountingBill) o; + return + java.util.Objects.deepEquals(this.amountDue, other.amountDue) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.purchaseOrderRefs, other.purchaseOrderRefs) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.supplierRef, other.supplierRef) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.withholdingTax, other.withholdingTax); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amountDue, + currency, + currencyRate, + dueDate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + purchaseOrderRefs, + reference, + sourceModifiedDate, + status, + subTotal, + supplementalData, + supplierRef, + taxAmount, + totalAmount, + withholdingTax); + } + + @Override + public String toString() { + return Utils.toString(AccountingBill.class, + "amountDue", amountDue, + "currency", currency, + "currencyRate", currencyRate, + "dueDate", dueDate, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "purchaseOrderRefs", purchaseOrderRefs, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "subTotal", subTotal, + "supplementalData", supplementalData, + "supplierRef", supplierRef, + "taxAmount", taxAmount, + "totalAmount", totalAmount, + "withholdingTax", withholdingTax); + } + + public final static class Builder { + + private JsonNullable amountDue = JsonNullable.undefined(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional dueDate = Optional.empty(); + + private Optional id = Optional.empty(); + + private String issueDate; + + private JsonNullable> lineItems = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private JsonNullable> paymentAllocations = JsonNullable.undefined(); + + private JsonNullable> purchaseOrderRefs = JsonNullable.undefined(); + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private BillStatus status; + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Optional supplierRef = Optional.empty(); + + private Double taxAmount; + + private Double totalAmount; + + private JsonNullable> withholdingTax = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Amount outstanding on the bill. + */ + public Builder amountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = JsonNullable.of(amountDue); + return this; + } + + /** + * Amount outstanding on the bill. + */ + public Builder amountDue(JsonNullable amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + return this; + } + + public Builder dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * Array of Bill line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * Array of Bill line items. + */ + public Builder lineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any private, company notes about the bill, such as payment information. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any private, company notes about the bill, such as payment information. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + public Builder purchaseOrderRefs(java.util.List purchaseOrderRefs) { + Utils.checkNotNull(purchaseOrderRefs, "purchaseOrderRefs"); + this.purchaseOrderRefs = JsonNullable.of(purchaseOrderRefs); + return this; + } + + public Builder purchaseOrderRefs(JsonNullable> purchaseOrderRefs) { + Utils.checkNotNull(purchaseOrderRefs, "purchaseOrderRefs"); + this.purchaseOrderRefs = purchaseOrderRefs; + return this; + } + + /** + * User-friendly reference for the bill. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the bill. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the bill. + */ + public Builder status(BillStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the bill, excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public Builder supplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public Builder supplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Amount of tax on the bill. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Amount of the bill, including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public Builder withholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public Builder withholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + public AccountingBill build() { + return new AccountingBill( + amountDue, + currency, + currencyRate, + dueDate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + purchaseOrderRefs, + reference, + sourceModifiedDate, + status, + subTotal, + supplementalData, + supplierRef, + taxAmount, + totalAmount, + withholdingTax); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNote.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNote.java new file mode 100644 index 00000000..8d3b70fa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNote.java @@ -0,0 +1,1638 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingBillCreditNote - > **Bill credit notes or credit notes?** + * > + * > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + * + * View the coverage for bill credit notes in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + * + * In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/lending-api#/schemas/Supplier). + * + * A bill credit note includes details of: + * * The original and remaining credit. + * * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/lending-api#/schemas/Bill). + * * The supplier that issued the bill credit note. + */ + +public class AccountingBillCreditNote { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allocatedOnDate") + private Optional allocatedOnDate; + + /** + * Friendly reference for the bill credit note. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("billCreditNoteNumber") + private JsonNullable billCreditNoteNumber; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Percentage rate of any discount applied to the bill credit note. + */ + @JsonProperty("discountPercentage") + private double discountPercentage; + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("issueDate") + private Optional issueDate; + + /** + * An array of line + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineItems") + private JsonNullable> lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information about the bill credit note. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentAllocations") + private JsonNullable> paymentAllocations; + + /** + * Amount of the bill credit note that is still outstanding. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("remainingCredit") + private Optional remainingCredit; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current state of the bill credit note + */ + @JsonProperty("status") + private BillCreditNoteStatus status; + + /** + * Total amount of the bill credit note, including discounts but excluding tax. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Reference to the supplier the record relates to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierRef") + private Optional supplierRef; + + /** + * Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + /** + * Total value of any discounts applied. + */ + @JsonProperty("totalDiscount") + private double totalDiscount; + + /** + * Amount of tax included in the bill credit note. + */ + @JsonProperty("totalTaxAmount") + private double totalTaxAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("withholdingTax") + private JsonNullable> withholdingTax; + + public AccountingBillCreditNote( + @JsonProperty("allocatedOnDate") Optional allocatedOnDate, + @JsonProperty("billCreditNoteNumber") JsonNullable billCreditNoteNumber, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("discountPercentage") double discountPercentage, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") Optional issueDate, + @JsonProperty("lineItems") JsonNullable> lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") JsonNullable> paymentAllocations, + @JsonProperty("remainingCredit") Optional remainingCredit, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") BillCreditNoteStatus status, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("supplierRef") Optional supplierRef, + @JsonProperty("totalAmount") double totalAmount, + @JsonProperty("totalDiscount") double totalDiscount, + @JsonProperty("totalTaxAmount") double totalTaxAmount, + @JsonProperty("withholdingTax") JsonNullable> withholdingTax) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + Utils.checkNotNull(billCreditNoteNumber, "billCreditNoteNumber"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(remainingCredit, "remainingCredit"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(supplierRef, "supplierRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(totalDiscount, "totalDiscount"); + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.allocatedOnDate = allocatedOnDate; + this.billCreditNoteNumber = billCreditNoteNumber; + this.currency = currency; + this.currencyRate = currencyRate; + this.discountPercentage = discountPercentage; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.remainingCredit = remainingCredit; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.supplierRef = supplierRef; + this.totalAmount = totalAmount; + this.totalDiscount = totalDiscount; + this.totalTaxAmount = totalTaxAmount; + this.withholdingTax = withholdingTax; + } + + /** + * 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 Optional allocatedOnDate() { + return allocatedOnDate; + } + + /** + * Friendly reference for the bill credit note. + */ + public JsonNullable billCreditNoteNumber() { + return billCreditNoteNumber; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Percentage rate of any discount applied to the bill credit note. + */ + public double discountPercentage() { + return discountPercentage; + } + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * 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 Optional issueDate() { + return issueDate; + } + + /** + * An array of line + */ + public JsonNullable> lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information about the bill credit note. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public JsonNullable> paymentAllocations() { + return paymentAllocations; + } + + /** + * Amount of the bill credit note that is still outstanding. + */ + public Optional remainingCredit() { + return remainingCredit; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current state of the bill credit note + */ + public BillCreditNoteStatus status() { + return status; + } + + /** + * Total amount of the bill credit note, including discounts but excluding tax. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Reference to the supplier the record relates to. + */ + public Optional supplierRef() { + return supplierRef; + } + + /** + * Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. + */ + public double totalAmount() { + return totalAmount; + } + + /** + * Total value of any discounts applied. + */ + public double totalDiscount() { + return totalDiscount; + } + + /** + * Amount of tax included in the bill credit note. + */ + public double totalTaxAmount() { + return totalTaxAmount; + } + + public JsonNullable> withholdingTax() { + return withholdingTax; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 AccountingBillCreditNote withAllocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 AccountingBillCreditNote withAllocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Friendly reference for the bill credit note. + */ + public AccountingBillCreditNote withBillCreditNoteNumber(String billCreditNoteNumber) { + Utils.checkNotNull(billCreditNoteNumber, "billCreditNoteNumber"); + this.billCreditNoteNumber = JsonNullable.of(billCreditNoteNumber); + return this; + } + + /** + * Friendly reference for the bill credit note. + */ + public AccountingBillCreditNote withBillCreditNoteNumber(JsonNullable billCreditNoteNumber) { + Utils.checkNotNull(billCreditNoteNumber, "billCreditNoteNumber"); + this.billCreditNoteNumber = billCreditNoteNumber; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBillCreditNote withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingBillCreditNote withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBillCreditNote withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBillCreditNote withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Percentage rate of any discount applied to the bill credit note. + */ + public AccountingBillCreditNote withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + public AccountingBillCreditNote withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + public AccountingBillCreditNote withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 AccountingBillCreditNote withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 AccountingBillCreditNote withIssueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line + */ + public AccountingBillCreditNote withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * An array of line + */ + public AccountingBillCreditNote withLineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingBillCreditNote withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingBillCreditNote withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingBillCreditNote withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingBillCreditNote withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the bill credit note. + */ + public AccountingBillCreditNote withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the bill credit note. + */ + public AccountingBillCreditNote withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingBillCreditNote withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingBillCreditNote withPaymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * Amount of the bill credit note that is still outstanding. + */ + public AccountingBillCreditNote withRemainingCredit(double remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = Optional.ofNullable(remainingCredit); + return this; + } + + /** + * Amount of the bill credit note that is still outstanding. + */ + public AccountingBillCreditNote withRemainingCredit(Optional remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = remainingCredit; + return this; + } + + public AccountingBillCreditNote withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingBillCreditNote withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the bill credit note + */ + public AccountingBillCreditNote withStatus(BillCreditNoteStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the bill credit note, including discounts but excluding tax. + */ + public AccountingBillCreditNote withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBillCreditNote withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBillCreditNote withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public AccountingBillCreditNote withSupplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public AccountingBillCreditNote withSupplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. + */ + public AccountingBillCreditNote withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total value of any discounts applied. + */ + public AccountingBillCreditNote withTotalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Amount of tax included in the bill credit note. + */ + public AccountingBillCreditNote withTotalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public AccountingBillCreditNote withWithholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public AccountingBillCreditNote withWithholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBillCreditNote other = (AccountingBillCreditNote) o; + return + java.util.Objects.deepEquals(this.allocatedOnDate, other.allocatedOnDate) && + java.util.Objects.deepEquals(this.billCreditNoteNumber, other.billCreditNoteNumber) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.remainingCredit, other.remainingCredit) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.supplierRef, other.supplierRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.totalDiscount, other.totalDiscount) && + java.util.Objects.deepEquals(this.totalTaxAmount, other.totalTaxAmount) && + java.util.Objects.deepEquals(this.withholdingTax, other.withholdingTax); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allocatedOnDate, + billCreditNoteNumber, + currency, + currencyRate, + discountPercentage, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + remainingCredit, + sourceModifiedDate, + status, + subTotal, + supplementalData, + supplierRef, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + + @Override + public String toString() { + return Utils.toString(AccountingBillCreditNote.class, + "allocatedOnDate", allocatedOnDate, + "billCreditNoteNumber", billCreditNoteNumber, + "currency", currency, + "currencyRate", currencyRate, + "discountPercentage", discountPercentage, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "remainingCredit", remainingCredit, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "subTotal", subTotal, + "supplementalData", supplementalData, + "supplierRef", supplierRef, + "totalAmount", totalAmount, + "totalDiscount", totalDiscount, + "totalTaxAmount", totalTaxAmount, + "withholdingTax", withholdingTax); + } + + public final static class Builder { + + private Optional allocatedOnDate = Optional.empty(); + + private JsonNullable billCreditNoteNumber = JsonNullable.undefined(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Double discountPercentage; + + private Optional id = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private JsonNullable> lineItems = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private JsonNullable> paymentAllocations = JsonNullable.undefined(); + + private Optional remainingCredit = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private BillCreditNoteStatus status; + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Optional supplierRef = Optional.empty(); + + private Double totalAmount; + + private Double totalDiscount; + + private Double totalTaxAmount; + + private JsonNullable> withholdingTax = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 allocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 allocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Friendly reference for the bill credit note. + */ + public Builder billCreditNoteNumber(String billCreditNoteNumber) { + Utils.checkNotNull(billCreditNoteNumber, "billCreditNoteNumber"); + this.billCreditNoteNumber = JsonNullable.of(billCreditNoteNumber); + return this; + } + + /** + * Friendly reference for the bill credit note. + */ + public Builder billCreditNoteNumber(JsonNullable billCreditNoteNumber) { + Utils.checkNotNull(billCreditNoteNumber, "billCreditNoteNumber"); + this.billCreditNoteNumber = billCreditNoteNumber; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Percentage rate of any discount applied to the bill credit note. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill credit note that is unique to a company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 issueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * An array of line + */ + public Builder lineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the bill credit note. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the bill credit note. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * Amount of the bill credit note that is still outstanding. + */ + public Builder remainingCredit(double remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = Optional.ofNullable(remainingCredit); + return this; + } + + /** + * Amount of the bill credit note that is still outstanding. + */ + public Builder remainingCredit(Optional remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = remainingCredit; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the bill credit note + */ + public Builder status(BillCreditNoteStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the bill credit note, including discounts but excluding tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public Builder supplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + /** + * Reference to the supplier the record relates to. + */ + public Builder supplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total value of any discounts applied. + */ + public Builder totalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Amount of tax included in the bill credit note. + */ + public Builder totalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder withholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public Builder withholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + public AccountingBillCreditNote build() { + return new AccountingBillCreditNote( + allocatedOnDate, + billCreditNoteNumber, + currency, + currencyRate, + discountPercentage, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + remainingCredit, + sourceModifiedDate, + status, + subTotal, + supplementalData, + supplierRef, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNotes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNotes.java new file mode 100644 index 00000000..8812add4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillCreditNotes.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingBillCreditNotes { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingBillCreditNotes( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingBillCreditNotes withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingBillCreditNotes withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingBillCreditNotes withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingBillCreditNotes withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingBillCreditNotes withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingBillCreditNotes withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBillCreditNotes other = (AccountingBillCreditNotes) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingBillCreditNotes.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingBillCreditNotes build() { + return new AccountingBillCreditNotes( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayment.java new file mode 100644 index 00000000..5940dae8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayment.java @@ -0,0 +1,1155 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingBillPayment - > **Bill payments or payments?** + * > + * > We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. + * > + * > See [payments](https://docs.codat.io/lending-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + * + * > View the coverage for bill payments in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/lending-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/lending-api#/schemas/BillCreditNote)). + * + * A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + * + * - A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. + * - An allocation of a supplier's credit note to a bill or perhaps a refund. + * - A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + * + * Depending on the bill payments which are allowed by the underlying accounting package, some of these types may be combined. Please see the example data section for samples of what these cases look like. + * + * In Codat, a bill payment contains details of: + * + * - When the bill payment was recorded in the accounting system. + * - How much it is for and in the currency. + * - Who the payment has been paid to, the _supplier_. + * - The types of bill payments, the _line items_. + * + * Some accounting platforms give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/lending-api#/schemas/DirectCost) data model. + * + * Bill payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * + * --- + * + * ## Bill payment types + * + * ### Payment of a bill + * + * A payment paying a single bill should have the following properties: + * + * - A `totalAmount` indicating the amount of the bill that was paid. This is always positive. + * - A `lines` array containing one element with the following properties: + * - An `amount` equal to the `totalAmount` above. + * - A `links` array containing one element with the following properties: + * - A `type` indicating the type of link, in this case a `Bill`. + * - An `id` containing the ID of the bill that was paid. + * - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + * + * ### Payment of multiple bills + * + * It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + * + * 1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. + * 2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + * + * Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + * + * > Pushing batch payments to Xero + * > + * > When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + * + * ### Payments and refunds on account + * + * A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + * + * The line has the following properties: + * + * - A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. + * - A **links** array containing one element with the following properties: + * - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + * - The **id** containing the ID of the supplier. + * - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + * + * It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + * + * ### Using a credit note to pay a bill + * + * The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + * + * - An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. + * - A **links** array containing two elements: + * - The first link has: + * - A **type** indicating the type of link, in this case a `Bill`. + * - An **id** containing the ID of the bill that was paid. + * - The second link has: + * - A **type** indicating the type of link, in this case a `CreditNote`. + * - An **id** containing the ID of the credit note used by this payment. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment. + * + * ### Refunding a credit note + * + * A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + * + * - An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. + * - A **links** array containing one element with the following properties: + * - A **type** indicating the type of `link`, in this case a `CreditNote`. + * - An **id** containing the ID of the credit note that was refunded. + * + * The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + * + * ### Refunding a payment + * + * If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + * + * - One for the incoming overpayment. + * - Another for the outgoing refund. + * + * The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + * + * - An **amount** indicating the amount that was refunded. This is always negative. + * - A **links** array containing one element with the following properties: + * - A **type** indicating the type of a the link, in this case a `BillPayment`. + * - An **id** containing the ID of the payment that was refunded. + * + * The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + * + * The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + * + * - One for £1,000 linked to the bill that was paid + * - Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + * + * The line linked to the bill payment has the following properties: + * + * - An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. + * - A **links** array containing one element with the following properties: + * - A **type** indicating the type of the link, in this case a `Refund`. + * - An **id** containing the ID of the payment that refunded this line. + * + * > Linked payments + * > + * > Not all accounting packages support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + * + * ## Foreign currencies + * + * There are two types of currency rate that are detailed in the bill payments data type: + * + * Payment currency rate: + * + * - Base currency of the accounts payable account. + * - Foreign currency of the bill payment. + * + * Payment line link currency rate: + * + * - Base currency of the item that the link represents. + * - Foreign currency of the payment. + * + * These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + * + * - The base currency for the accounts payable account. + * - The currency of the item. + * + */ + +public class AccountingBillPayment { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonProperty("date") + private String date; + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * An array of bill payment lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lines") + private JsonNullable> lines; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Additional information associated with the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentMethodRef") + private Optional paymentMethodRef; + + /** + * Additional information associated with the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierRef") + private Optional supplierRef; + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public AccountingBillPayment( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("date") String date, + @JsonProperty("id") Optional id, + @JsonProperty("lines") JsonNullable> lines, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentMethodRef") Optional paymentMethodRef, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("supplierRef") Optional supplierRef, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lines, "lines"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(supplierRef, "supplierRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.accountRef = accountRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.date = date; + this.id = id; + this.lines = lines; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentMethodRef = paymentMethodRef; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.supplierRef = supplierRef; + this.totalAmount = totalAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public String date() { + return date; + } + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * An array of bill payment lines. + */ + public JsonNullable> lines() { + return lines; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Additional information associated with the payment. + */ + public JsonNullable note() { + return note; + } + + public Optional paymentMethodRef() { + return paymentMethodRef; + } + + /** + * Additional information associated with the payment. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + public Optional supplierRef() { + return supplierRef; + } + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingBillPayment withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingBillPayment withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + public AccountingBillPayment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + public AccountingBillPayment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBillPayment withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingBillPayment withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingBillPayment withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + public AccountingBillPayment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + public AccountingBillPayment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of bill payment lines. + */ + public AccountingBillPayment withLines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of bill payment lines. + */ + public AccountingBillPayment withLines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public AccountingBillPayment withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingBillPayment withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingBillPayment withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingBillPayment withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Additional information associated with the payment. + */ + public AccountingBillPayment withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Additional information associated with the payment. + */ + public AccountingBillPayment withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public AccountingBillPayment withPaymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + public AccountingBillPayment withPaymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Additional information associated with the payment. + */ + public AccountingBillPayment withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Additional information associated with the payment. + */ + public AccountingBillPayment withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingBillPayment withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingBillPayment withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBillPayment withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingBillPayment withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public AccountingBillPayment withSupplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + public AccountingBillPayment withSupplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + public AccountingBillPayment withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + public AccountingBillPayment withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBillPayment other = (AccountingBillPayment) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lines, other.lines) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentMethodRef, other.paymentMethodRef) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.supplierRef, other.supplierRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + currency, + currencyRate, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + supplierRef, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingBillPayment.class, + "accountRef", accountRef, + "currency", currency, + "currencyRate", currencyRate, + "date", date, + "id", id, + "lines", lines, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentMethodRef", paymentMethodRef, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "supplierRef", supplierRef, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private String date; + + private Optional id = Optional.empty(); + + private JsonNullable> lines = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional paymentMethodRef = Optional.empty(); + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional supplierRef = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder date(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the bill payment, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of bill payment lines. + */ + public Builder lines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of bill payment lines. + */ + public Builder lines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Additional information associated with the payment. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Additional information associated with the payment. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public Builder paymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + public Builder paymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Additional information associated with the payment. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Additional information associated with the payment. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public Builder supplierRef(SupplierRef supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = Optional.ofNullable(supplierRef); + return this; + } + + public Builder supplierRef(Optional supplierRef) { + Utils.checkNotNull(supplierRef, "supplierRef"); + this.supplierRef = supplierRef; + return this; + } + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingBillPayment build() { + return new AccountingBillPayment( + accountRef, + currency, + currencyRate, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + supplierRef, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayments.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayments.java new file mode 100644 index 00000000..baf18033 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBillPayments.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingBillPayments { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingBillPayments( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingBillPayments withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingBillPayments withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingBillPayments withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingBillPayments withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingBillPayments withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingBillPayments withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBillPayments other = (AccountingBillPayments) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingBillPayments.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingBillPayments build() { + return new AccountingBillPayments( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBills.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBills.java new file mode 100644 index 00000000..04c47583 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingBills.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingBills { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingBills( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingBills withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingBills withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingBills withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingBills withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingBills withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingBills withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingBills other = (AccountingBills) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingBills.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingBills build() { + return new AccountingBills( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCashFlowStatement.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCashFlowStatement.java new file mode 100644 index 00000000..ed01cfb2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCashFlowStatement.java @@ -0,0 +1,590 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingCashFlowStatement - > View the coverage for cash flow statement in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=cashFlowStatement" target="_blank">Data coverage explorer</a>. + * + * > **Operating activities only** + * > + * > Currently, the cash flow statement shows cash that flows into and out of the company from operating activities *only*. Operating activities generate cash from the sale of goods or services. + * + * ## Overview + * + * A cash flow statement is a financial report that records all cash that is received or spent by a company during a given period. It gives you a clearer picture of the company’s performance, and their ability to pay creditors and finance growth. + * + * > **Cash flow statement or balance sheet?** + * > + * > Look at the cash flow statement to understand a company's ability to pay its bills. Although the balance sheet may show healthy earnings at a specific point in time, the cash flow statement allows you to see whether the company is meeting its financial commitments, such as paying creditors or its employees. + */ + +public class AccountingCashFlowStatement { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("earliestAvailableMonth") + private Optional earliestAvailableMonth; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("mostRecentAvailableMonth") + private Optional mostRecentAvailableMonth; + + /** + * Accounting method used when aggregating the report data. In this case, `Cash`. + */ + @JsonProperty("reportBasis") + private ReportBasis reportBasis; + + /** + * Accounting method used to prepare the cash flow statement. + */ + @JsonProperty("reportInput") + private ReportInput reportInput; + + /** + * Array of cash flow statements. + */ + @JsonProperty("reports") + private java.util.List reports; + + public AccountingCashFlowStatement( + @JsonProperty("currency") String currency, + @JsonProperty("earliestAvailableMonth") Optional earliestAvailableMonth, + @JsonProperty("mostRecentAvailableMonth") Optional mostRecentAvailableMonth, + @JsonProperty("reportBasis") ReportBasis reportBasis, + @JsonProperty("reportInput") ReportInput reportInput, + @JsonProperty("reports") java.util.List reports) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + Utils.checkNotNull(reportBasis, "reportBasis"); + Utils.checkNotNull(reportInput, "reportInput"); + Utils.checkNotNull(reports, "reports"); + this.currency = currency; + this.earliestAvailableMonth = earliestAvailableMonth; + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + this.reportBasis = reportBasis; + this.reportInput = reportInput; + this.reports = reports; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * 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 Optional earliestAvailableMonth() { + return earliestAvailableMonth; + } + + /** + * 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 Optional mostRecentAvailableMonth() { + return mostRecentAvailableMonth; + } + + /** + * Accounting method used when aggregating the report data. In this case, `Cash`. + */ + public ReportBasis reportBasis() { + return reportBasis; + } + + /** + * Accounting method used to prepare the cash flow statement. + */ + public ReportInput reportInput() { + return reportInput; + } + + /** + * Array of cash flow statements. + */ + public java.util.List reports() { + return reports; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCashFlowStatement withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 AccountingCashFlowStatement withEarliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 AccountingCashFlowStatement withEarliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 AccountingCashFlowStatement withMostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 AccountingCashFlowStatement withMostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * Accounting method used when aggregating the report data. In this case, `Cash`. + */ + public AccountingCashFlowStatement withReportBasis(ReportBasis reportBasis) { + Utils.checkNotNull(reportBasis, "reportBasis"); + this.reportBasis = reportBasis; + return this; + } + + /** + * Accounting method used to prepare the cash flow statement. + */ + public AccountingCashFlowStatement withReportInput(ReportInput reportInput) { + Utils.checkNotNull(reportInput, "reportInput"); + this.reportInput = reportInput; + return this; + } + + /** + * Array of cash flow statements. + */ + public AccountingCashFlowStatement withReports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCashFlowStatement other = (AccountingCashFlowStatement) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.earliestAvailableMonth, other.earliestAvailableMonth) && + java.util.Objects.deepEquals(this.mostRecentAvailableMonth, other.mostRecentAvailableMonth) && + java.util.Objects.deepEquals(this.reportBasis, other.reportBasis) && + java.util.Objects.deepEquals(this.reportInput, other.reportInput) && + java.util.Objects.deepEquals(this.reports, other.reports); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reportBasis, + reportInput, + reports); + } + + @Override + public String toString() { + return Utils.toString(AccountingCashFlowStatement.class, + "currency", currency, + "earliestAvailableMonth", earliestAvailableMonth, + "mostRecentAvailableMonth", mostRecentAvailableMonth, + "reportBasis", reportBasis, + "reportInput", reportInput, + "reports", reports); + } + + public final static class Builder { + + private String currency; + + private Optional earliestAvailableMonth = Optional.empty(); + + private Optional mostRecentAvailableMonth = Optional.empty(); + + private ReportBasis reportBasis; + + private ReportInput reportInput; + + private java.util.List reports; + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 earliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 earliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 mostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 mostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * Accounting method used when aggregating the report data. In this case, `Cash`. + */ + public Builder reportBasis(ReportBasis reportBasis) { + Utils.checkNotNull(reportBasis, "reportBasis"); + this.reportBasis = reportBasis; + return this; + } + + /** + * Accounting method used to prepare the cash flow statement. + */ + public Builder reportInput(ReportInput reportInput) { + Utils.checkNotNull(reportInput, "reportInput"); + this.reportInput = reportInput; + return this; + } + + /** + * Array of cash flow statements. + */ + public Builder reports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + public AccountingCashFlowStatement build() { + return new AccountingCashFlowStatement( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reportBasis, + reportInput, + reports); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCompanyInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCompanyInfo.java new file mode 100644 index 00000000..042ff949 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCompanyInfo.java @@ -0,0 +1,1241 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCompanyInfo - > View the coverage for company profile in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=cashFlowStatement" target="_blank">Data coverage explorer</a>. + * + * Company info provides standard details about a linked company such as their address, phone number, and company registration. + * + * > **Company information or companies?** + * > + * > Company profile is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + */ + +public class AccountingCompanyInfo { + + /** + * Identifier or reference for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountingPlatformRef") + private JsonNullable accountingPlatformRef; + + /** + * An array of Addresses. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private JsonNullable> addresses; + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("baseCurrency") + private JsonNullable baseCurrency; + + /** + * Registered legal name of the linked company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyLegalName") + private JsonNullable companyLegalName; + + /** + * Name of the linked company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private JsonNullable companyName; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("financialYearStartDate") + private Optional financialYearStartDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ledgerLockDate") + private Optional ledgerLockDate; + + /** + * An array of phone numbers. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phoneNumbers") + private JsonNullable> phoneNumbers; + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("registrationNumber") + private JsonNullable registrationNumber; + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceUrls") + private JsonNullable> sourceUrls; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Company tax number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxNumber") + private JsonNullable taxNumber; + + /** + * An array of weblinks. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("webLinks") + private JsonNullable> webLinks; + + public AccountingCompanyInfo( + @JsonProperty("accountingPlatformRef") JsonNullable accountingPlatformRef, + @JsonProperty("addresses") JsonNullable> addresses, + @JsonProperty("baseCurrency") JsonNullable baseCurrency, + @JsonProperty("companyLegalName") JsonNullable companyLegalName, + @JsonProperty("companyName") JsonNullable companyName, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("financialYearStartDate") Optional financialYearStartDate, + @JsonProperty("ledgerLockDate") Optional ledgerLockDate, + @JsonProperty("phoneNumbers") JsonNullable> phoneNumbers, + @JsonProperty("registrationNumber") JsonNullable registrationNumber, + @JsonProperty("sourceUrls") JsonNullable> sourceUrls, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxNumber") JsonNullable taxNumber, + @JsonProperty("webLinks") JsonNullable> webLinks) { + Utils.checkNotNull(accountingPlatformRef, "accountingPlatformRef"); + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(baseCurrency, "baseCurrency"); + Utils.checkNotNull(companyLegalName, "companyLegalName"); + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(financialYearStartDate, "financialYearStartDate"); + Utils.checkNotNull(ledgerLockDate, "ledgerLockDate"); + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + Utils.checkNotNull(registrationNumber, "registrationNumber"); + Utils.checkNotNull(sourceUrls, "sourceUrls"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxNumber, "taxNumber"); + Utils.checkNotNull(webLinks, "webLinks"); + this.accountingPlatformRef = accountingPlatformRef; + this.addresses = addresses; + this.baseCurrency = baseCurrency; + this.companyLegalName = companyLegalName; + this.companyName = companyName; + this.createdDate = createdDate; + this.financialYearStartDate = financialYearStartDate; + this.ledgerLockDate = ledgerLockDate; + this.phoneNumbers = phoneNumbers; + this.registrationNumber = registrationNumber; + this.sourceUrls = sourceUrls; + this.supplementalData = supplementalData; + this.taxNumber = taxNumber; + this.webLinks = webLinks; + } + + /** + * Identifier or reference for the company in the accounting platform. + */ + public JsonNullable accountingPlatformRef() { + return accountingPlatformRef; + } + + /** + * An array of Addresses. + */ + public JsonNullable> addresses() { + return addresses; + } + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + public JsonNullable baseCurrency() { + return baseCurrency; + } + + /** + * Registered legal name of the linked company. + */ + public JsonNullable companyLegalName() { + return companyLegalName; + } + + /** + * Name of the linked company. + */ + public JsonNullable companyName() { + return companyName; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * 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 Optional financialYearStartDate() { + return financialYearStartDate; + } + + /** + * 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 Optional ledgerLockDate() { + return ledgerLockDate; + } + + /** + * An array of phone numbers. + */ + public JsonNullable> phoneNumbers() { + return phoneNumbers; + } + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + public JsonNullable registrationNumber() { + return registrationNumber; + } + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + public JsonNullable> sourceUrls() { + return sourceUrls; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Company tax number. + */ + public JsonNullable taxNumber() { + return taxNumber; + } + + /** + * An array of weblinks. + */ + public JsonNullable> webLinks() { + return webLinks; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Identifier or reference for the company in the accounting platform. + */ + public AccountingCompanyInfo withAccountingPlatformRef(String accountingPlatformRef) { + Utils.checkNotNull(accountingPlatformRef, "accountingPlatformRef"); + this.accountingPlatformRef = JsonNullable.of(accountingPlatformRef); + return this; + } + + /** + * Identifier or reference for the company in the accounting platform. + */ + public AccountingCompanyInfo withAccountingPlatformRef(JsonNullable accountingPlatformRef) { + Utils.checkNotNull(accountingPlatformRef, "accountingPlatformRef"); + this.accountingPlatformRef = accountingPlatformRef; + return this; + } + + /** + * An array of Addresses. + */ + public AccountingCompanyInfo withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public AccountingCompanyInfo withAddresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + public AccountingCompanyInfo withBaseCurrency(String baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = JsonNullable.of(baseCurrency); + return this; + } + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + public AccountingCompanyInfo withBaseCurrency(JsonNullable baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = baseCurrency; + return this; + } + + /** + * Registered legal name of the linked company. + */ + public AccountingCompanyInfo withCompanyLegalName(String companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = JsonNullable.of(companyLegalName); + return this; + } + + /** + * Registered legal name of the linked company. + */ + public AccountingCompanyInfo withCompanyLegalName(JsonNullable companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = companyLegalName; + return this; + } + + /** + * Name of the linked company. + */ + public AccountingCompanyInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = JsonNullable.of(companyName); + return this; + } + + /** + * Name of the linked company. + */ + public AccountingCompanyInfo withCompanyName(JsonNullable companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 AccountingCompanyInfo withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 AccountingCompanyInfo withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + 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 AccountingCompanyInfo withFinancialYearStartDate(String financialYearStartDate) { + Utils.checkNotNull(financialYearStartDate, "financialYearStartDate"); + this.financialYearStartDate = Optional.ofNullable(financialYearStartDate); + 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 AccountingCompanyInfo withFinancialYearStartDate(Optional financialYearStartDate) { + Utils.checkNotNull(financialYearStartDate, "financialYearStartDate"); + this.financialYearStartDate = financialYearStartDate; + 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 AccountingCompanyInfo withLedgerLockDate(String ledgerLockDate) { + Utils.checkNotNull(ledgerLockDate, "ledgerLockDate"); + this.ledgerLockDate = Optional.ofNullable(ledgerLockDate); + 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 AccountingCompanyInfo withLedgerLockDate(Optional ledgerLockDate) { + Utils.checkNotNull(ledgerLockDate, "ledgerLockDate"); + this.ledgerLockDate = ledgerLockDate; + return this; + } + + /** + * An array of phone numbers. + */ + public AccountingCompanyInfo withPhoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = JsonNullable.of(phoneNumbers); + return this; + } + + /** + * An array of phone numbers. + */ + public AccountingCompanyInfo withPhoneNumbers(JsonNullable> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + public AccountingCompanyInfo withRegistrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + public AccountingCompanyInfo withRegistrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + public AccountingCompanyInfo withSourceUrls(java.util.Map sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = JsonNullable.of(sourceUrls); + return this; + } + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + public AccountingCompanyInfo withSourceUrls(JsonNullable> sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = sourceUrls; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCompanyInfo withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCompanyInfo withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Company tax number. + */ + public AccountingCompanyInfo withTaxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Company tax number. + */ + public AccountingCompanyInfo withTaxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + /** + * An array of weblinks. + */ + public AccountingCompanyInfo withWebLinks(java.util.List webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = JsonNullable.of(webLinks); + return this; + } + + /** + * An array of weblinks. + */ + public AccountingCompanyInfo withWebLinks(JsonNullable> webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = webLinks; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCompanyInfo other = (AccountingCompanyInfo) o; + return + java.util.Objects.deepEquals(this.accountingPlatformRef, other.accountingPlatformRef) && + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.baseCurrency, other.baseCurrency) && + java.util.Objects.deepEquals(this.companyLegalName, other.companyLegalName) && + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.financialYearStartDate, other.financialYearStartDate) && + java.util.Objects.deepEquals(this.ledgerLockDate, other.ledgerLockDate) && + java.util.Objects.deepEquals(this.phoneNumbers, other.phoneNumbers) && + java.util.Objects.deepEquals(this.registrationNumber, other.registrationNumber) && + java.util.Objects.deepEquals(this.sourceUrls, other.sourceUrls) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxNumber, other.taxNumber) && + java.util.Objects.deepEquals(this.webLinks, other.webLinks); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountingPlatformRef, + addresses, + baseCurrency, + companyLegalName, + companyName, + createdDate, + financialYearStartDate, + ledgerLockDate, + phoneNumbers, + registrationNumber, + sourceUrls, + supplementalData, + taxNumber, + webLinks); + } + + @Override + public String toString() { + return Utils.toString(AccountingCompanyInfo.class, + "accountingPlatformRef", accountingPlatformRef, + "addresses", addresses, + "baseCurrency", baseCurrency, + "companyLegalName", companyLegalName, + "companyName", companyName, + "createdDate", createdDate, + "financialYearStartDate", financialYearStartDate, + "ledgerLockDate", ledgerLockDate, + "phoneNumbers", phoneNumbers, + "registrationNumber", registrationNumber, + "sourceUrls", sourceUrls, + "supplementalData", supplementalData, + "taxNumber", taxNumber, + "webLinks", webLinks); + } + + public final static class Builder { + + private JsonNullable accountingPlatformRef = JsonNullable.undefined(); + + private JsonNullable> addresses = JsonNullable.undefined(); + + private JsonNullable baseCurrency = JsonNullable.undefined(); + + private JsonNullable companyLegalName = JsonNullable.undefined(); + + private JsonNullable companyName = JsonNullable.undefined(); + + private Optional createdDate = Optional.empty(); + + private Optional financialYearStartDate = Optional.empty(); + + private Optional ledgerLockDate = Optional.empty(); + + private JsonNullable> phoneNumbers = JsonNullable.undefined(); + + private JsonNullable registrationNumber = JsonNullable.undefined(); + + private JsonNullable> sourceUrls = JsonNullable.undefined(); + + private Optional supplementalData = Optional.empty(); + + private JsonNullable taxNumber = JsonNullable.undefined(); + + private JsonNullable> webLinks = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Identifier or reference for the company in the accounting platform. + */ + public Builder accountingPlatformRef(String accountingPlatformRef) { + Utils.checkNotNull(accountingPlatformRef, "accountingPlatformRef"); + this.accountingPlatformRef = JsonNullable.of(accountingPlatformRef); + return this; + } + + /** + * Identifier or reference for the company in the accounting platform. + */ + public Builder accountingPlatformRef(JsonNullable accountingPlatformRef) { + Utils.checkNotNull(accountingPlatformRef, "accountingPlatformRef"); + this.accountingPlatformRef = accountingPlatformRef; + return this; + } + + /** + * An array of Addresses. + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public Builder addresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + public Builder baseCurrency(String baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = JsonNullable.of(baseCurrency); + return this; + } + + /** + * Currency set in the accounting platform of the linked company. Used by the currency rate. + */ + public Builder baseCurrency(JsonNullable baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = baseCurrency; + return this; + } + + /** + * Registered legal name of the linked company. + */ + public Builder companyLegalName(String companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = JsonNullable.of(companyLegalName); + return this; + } + + /** + * Registered legal name of the linked company. + */ + public Builder companyLegalName(JsonNullable companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = companyLegalName; + return this; + } + + /** + * Name of the linked company. + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = JsonNullable.of(companyName); + return this; + } + + /** + * Name of the linked company. + */ + public Builder companyName(JsonNullable companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + 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 financialYearStartDate(String financialYearStartDate) { + Utils.checkNotNull(financialYearStartDate, "financialYearStartDate"); + this.financialYearStartDate = Optional.ofNullable(financialYearStartDate); + 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 financialYearStartDate(Optional financialYearStartDate) { + Utils.checkNotNull(financialYearStartDate, "financialYearStartDate"); + this.financialYearStartDate = financialYearStartDate; + 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 ledgerLockDate(String ledgerLockDate) { + Utils.checkNotNull(ledgerLockDate, "ledgerLockDate"); + this.ledgerLockDate = Optional.ofNullable(ledgerLockDate); + 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 ledgerLockDate(Optional ledgerLockDate) { + Utils.checkNotNull(ledgerLockDate, "ledgerLockDate"); + this.ledgerLockDate = ledgerLockDate; + return this; + } + + /** + * An array of phone numbers. + */ + public Builder phoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = JsonNullable.of(phoneNumbers); + return this; + } + + /** + * An array of phone numbers. + */ + public Builder phoneNumbers(JsonNullable> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + public Builder registrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + */ + public Builder registrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + public Builder sourceUrls(java.util.Map sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = JsonNullable.of(sourceUrls); + return this; + } + + /** + * URL addresses for the accounting source. + * + * For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + */ + public Builder sourceUrls(JsonNullable> sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = sourceUrls; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Company tax number. + */ + public Builder taxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Company tax number. + */ + public Builder taxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + /** + * An array of weblinks. + */ + public Builder webLinks(java.util.List webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = JsonNullable.of(webLinks); + return this; + } + + /** + * An array of weblinks. + */ + public Builder webLinks(JsonNullable> webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = webLinks; + return this; + } + + public AccountingCompanyInfo build() { + return new AccountingCompanyInfo( + accountingPlatformRef, + addresses, + baseCurrency, + companyLegalName, + companyName, + createdDate, + financialYearStartDate, + ledgerLockDate, + phoneNumbers, + registrationNumber, + sourceUrls, + supplementalData, + taxNumber, + webLinks); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponse.java new file mode 100644 index 00000000..c85211d9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateAccountResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateAccountResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateAccountResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateAccountResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateAccountResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateAccountResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateAccountResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateAccountResponse withData(AccountingCreateAccountResponseAccountingAccount data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreateAccountResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateAccountResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateAccountResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateAccountResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateAccountResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateAccountResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateAccountResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateAccountResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateAccountResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateAccountResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateAccountResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateAccountResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateAccountResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateAccountResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateAccountResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateAccountResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateAccountResponse other = (AccountingCreateAccountResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateAccountResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateAccountResponseAccountingAccount data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateAccountResponse build() { + return new AccountingCreateAccountResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseAccountingAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseAccountingAccount.java new file mode 100644 index 00000000..8bd6e1c6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseAccountingAccount.java @@ -0,0 +1,1057 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateAccountResponseAccountingAccount - > **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + * + * View the coverage for accounts in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + * + * The categories for an account include: + * * Asset + * * Expense + * * Income + * * Liability + * * Equity. + * + * The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + * + * At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + * + * To determine the list of allowed categories for a specific integration, you can: + * - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/lending-api#/operations/get-create-chartOfAccounts-model). + * - Refer to the integration's own documentation. + * + * > **Accounts with no category** + * > + * > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + * > + * > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateAccountResponseAccountingAccount { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Current balance in the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currentBalance") + private JsonNullable currentBalance; + + /** + * Description for the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedCategory") + private JsonNullable fullyQualifiedCategory; + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fullyQualifiedName") + private JsonNullable fullyQualifiedName; + + /** + * Identifier for the account, unique for the company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Confirms whether the account is a bank account or not. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isBankAccount") + private Optional isBankAccount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nominalCode") + private JsonNullable nominalCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Type of account + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validDatatypeLinks") + private JsonNullable> validDatatypeLinks; + + public AccountingCreateAccountResponseAccountingAccount( + @JsonProperty("currency") Optional currency, + @JsonProperty("currentBalance") JsonNullable currentBalance, + @JsonProperty("description") JsonNullable description, + @JsonProperty("fullyQualifiedCategory") JsonNullable fullyQualifiedCategory, + @JsonProperty("fullyQualifiedName") JsonNullable fullyQualifiedName, + @JsonProperty("id") Optional id, + @JsonProperty("isBankAccount") Optional isBankAccount, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") JsonNullable name, + @JsonProperty("nominalCode") JsonNullable nominalCode, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("type") Optional type, + @JsonProperty("validDatatypeLinks") JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currentBalance, "currentBalance"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(isBankAccount, "isBankAccount"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(nominalCode, "nominalCode"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.currency = currency; + this.currentBalance = currentBalance; + this.description = description; + this.fullyQualifiedCategory = fullyQualifiedCategory; + this.fullyQualifiedName = fullyQualifiedName; + this.id = id; + this.isBankAccount = isBankAccount; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.name = name; + this.nominalCode = nominalCode; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + this.type = type; + this.validDatatypeLinks = validDatatypeLinks; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Current balance in the account. + */ + public JsonNullable currentBalance() { + return currentBalance; + } + + /** + * Description for the account. + */ + public JsonNullable description() { + return description; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public JsonNullable fullyQualifiedCategory() { + return fullyQualifiedCategory; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public JsonNullable fullyQualifiedName() { + return fullyQualifiedName; + } + + /** + * Identifier for the account, unique for the company. + */ + public Optional id() { + return id; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Optional isBankAccount() { + return isBankAccount; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of the account. + */ + public JsonNullable name() { + return name; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public JsonNullable nominalCode() { + return nominalCode; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the account + */ + public Optional status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Type of account + */ + public Optional type() { + return type; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public JsonNullable> validDatatypeLinks() { + return validDatatypeLinks; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreateAccountResponseAccountingAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreateAccountResponseAccountingAccount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public AccountingCreateAccountResponseAccountingAccount withCurrentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public AccountingCreateAccountResponseAccountingAccount withCurrentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public AccountingCreateAccountResponseAccountingAccount withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public AccountingCreateAccountResponseAccountingAccount withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountingCreateAccountResponseAccountingAccount withFullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public AccountingCreateAccountResponseAccountingAccount withFullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountingCreateAccountResponseAccountingAccount withFullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public AccountingCreateAccountResponseAccountingAccount withFullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public AccountingCreateAccountResponseAccountingAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public AccountingCreateAccountResponseAccountingAccount withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountingCreateAccountResponseAccountingAccount withIsBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public AccountingCreateAccountResponseAccountingAccount withIsBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the account. + */ + public AccountingCreateAccountResponseAccountingAccount withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public AccountingCreateAccountResponseAccountingAccount withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountingCreateAccountResponseAccountingAccount withNominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public AccountingCreateAccountResponseAccountingAccount withNominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreateAccountResponseAccountingAccount withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the account + */ + public AccountingCreateAccountResponseAccountingAccount withStatus(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public AccountingCreateAccountResponseAccountingAccount withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateAccountResponseAccountingAccount withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateAccountResponseAccountingAccount withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public AccountingCreateAccountResponseAccountingAccount withType(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public AccountingCreateAccountResponseAccountingAccount withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountingCreateAccountResponseAccountingAccount withValidDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public AccountingCreateAccountResponseAccountingAccount withValidDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateAccountResponseAccountingAccount other = (AccountingCreateAccountResponseAccountingAccount) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currentBalance, other.currentBalance) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.fullyQualifiedCategory, other.fullyQualifiedCategory) && + java.util.Objects.deepEquals(this.fullyQualifiedName, other.fullyQualifiedName) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.isBankAccount, other.isBankAccount) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.nominalCode, other.nominalCode) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.validDatatypeLinks, other.validDatatypeLinks); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + id, + isBankAccount, + metadata, + modifiedDate, + name, + nominalCode, + sourceModifiedDate, + status, + supplementalData, + type, + validDatatypeLinks); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateAccountResponseAccountingAccount.class, + "currency", currency, + "currentBalance", currentBalance, + "description", description, + "fullyQualifiedCategory", fullyQualifiedCategory, + "fullyQualifiedName", fullyQualifiedName, + "id", id, + "isBankAccount", isBankAccount, + "metadata", metadata, + "modifiedDate", modifiedDate, + "name", name, + "nominalCode", nominalCode, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData, + "type", type, + "validDatatypeLinks", validDatatypeLinks); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private JsonNullable currentBalance = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedCategory = JsonNullable.undefined(); + + private JsonNullable fullyQualifiedName = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional isBankAccount = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable nominalCode = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional type = Optional.empty(); + + private JsonNullable> validDatatypeLinks = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = JsonNullable.of(currentBalance); + return this; + } + + /** + * Current balance in the account. + */ + public Builder currentBalance(JsonNullable currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Description for the account. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description for the account. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(String fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = JsonNullable.of(fullyQualifiedCategory); + return this; + } + + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + */ + public Builder fullyQualifiedCategory(JsonNullable fullyQualifiedCategory) { + Utils.checkNotNull(fullyQualifiedCategory, "fullyQualifiedCategory"); + this.fullyQualifiedCategory = fullyQualifiedCategory; + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(String fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); + return this; + } + + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + */ + public Builder fullyQualifiedName(JsonNullable fullyQualifiedName) { + Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + this.fullyQualifiedName = fullyQualifiedName; + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(boolean isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = Optional.ofNullable(isBankAccount); + return this; + } + + /** + * Confirms whether the account is a bank account or not. + */ + public Builder isBankAccount(Optional isBankAccount) { + Utils.checkNotNull(isBankAccount, "isBankAccount"); + this.isBankAccount = isBankAccount; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the account. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the account. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + */ + public Builder nominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the account + */ + public Builder status(AccountStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the account + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Type of account + */ + public Builder type(AccountType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of account + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(java.util.List validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = JsonNullable.of(validDatatypeLinks); + return this; + } + + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/lending-api#/schemas/ValidDataTypeLinks). + */ + public Builder validDatatypeLinks(JsonNullable> validDatatypeLinks) { + Utils.checkNotNull(validDatatypeLinks, "validDatatypeLinks"); + this.validDatatypeLinks = validDatatypeLinks; + return this; + } + + public AccountingCreateAccountResponseAccountingAccount build() { + return new AccountingCreateAccountResponseAccountingAccount( + currency, + currentBalance, + description, + fullyQualifiedCategory, + fullyQualifiedName, + id, + isBankAccount, + metadata, + modifiedDate, + name, + nominalCode, + sourceModifiedDate, + status, + supplementalData, + type, + validDatatypeLinks); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.java new file mode 100644 index 00000000..5781bfd7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateAccountResponseValidDataTypeLinks.java @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateAccountResponseValidDataTypeLinks - When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + * + * For example, `validDatatypeLinks` might indicate the following references: + * + * - Which tax rates are valid to use on the line item of a bill. + * - Which items can be used when creating an invoice. + * + * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + * + * ## `validDatatypeLinks` example + * + * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + * + * ```json validDatatypeLinks for an account + * { + * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + * "nominalCode": "090", + * "name": "Business Bank Account", + * #... + * "validDatatypeLinks": [ + * { + * "property": "Id", + * "links": [ + * "Payment.AccountRef.Id", + * "BillPayment.AccountRef.Id", + * "DirectIncome.LineItems.AccountRef.Id", + * "DirectCost.LineItems.AccountRef.Id" + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Support for `validDatatypeLinks` + * + * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + * + * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our <a href="https://portal.productboard.com/codat/5-product-roadmap">Product Roadmap</a>. + */ + +public class AccountingCreateAccountResponseValidDataTypeLinks { + + /** + * Supported `dataTypes` that the record can be linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private JsonNullable> links; + + /** + * The property from the account that can be linked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("property") + private JsonNullable property; + + public AccountingCreateAccountResponseValidDataTypeLinks( + @JsonProperty("links") JsonNullable> links, + @JsonProperty("property") JsonNullable property) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(property, "property"); + this.links = links; + this.property = property; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public JsonNullable> links() { + return links; + } + + /** + * The property from the account that can be linked. + */ + public JsonNullable property() { + return property; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public AccountingCreateAccountResponseValidDataTypeLinks withLinks(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public AccountingCreateAccountResponseValidDataTypeLinks withLinks(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public AccountingCreateAccountResponseValidDataTypeLinks withProperty(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public AccountingCreateAccountResponseValidDataTypeLinks withProperty(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateAccountResponseValidDataTypeLinks other = (AccountingCreateAccountResponseValidDataTypeLinks) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + property); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateAccountResponseValidDataTypeLinks.class, + "links", links, + "property", property); + } + + public final static class Builder { + + private JsonNullable> links = JsonNullable.undefined(); + + private JsonNullable property = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + public AccountingCreateAccountResponseValidDataTypeLinks build() { + return new AccountingCreateAccountResponseValidDataTypeLinks( + links, + property); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponse.java new file mode 100644 index 00000000..f68ef773 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateBankAccountResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateBankAccountResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateBankAccountResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateBankAccountResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateBankAccountResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateBankAccountResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateBankAccountResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateBankAccountResponse withData(AccountingCreateBankAccountResponseAccountingBankAccount data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreateBankAccountResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateBankAccountResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateBankAccountResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateBankAccountResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateBankAccountResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateBankAccountResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateBankAccountResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateBankAccountResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateBankAccountResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateBankAccountResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateBankAccountResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateBankAccountResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateBankAccountResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateBankAccountResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateBankAccountResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateBankAccountResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateBankAccountResponse other = (AccountingCreateBankAccountResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateBankAccountResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateBankAccountResponseAccountingBankAccount data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateBankAccountResponse build() { + return new AccountingCreateBankAccountResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.java new file mode 100644 index 00000000..1967f88a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountResponseAccountingBankAccount.java @@ -0,0 +1,1093 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateBankAccountResponseAccountingBankAccount - > **Accessing Bank Accounts through Banking API** + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > + * > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/lending-api#/schemas/Account) + * + * > View the coverage for bank accounts in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * A list of bank accounts associated with a company and a specific data connection. + * + * Bank accounts data includes: + * * The name and ID of the account in the accounting platform. + * * The currency and balance of the account. + * * The sort code and account number. + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateBankAccountResponseAccountingBankAccount { + + /** + * Name of the bank account in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountName") + private JsonNullable accountName; + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountNumber") + private JsonNullable accountNumber; + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountType") + private Optional accountType; + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("availableBalance") + private JsonNullable availableBalance; + + /** + * Balance of the bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private JsonNullable balance; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("iBan") + private JsonNullable iBan; + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The institution of the bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("institution") + private JsonNullable institution; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Code used to identify each nominal account for a business. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("nominalCode") + private JsonNullable nominalCode; + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("overdraftLimit") + private JsonNullable overdraftLimit; + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sortCode") + private JsonNullable sortCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + public AccountingCreateBankAccountResponseAccountingBankAccount( + @JsonProperty("accountName") JsonNullable accountName, + @JsonProperty("accountNumber") JsonNullable accountNumber, + @JsonProperty("accountType") Optional accountType, + @JsonProperty("availableBalance") JsonNullable availableBalance, + @JsonProperty("balance") JsonNullable balance, + @JsonProperty("currency") Optional currency, + @JsonProperty("iBan") JsonNullable iBan, + @JsonProperty("id") Optional id, + @JsonProperty("institution") JsonNullable institution, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("nominalCode") JsonNullable nominalCode, + @JsonProperty("overdraftLimit") JsonNullable overdraftLimit, + @JsonProperty("sortCode") JsonNullable sortCode, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData) { + Utils.checkNotNull(accountName, "accountName"); + Utils.checkNotNull(accountNumber, "accountNumber"); + Utils.checkNotNull(accountType, "accountType"); + Utils.checkNotNull(availableBalance, "availableBalance"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(iBan, "iBan"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(institution, "institution"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(nominalCode, "nominalCode"); + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + Utils.checkNotNull(sortCode, "sortCode"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + this.accountName = accountName; + this.accountNumber = accountNumber; + this.accountType = accountType; + this.availableBalance = availableBalance; + this.balance = balance; + this.currency = currency; + this.iBan = iBan; + this.id = id; + this.institution = institution; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.nominalCode = nominalCode; + this.overdraftLimit = overdraftLimit; + this.sortCode = sortCode; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + } + + /** + * Name of the bank account in the accounting platform. + */ + public JsonNullable accountName() { + return accountName; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public JsonNullable accountNumber() { + return accountNumber; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Optional accountType() { + return accountType; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public JsonNullable availableBalance() { + return availableBalance; + } + + /** + * Balance of the bank account. + */ + public JsonNullable balance() { + return balance; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public JsonNullable iBan() { + return iBan; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * The institution of the bank account. + */ + public JsonNullable institution() { + return institution; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Code used to identify each nominal account for a business. + */ + public JsonNullable nominalCode() { + return nominalCode; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public JsonNullable overdraftLimit() { + return overdraftLimit; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public JsonNullable sortCode() { + return sortCode; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the bank account in the accounting platform. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = JsonNullable.of(accountName); + return this; + } + + /** + * Name of the bank account in the accounting platform. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountName(JsonNullable accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountNumber(String accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = JsonNullable.of(accountNumber); + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountNumber(JsonNullable accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = accountNumber; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountType(AccountingBankAccountType accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAccountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAvailableBalance(double availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = JsonNullable.of(availableBalance); + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withAvailableBalance(JsonNullable availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = availableBalance; + return this; + } + + /** + * Balance of the bank account. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = JsonNullable.of(balance); + return this; + } + + /** + * Balance of the bank account. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withBalance(JsonNullable balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withIBan(String iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = JsonNullable.of(iBan); + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withIBan(JsonNullable iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = iBan; + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution of the bank account. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withInstitution(String institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = JsonNullable.of(institution); + return this; + } + + /** + * The institution of the bank account. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withInstitution(JsonNullable institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withNominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withNominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withOverdraftLimit(double overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = JsonNullable.of(overdraftLimit); + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withOverdraftLimit(JsonNullable overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = overdraftLimit; + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withSortCode(String sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = JsonNullable.of(sortCode); + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withSortCode(JsonNullable sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = sortCode; + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateBankAccountResponseAccountingBankAccount withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateBankAccountResponseAccountingBankAccount other = (AccountingCreateBankAccountResponseAccountingBankAccount) o; + return + java.util.Objects.deepEquals(this.accountName, other.accountName) && + java.util.Objects.deepEquals(this.accountNumber, other.accountNumber) && + java.util.Objects.deepEquals(this.accountType, other.accountType) && + java.util.Objects.deepEquals(this.availableBalance, other.availableBalance) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.iBan, other.iBan) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.institution, other.institution) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.nominalCode, other.nominalCode) && + java.util.Objects.deepEquals(this.overdraftLimit, other.overdraftLimit) && + java.util.Objects.deepEquals(this.sortCode, other.sortCode) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountName, + accountNumber, + accountType, + availableBalance, + balance, + currency, + iBan, + id, + institution, + metadata, + modifiedDate, + nominalCode, + overdraftLimit, + sortCode, + sourceModifiedDate, + supplementalData); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateBankAccountResponseAccountingBankAccount.class, + "accountName", accountName, + "accountNumber", accountNumber, + "accountType", accountType, + "availableBalance", availableBalance, + "balance", balance, + "currency", currency, + "iBan", iBan, + "id", id, + "institution", institution, + "metadata", metadata, + "modifiedDate", modifiedDate, + "nominalCode", nominalCode, + "overdraftLimit", overdraftLimit, + "sortCode", sortCode, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData); + } + + public final static class Builder { + + private JsonNullable accountName = JsonNullable.undefined(); + + private JsonNullable accountNumber = JsonNullable.undefined(); + + private Optional accountType = Optional.empty(); + + private JsonNullable availableBalance = JsonNullable.undefined(); + + private JsonNullable balance = JsonNullable.undefined(); + + private Optional currency = Optional.empty(); + + private JsonNullable iBan = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private JsonNullable institution = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable nominalCode = JsonNullable.undefined(); + + private JsonNullable overdraftLimit = JsonNullable.undefined(); + + private JsonNullable sortCode = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the bank account in the accounting platform. + */ + public Builder accountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = JsonNullable.of(accountName); + return this; + } + + /** + * Name of the bank account in the accounting platform. + */ + public Builder accountName(JsonNullable accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public Builder accountNumber(String accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = JsonNullable.of(accountNumber); + return this; + } + + /** + * Account number for the bank account. + * + * Xero integrations + * Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + * + * FreeAgent integrations + * For Credit accounts, only the last four digits are required. For other types, the field is optional. + */ + public Builder accountNumber(JsonNullable accountNumber) { + Utils.checkNotNull(accountNumber, "accountNumber"); + this.accountNumber = accountNumber; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Builder accountType(AccountingBankAccountType accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Builder accountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public Builder availableBalance(double availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = JsonNullable.of(availableBalance); + return this; + } + + /** + * Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. + */ + public Builder availableBalance(JsonNullable availableBalance) { + Utils.checkNotNull(availableBalance, "availableBalance"); + this.availableBalance = availableBalance; + return this; + } + + /** + * Balance of the bank account. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = JsonNullable.of(balance); + return this; + } + + /** + * Balance of the bank account. + */ + public Builder balance(JsonNullable balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public Builder iBan(String iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = JsonNullable.of(iBan); + return this; + } + + /** + * International bank account number of the account. Often used when making or receiving international payments. + */ + public Builder iBan(JsonNullable iBan) { + Utils.checkNotNull(iBan, "iBan"); + this.iBan = iBan; + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The institution of the bank account. + */ + public Builder institution(String institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = JsonNullable.of(institution); + return this; + } + + /** + * The institution of the bank account. + */ + public Builder institution(JsonNullable institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public Builder nominalCode(String nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = JsonNullable.of(nominalCode); + return this; + } + + /** + * Code used to identify each nominal account for a business. + */ + public Builder nominalCode(JsonNullable nominalCode) { + Utils.checkNotNull(nominalCode, "nominalCode"); + this.nominalCode = nominalCode; + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public Builder overdraftLimit(double overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = JsonNullable.of(overdraftLimit); + return this; + } + + /** + * Pre-arranged overdraft limit of the account. + * + * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + */ + public Builder overdraftLimit(JsonNullable overdraftLimit) { + Utils.checkNotNull(overdraftLimit, "overdraftLimit"); + this.overdraftLimit = overdraftLimit; + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public Builder sortCode(String sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = JsonNullable.of(sortCode); + return this; + } + + /** + * Sort code for the bank account. + * + * Xero integrations + * The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + */ + public Builder sortCode(JsonNullable sortCode) { + Utils.checkNotNull(sortCode, "sortCode"); + this.sortCode = sortCode; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public AccountingCreateBankAccountResponseAccountingBankAccount build() { + return new AccountingCreateBankAccountResponseAccountingBankAccount( + accountName, + accountNumber, + accountType, + availableBalance, + balance, + currency, + iBan, + id, + institution, + metadata, + modifiedDate, + nominalCode, + overdraftLimit, + sortCode, + sourceModifiedDate, + supplementalData); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountTransactions.java new file mode 100644 index 00000000..45deb7de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankAccountTransactions.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingCreateBankAccountTransactions + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateBankAccountTransactions { + + /** + * Unique identifier for a bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private Optional accountId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactions") + private Optional> transactions; + + public AccountingCreateBankAccountTransactions( + @JsonProperty("accountId") Optional accountId, + @JsonProperty("transactions") Optional> transactions) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(transactions, "transactions"); + this.accountId = accountId; + this.transactions = transactions; + } + + /** + * Unique identifier for a bank account. + */ + public Optional accountId() { + return accountId; + } + + public Optional> transactions() { + return transactions; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bank account. + */ + public AccountingCreateBankAccountTransactions withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier for a bank account. + */ + public AccountingCreateBankAccountTransactions withAccountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + public AccountingCreateBankAccountTransactions withTransactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + public AccountingCreateBankAccountTransactions withTransactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateBankAccountTransactions other = (AccountingCreateBankAccountTransactions) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.transactions, other.transactions); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + transactions); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateBankAccountTransactions.class, + "accountId", accountId, + "transactions", transactions); + } + + public final static class Builder { + + private Optional accountId = Optional.empty(); + + private Optional> transactions = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bank account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier for a bank account. + */ + public Builder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + public Builder transactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + public Builder transactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + public AccountingCreateBankAccountTransactions build() { + return new AccountingCreateBankAccountTransactions( + accountId, + transactions); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactions.java new file mode 100644 index 00000000..b5d13177 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactions.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingCreateBankTransactions { + + /** + * Unique identifier for a bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private Optional accountId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactions") + private Optional> transactions; + + public AccountingCreateBankTransactions( + @JsonProperty("accountId") Optional accountId, + @JsonProperty("transactions") Optional> transactions) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(transactions, "transactions"); + this.accountId = accountId; + this.transactions = transactions; + } + + /** + * Unique identifier for a bank account. + */ + public Optional accountId() { + return accountId; + } + + public Optional> transactions() { + return transactions; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a bank account. + */ + public AccountingCreateBankTransactions withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier for a bank account. + */ + public AccountingCreateBankTransactions withAccountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + public AccountingCreateBankTransactions withTransactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + public AccountingCreateBankTransactions withTransactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateBankTransactions other = (AccountingCreateBankTransactions) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.transactions, other.transactions); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + transactions); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateBankTransactions.class, + "accountId", accountId, + "transactions", transactions); + } + + public final static class Builder { + + private Optional accountId = Optional.empty(); + + private Optional> transactions = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a bank account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier for a bank account. + */ + public Builder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + public Builder transactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + public Builder transactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + public AccountingCreateBankTransactions build() { + return new AccountingCreateBankTransactions( + accountId, + transactions); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactionsResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactionsResponse.java new file mode 100644 index 00000000..950ec0bf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateBankTransactionsResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateBankTransactionsResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private Optional data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateBankTransactionsResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") Optional data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public Optional data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateBankTransactionsResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateBankTransactionsResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateBankTransactionsResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateBankTransactionsResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateBankTransactionsResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateBankTransactionsResponse withData(AccountingCreateBankAccountTransactions data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public AccountingCreateBankTransactionsResponse withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateBankTransactionsResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateBankTransactionsResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateBankTransactionsResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateBankTransactionsResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateBankTransactionsResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateBankTransactionsResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateBankTransactionsResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateBankTransactionsResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateBankTransactionsResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateBankTransactionsResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateBankTransactionsResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateBankTransactionsResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateBankTransactionsResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateBankTransactionsResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateBankTransactionsResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateBankTransactionsResponse other = (AccountingCreateBankTransactionsResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateBankTransactionsResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private Optional data = Optional.empty(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateBankAccountTransactions data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateBankTransactionsResponse build() { + return new AccountingCreateBankTransactionsResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponse.java new file mode 100644 index 00000000..c35729e2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateDirectCostResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateDirectCostResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateDirectCostResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateDirectCostResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateDirectCostResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateDirectCostResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateDirectCostResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateDirectCostResponse withData(AccountingCreateDirectCostResponseAccountingDirectCost data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreateDirectCostResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateDirectCostResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateDirectCostResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateDirectCostResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateDirectCostResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateDirectCostResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateDirectCostResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateDirectCostResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateDirectCostResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateDirectCostResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateDirectCostResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateDirectCostResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateDirectCostResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateDirectCostResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateDirectCostResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateDirectCostResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateDirectCostResponse other = (AccountingCreateDirectCostResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateDirectCostResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateDirectCostResponseAccountingDirectCost data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateDirectCostResponse build() { + return new AccountingCreateDirectCostResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.java new file mode 100644 index 00000000..bec54456 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseAccountingDirectCost.java @@ -0,0 +1,1127 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateDirectCostResponseAccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. + * + * > View the coverage for direct costs in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Direct costs are the expenses associated with a business' operations. For example, purchases of raw materials and service fees are considered direct costs. + * + * Direct costs include: + * * Purchasing an item and paying it off at the point of the purchase + * * Receiving cash from a refunded item if the refund is made by the supplier + * * Withdrawing money from a bank account + * * Writing a cheque + * + * Direct costs is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateDirectCostResponseAccountingDirectCost { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Identifier of the direct cost, unique for the company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("issueDate") + private String issueDate; + + /** + * An array of line items. + */ + @JsonProperty("lineItems") + private java.util.List lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * A note attached to the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonProperty("paymentAllocations") + private java.util.List paymentAllocations; + + /** + * User-friendly reference for the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The total amount of the direct costs, excluding any taxes. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * The total amount of tax on the direct costs. + */ + @JsonProperty("taxAmount") + private double taxAmount; + + /** + * The amount of the direct costs, inclusive of tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + public AccountingCreateDirectCostResponseAccountingDirectCost( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("currency") String currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") java.util.List lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") java.util.List paymentAllocations, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxAmount") double taxAmount, + @JsonProperty("totalAmount") double totalAmount) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.contactRef = contactRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Optional id() { + return id; + } + + /** + * 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 String issueDate() { + return issueDate; + } + + /** + * An array of line items. + */ + public java.util.List lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * A note attached to the direct cost. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public java.util.List paymentAllocations() { + return paymentAllocations; + } + + /** + * User-friendly reference for the direct cost. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * The total amount of tax on the direct costs. + */ + public double taxAmount() { + return taxAmount; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public double totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withContactRef(AccountingCreateDirectCostResponseContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 AccountingCreateDirectCostResponseAccountingDirectCost withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * A note attached to the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public AccountingCreateDirectCostResponseAccountingDirectCost withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateDirectCostResponseAccountingDirectCost other = (AccountingCreateDirectCostResponseAccountingDirectCost) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateDirectCostResponseAccountingDirectCost.class, + "contactRef", contactRef, + "currency", currency, + "currencyRate", currencyRate, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "subTotal", subTotal, + "supplementalData", supplementalData, + "taxAmount", taxAmount, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private String currency; + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private String issueDate; + + private java.util.List lineItems; + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private java.util.List paymentAllocations; + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Double taxAmount; + + private Double totalAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(AccountingCreateDirectCostResponseContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingCreateDirectCostResponseAccountingDirectCost build() { + return new AccountingCreateDirectCostResponseAccountingDirectCost( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseContactReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseContactReference.java new file mode 100644 index 00000000..76b9f157 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseContactReference.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateDirectCostResponseContactReference - A customer or supplier associated with the direct cost. + */ + +public class AccountingCreateDirectCostResponseContactReference { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private JsonNullable dataType; + + /** + * Unique identifier for a customer or supplier. + */ + @JsonProperty("id") + private String id; + + public AccountingCreateDirectCostResponseContactReference( + @JsonProperty("dataType") JsonNullable dataType, + @JsonProperty("id") String id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public JsonNullable dataType() { + return dataType; + } + + /** + * Unique identifier for a customer or supplier. + */ + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public AccountingCreateDirectCostResponseContactReference withDataType(AccountingCreateDirectCostResponseDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public AccountingCreateDirectCostResponseContactReference withDataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public AccountingCreateDirectCostResponseContactReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateDirectCostResponseContactReference other = (AccountingCreateDirectCostResponseContactReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateDirectCostResponseContactReference.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private JsonNullable dataType = JsonNullable.undefined(); + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(AccountingCreateDirectCostResponseDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingCreateDirectCostResponseContactReference build() { + return new AccountingCreateDirectCostResponseContactReference( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseDataType.java new file mode 100644 index 00000000..605359e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateDirectCostResponseDataType.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountingCreateDirectCostResponseDataType - Allowed name of the 'dataType'. + */ +public enum AccountingCreateDirectCostResponseDataType { + CUSTOMERS("customers"), + SUPPLIERS("suppliers"); + + @JsonValue + private final String value; + + private AccountingCreateDirectCostResponseDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponse.java new file mode 100644 index 00000000..7c48d81a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreatePaymentResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreatePaymentResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreatePaymentResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreatePaymentResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreatePaymentResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreatePaymentResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreatePaymentResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreatePaymentResponse withData(AccountingCreatePaymentResponseAccountingPayment data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreatePaymentResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreatePaymentResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreatePaymentResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreatePaymentResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreatePaymentResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreatePaymentResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreatePaymentResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreatePaymentResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreatePaymentResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreatePaymentResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreatePaymentResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreatePaymentResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreatePaymentResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreatePaymentResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreatePaymentResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreatePaymentResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreatePaymentResponse other = (AccountingCreatePaymentResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreatePaymentResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreatePaymentResponseAccountingPayment data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreatePaymentResponse build() { + return new AccountingCreatePaymentResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponseAccountingPayment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponseAccountingPayment.java new file mode 100644 index 00000000..145067e9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreatePaymentResponseAccountingPayment.java @@ -0,0 +1,1839 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreatePaymentResponseAccountingPayment - > **Payments or bill payments?** + * > + * > In Codat, payments represent accounts receivable only. For accounts payable, see [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). These include [bills](https://docs.codat.io/lending-api#/schemas/Bill) and credit notes against bills. + * + * > View the coverage for payments in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Payments include all accounts receivable transaction data. This includes [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + * + * A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to: + * + * - A payment made against an invoice, like a credit card, cheque, or cash payment. + * - An allocation of a customer's credit note, either to an invoice or maybe a refund. + * - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. + * + * Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. + * + * In Codat, a payment contains details of: + * + * - When the payment was recorded in the accounting system. + * - How much it is for and in what currency that amount is in. + * - Who the payment was _paid by_ – the _customer_. + * - The payment method used. + * - The breakdown of the types of payments – the _line items_. + * + * Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * + * ## Payment types + * + * ## Payment of an invoice + * + * A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties: + * + * - An _amount_ that indicates the amount of the invoice that was paid. This is always positive. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of **link**, in this case an `Invoice`. + * - An **id** that contains the ID of the invoice that was paid. + * - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment. + * + * ## Payment of multiple invoices + * + * A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books: + * + * - The payment has multiple entries in its **lines** array, one for each invoice that is paid. Each line follows the example and rules described in [Payment of an invoice](#payment-of-an-invoice). + * - The payment has a line with multiple links to each invoice. This occurs when the proportion of the original payment allocated to each invoice is not available. + * + * Each **line** has the same properties as those described in [Payment of an invoice](#payment-of-an-invoice), with the **amount** indicating how much of the payment was allocated to the invoice. The sum of line amounts equals the **totalAmount** on the payment. + * + * ## Payments and refunds on account + * + * A payment on account, that is a payment that doesn’t pay a specific invoice, has one entry in its lines array. The **line** has the following properties: + * + * - A **totalAmount** that indicates the amount paid by a customer or refunded to them by a company. A payment to the customer is always negative. A refund is always positive. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + * - The **id** containing the ID of the customer. + * - The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund. + * + * It is possible to have a payment that is part _on account_ and part _allocated_ to an invoice. Each line should follow the examples above. + * + * ## Using a credit note to pay an invoice + * + * The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties: + * + * - An **amount** that indicates the amount of money moved, which in this case is `0`, as the credit note and invoice allocation must balance each other. + * - A **links** array containing two elements: + * - The first **link** has: + * - A **type** that indicates the type of **link**, in this case an `Invoice`. + * - An **id** that contains the ID of the invoice that was paid. + * - The second **link** has: + * - A **type** that indicates the type of **link**, in this case a `CreditNote`. + * - An **id** that contains the ID of the credit note used by this payment. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment. + * + * ## Refunding a credit note + * + * A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties: + * + * - An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund. + * - A **links** array that contains one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `CreditNote`. + * - An **id** that contains the ID of the credit note that was refunded. + * + * The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable. + * + * ## Refunding a payment + * + * If a payment is refunded, for example, if a customer overpaid an invoice and the overpayment is returned to the customer, there are two payment records: + * + * - One for the incoming over payment. + * - Another for the outgoing refund. + * + * The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties: + * + * - An **amount** that indicates the amount that was refunded. This is always negative. + * - A **links** array that contains one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `Payment`. + * - An **id** that contains the ID of the payment that was refunded. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable. + * + * The payment that was refunded has a line where the **amount** is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was used to partly pay an invoice. + * + * For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines: + * + * - One for £1,000 linked to the invoice that was paid. + * - Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment. + * + * The **line** linked to the payment has the following properties: + * + * - An **amount** that indicates the amount that was refunded. This is positive as its money that was added to accounts receivable. It's balanced out by the negative amount of the refund. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `Refund`. + * - An **id** that contains the ID of the payment that refunded this line. + * + * > **Support for linked payments** + * > + * > Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. + * + * ## Foreign currencies + * + * There are two types of currency rate that are included in the payments data type: + * + * Payment currency rate: + * + * - Base currency of the accounts receivable account. + * - Foreign currency of the payment. + * + * Payment line link currency rate: + * + * - Base currency of the item the link represents. + * - Foreign currency of the payment. + * + * These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a payment is applied to an item in a currency that doesn't match either: + * + * - The base currency for the accounts receivable account. + * - The currency of the item. + * + * ```json title="Currency rate example" + * { + * "id": "123", + * "note": "", + * "totalAmount": 99.99, + * "currency": "GBP", + * "lines": [ + * { + * "amount": 99.99, + * "links": [ + * { + * "type": "Invoice", + * "id": "178", + * "amount": -50, + * "currencyRate": 1.9998 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Example data + * + * > **Object properties** + * > + * > For the sake of brevity, the examples here may omit properties from objects. For the full object definition, see [Payments](https://api.codat.io/swagger/index.html#/Payments). + * + * ## Simple examples + * + * ```json title="Payment for invoice" + * { + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Allocation of credit note" + * { + * "totalAmount": 0, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Payment of invoice and payment on account" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "y", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Refund of credit note" + * { + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Refund on accounts receivable account" + * { + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Linked refund on accounts receivable account" + * { + * "id" : "payment-001", + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Refund", + * "id" : "refund-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * { + * "id" : "refund-001", + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "Payment", + * "id" : "payment-001", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Using a credit note and cash to pay an invoice" + * { + * "totalAmount": 250, + * "lines": [ + * { + * "amount": 0, + * "links": [ + * { + * "type": "Invoice", + * "id": "x", + * "amount": -750 + * }, + * { + * "type": "CreditNote", + * "id": "y", + * "amount": 750 + * } + * ] + * }, + * { + * "amount": 250, + * "links": [ + * { + * "type": "Invoice", + * "id": "x", + * "amount": -250 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Complex examples + * + * ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice" + * { + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "customer-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes pay two invoices with no allocation amount specified" + * { + * "totalAmount": 0, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "w", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "w", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "u", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Refund", + * "id" : "refund-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * { + * "id" : "refund-001", + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "Payment", + * "id" : "payment-001", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * In this example, a payment on account is used to pay the same invoice in January and again in February. + * + * ```json title="January" + * { + * "id": "001", + * "totalAmount": 5000, + * "date" : "1901-01-01", + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 4000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "PaymentOnAccount-y", + * "amount" : -4000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="February" + * { + * "id": "001", + * "totalAmount": 5000, + * "date" : "1901-02-01", + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-y", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 3000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "PaymentOnAccount-y", + * "amount" : -3000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes and some cash pay two invoices with no allocations specified" + * { + * "totalAmount": 500, + * "lines": [ + * { + * "amount": 500, + * "links": [{ + * "type": "Invoice", + * "id": "a", + * "amount": -1000 + * }, { + * "type": "Invoice", + * "id": "b", + * "amount": -1000 + * }, { + * "type": "CreditNote", + * "id": "y", + * "amount": 750 + * },{ + * "type": "CreditNote", + * "id": "z", + * "amount": 750 + * } + * ] + * } + * ] + * } + * ``` + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreatePaymentResponseAccountingPayment { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("date") + private String date; + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * An array of payment lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lines") + private JsonNullable> lines; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information associated with the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentMethodRef") + private Optional paymentMethodRef; + + /** + * Friendly reference for the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public AccountingCreatePaymentResponseAccountingPayment( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("date") String date, + @JsonProperty("id") Optional id, + @JsonProperty("lines") JsonNullable> lines, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentMethodRef") Optional paymentMethodRef, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lines, "lines"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.accountRef = accountRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.customerRef = customerRef; + this.date = date; + this.id = id; + this.lines = lines; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentMethodRef = paymentMethodRef; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * 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 String date() { + return date; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * An array of payment lines. + */ + public JsonNullable> lines() { + return lines; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information associated with the payment. + */ + public JsonNullable note() { + return note; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Optional paymentMethodRef() { + return paymentMethodRef; + } + + /** + * Friendly reference for the payment. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingCreatePaymentResponseAccountingPayment withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingCreatePaymentResponseAccountingPayment withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreatePaymentResponseAccountingPayment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreatePaymentResponseAccountingPayment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreatePaymentResponseAccountingPayment withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreatePaymentResponseAccountingPayment withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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 AccountingCreatePaymentResponseAccountingPayment withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public AccountingCreatePaymentResponseAccountingPayment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public AccountingCreatePaymentResponseAccountingPayment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of payment lines. + */ + public AccountingCreatePaymentResponseAccountingPayment withLines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of payment lines. + */ + public AccountingCreatePaymentResponseAccountingPayment withLines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information associated with the payment. + */ + public AccountingCreatePaymentResponseAccountingPayment withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information associated with the payment. + */ + public AccountingCreatePaymentResponseAccountingPayment withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public AccountingCreatePaymentResponseAccountingPayment withPaymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public AccountingCreatePaymentResponseAccountingPayment withPaymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Friendly reference for the payment. + */ + public AccountingCreatePaymentResponseAccountingPayment withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Friendly reference for the payment. + */ + public AccountingCreatePaymentResponseAccountingPayment withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreatePaymentResponseAccountingPayment withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreatePaymentResponseAccountingPayment withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public AccountingCreatePaymentResponseAccountingPayment withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public AccountingCreatePaymentResponseAccountingPayment withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreatePaymentResponseAccountingPayment other = (AccountingCreatePaymentResponseAccountingPayment) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lines, other.lines) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentMethodRef, other.paymentMethodRef) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + currency, + currencyRate, + customerRef, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreatePaymentResponseAccountingPayment.class, + "accountRef", accountRef, + "currency", currency, + "currencyRate", currencyRate, + "customerRef", customerRef, + "date", date, + "id", id, + "lines", lines, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentMethodRef", paymentMethodRef, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional customerRef = Optional.empty(); + + private String date; + + private Optional id = Optional.empty(); + + private JsonNullable> lines = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional paymentMethodRef = Optional.empty(); + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of payment lines. + */ + public Builder lines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of payment lines. + */ + public Builder lines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information associated with the payment. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information associated with the payment. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Friendly reference for the payment. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Friendly reference for the payment. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingCreatePaymentResponseAccountingPayment build() { + return new AccountingCreatePaymentResponseAccountingPayment( + accountRef, + currency, + currencyRate, + customerRef, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponse.java new file mode 100644 index 00000000..ba5e690e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateSupplierResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateSupplierResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateSupplierResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateSupplierResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateSupplierResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateSupplierResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateSupplierResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateSupplierResponse withData(AccountingCreateSupplierResponseAccountingSupplier data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreateSupplierResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateSupplierResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateSupplierResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateSupplierResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateSupplierResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateSupplierResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateSupplierResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateSupplierResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateSupplierResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateSupplierResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateSupplierResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateSupplierResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateSupplierResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateSupplierResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateSupplierResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateSupplierResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateSupplierResponse other = (AccountingCreateSupplierResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateSupplierResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateSupplierResponseAccountingSupplier data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateSupplierResponse build() { + return new AccountingCreateSupplierResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponseAccountingSupplier.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponseAccountingSupplier.java new file mode 100644 index 00000000..4fae39e2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateSupplierResponseAccountingSupplier.java @@ -0,0 +1,831 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateSupplierResponseAccountingSupplier - > View the coverage for suppliers in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/lending-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/lending-api#/schemas/Bill). + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateSupplierResponseAccountingSupplier { + + /** + * An array of Addresses. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private JsonNullable> addresses; + + /** + * Name of the main contact for the supplier. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactName") + private JsonNullable contactName; + + /** + * Default currency the supplier's transactional data is recorded in. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("defaultCurrency") + private JsonNullable defaultCurrency; + + /** + * Email address that the supplier may be contacted on. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emailAddress") + private JsonNullable emailAddress; + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Phone number that the supplier may be contacted on. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone") + private JsonNullable phone; + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("registrationNumber") + private JsonNullable registrationNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the supplier. + */ + @JsonProperty("status") + private SupplierStatus status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierName") + private JsonNullable supplierName; + + /** + * Supplier's company tax number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxNumber") + private JsonNullable taxNumber; + + public AccountingCreateSupplierResponseAccountingSupplier( + @JsonProperty("addresses") JsonNullable> addresses, + @JsonProperty("contactName") JsonNullable contactName, + @JsonProperty("defaultCurrency") JsonNullable defaultCurrency, + @JsonProperty("emailAddress") JsonNullable emailAddress, + @JsonProperty("id") Optional id, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("phone") JsonNullable phone, + @JsonProperty("registrationNumber") JsonNullable registrationNumber, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") SupplierStatus status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("supplierName") JsonNullable supplierName, + @JsonProperty("taxNumber") JsonNullable taxNumber) { + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(contactName, "contactName"); + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(phone, "phone"); + Utils.checkNotNull(registrationNumber, "registrationNumber"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(supplierName, "supplierName"); + Utils.checkNotNull(taxNumber, "taxNumber"); + this.addresses = addresses; + this.contactName = contactName; + this.defaultCurrency = defaultCurrency; + this.emailAddress = emailAddress; + this.id = id; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.phone = phone; + this.registrationNumber = registrationNumber; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + this.supplierName = supplierName; + this.taxNumber = taxNumber; + } + + /** + * An array of Addresses. + */ + public JsonNullable> addresses() { + return addresses; + } + + /** + * Name of the main contact for the supplier. + */ + public JsonNullable contactName() { + return contactName; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public JsonNullable defaultCurrency() { + return defaultCurrency; + } + + /** + * Email address that the supplier may be contacted on. + */ + public JsonNullable emailAddress() { + return emailAddress; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public JsonNullable phone() { + return phone; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public JsonNullable registrationNumber() { + return registrationNumber; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the supplier. + */ + public SupplierStatus status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public JsonNullable supplierName() { + return supplierName; + } + + /** + * Supplier's company tax number. + */ + public JsonNullable taxNumber() { + return taxNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array of Addresses. + */ + public AccountingCreateSupplierResponseAccountingSupplier withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public AccountingCreateSupplierResponseAccountingSupplier withAddresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public AccountingCreateSupplierResponseAccountingSupplier withContactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public AccountingCreateSupplierResponseAccountingSupplier withContactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public AccountingCreateSupplierResponseAccountingSupplier withDefaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = JsonNullable.of(defaultCurrency); + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public AccountingCreateSupplierResponseAccountingSupplier withDefaultCurrency(JsonNullable defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public AccountingCreateSupplierResponseAccountingSupplier withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public AccountingCreateSupplierResponseAccountingSupplier withEmailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public AccountingCreateSupplierResponseAccountingSupplier withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public AccountingCreateSupplierResponseAccountingSupplier withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public AccountingCreateSupplierResponseAccountingSupplier withPhone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public AccountingCreateSupplierResponseAccountingSupplier withPhone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public AccountingCreateSupplierResponseAccountingSupplier withRegistrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public AccountingCreateSupplierResponseAccountingSupplier withRegistrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the supplier. + */ + public AccountingCreateSupplierResponseAccountingSupplier withStatus(SupplierStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateSupplierResponseAccountingSupplier withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateSupplierResponseAccountingSupplier withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public AccountingCreateSupplierResponseAccountingSupplier withSupplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public AccountingCreateSupplierResponseAccountingSupplier withSupplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + /** + * Supplier's company tax number. + */ + public AccountingCreateSupplierResponseAccountingSupplier withTaxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Supplier's company tax number. + */ + public AccountingCreateSupplierResponseAccountingSupplier withTaxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateSupplierResponseAccountingSupplier other = (AccountingCreateSupplierResponseAccountingSupplier) o; + return + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.contactName, other.contactName) && + java.util.Objects.deepEquals(this.defaultCurrency, other.defaultCurrency) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.phone, other.phone) && + java.util.Objects.deepEquals(this.registrationNumber, other.registrationNumber) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.supplierName, other.supplierName) && + java.util.Objects.deepEquals(this.taxNumber, other.taxNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + addresses, + contactName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + supplierName, + taxNumber); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateSupplierResponseAccountingSupplier.class, + "addresses", addresses, + "contactName", contactName, + "defaultCurrency", defaultCurrency, + "emailAddress", emailAddress, + "id", id, + "metadata", metadata, + "modifiedDate", modifiedDate, + "phone", phone, + "registrationNumber", registrationNumber, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData, + "supplierName", supplierName, + "taxNumber", taxNumber); + } + + public final static class Builder { + + private JsonNullable> addresses = JsonNullable.undefined(); + + private JsonNullable contactName = JsonNullable.undefined(); + + private JsonNullable defaultCurrency = JsonNullable.undefined(); + + private JsonNullable emailAddress = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable phone = JsonNullable.undefined(); + + private JsonNullable registrationNumber = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private SupplierStatus status; + + private Optional supplementalData = Optional.empty(); + + private JsonNullable supplierName = JsonNullable.undefined(); + + private JsonNullable taxNumber = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array of Addresses. + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public Builder addresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public Builder contactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public Builder contactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public Builder defaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = JsonNullable.of(defaultCurrency); + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public Builder defaultCurrency(JsonNullable defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public Builder emailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public Builder phone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public Builder phone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public Builder registrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public Builder registrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the supplier. + */ + public Builder status(SupplierStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public Builder supplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public Builder supplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + /** + * Supplier's company tax number. + */ + public Builder taxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Supplier's company tax number. + */ + public Builder taxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + public AccountingCreateSupplierResponseAccountingSupplier build() { + return new AccountingCreateSupplierResponseAccountingSupplier( + addresses, + contactName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + supplierName, + taxNumber); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponse.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponse.java new file mode 100644 index 00000000..b981d895 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponse.java @@ -0,0 +1,945 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCreateTransferResponse { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("data") + private JsonNullable data; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public AccountingCreateTransferResponse( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("data") JsonNullable data, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.data = data; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + public JsonNullable data() { + return data; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateTransferResponse withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public AccountingCreateTransferResponse withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public AccountingCreateTransferResponse withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 AccountingCreateTransferResponse withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 AccountingCreateTransferResponse withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public AccountingCreateTransferResponse withData(AccountingCreateTransferResponseAccountingTransfer data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public AccountingCreateTransferResponse withData(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public AccountingCreateTransferResponse withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public AccountingCreateTransferResponse withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public AccountingCreateTransferResponse withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateTransferResponse withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public AccountingCreateTransferResponse withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public AccountingCreateTransferResponse withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 AccountingCreateTransferResponse withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public AccountingCreateTransferResponse withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public AccountingCreateTransferResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateTransferResponse withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public AccountingCreateTransferResponse withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateTransferResponse withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public AccountingCreateTransferResponse withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateTransferResponse withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public AccountingCreateTransferResponse withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateTransferResponse other = (AccountingCreateTransferResponse) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateTransferResponse.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "data", data, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private JsonNullable data = JsonNullable.undefined(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + public Builder data(AccountingCreateTransferResponseAccountingTransfer data) { + Utils.checkNotNull(data, "data"); + this.data = JsonNullable.of(data); + return this; + } + + public Builder data(JsonNullable data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public AccountingCreateTransferResponse build() { + return new AccountingCreateTransferResponse( + changes, + companyId, + completedOnUtc, + data, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponseAccountingTransfer.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponseAccountingTransfer.java new file mode 100644 index 00000000..3559f2e7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreateTransferResponseAccountingTransfer.java @@ -0,0 +1,838 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreateTransferResponseAccountingTransfer - > View the coverage for transfers in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers" target="_blank">Data coverage explorer</a>. + * + * A transfer records the movement of money between two bank accounts, or between a bank account and a nominal account. It is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class AccountingCreateTransferResponseAccountingTransfer { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("depositedRecordRefs") + private JsonNullable> depositedRecordRefs; + + /** + * Description of the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Account details of the account sending or receiving the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from") + private Optional from; + + /** + * Unique identifier for the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Account details of the account sending or receiving the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("to") + private Optional to; + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + private JsonNullable> trackingCategoryRefs; + + public AccountingCreateTransferResponseAccountingTransfer( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("date") Optional date, + @JsonProperty("depositedRecordRefs") JsonNullable> depositedRecordRefs, + @JsonProperty("description") JsonNullable description, + @JsonProperty("from") Optional from, + @JsonProperty("id") Optional id, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("to") Optional to, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(from, "from"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(to, "to"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.contactRef = contactRef; + this.date = date; + this.depositedRecordRefs = depositedRecordRefs; + this.description = description; + this.from = from; + this.id = id; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.to = to; + this.trackingCategoryRefs = trackingCategoryRefs; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public JsonNullable> depositedRecordRefs() { + return depositedRecordRefs; + } + + /** + * Description of the transfer. + */ + public JsonNullable description() { + return description; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Optional from() { + return from; + } + + /** + * Unique identifier for the transfer. + */ + public Optional id() { + return id; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Optional to() { + return to; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingCreateTransferResponseAccountingTransfer withContactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingCreateTransferResponseAccountingTransfer withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + 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 AccountingCreateTransferResponseAccountingTransfer 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 AccountingCreateTransferResponseAccountingTransfer withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withDepositedRecordRefs(java.util.List depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = JsonNullable.of(depositedRecordRefs); + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withDepositedRecordRefs(JsonNullable> depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = depositedRecordRefs; + return this; + } + + /** + * Description of the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withFrom(TransferAccount from) { + Utils.checkNotNull(from, "from"); + this.from = Optional.ofNullable(from); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withFrom(Optional from) { + Utils.checkNotNull(from, "from"); + this.from = from; + return this; + } + + /** + * Unique identifier for the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateTransferResponseAccountingTransfer withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreateTransferResponseAccountingTransfer withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withTo(TransferAccount to) { + Utils.checkNotNull(to, "to"); + this.to = Optional.ofNullable(to); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingCreateTransferResponseAccountingTransfer withTo(Optional to) { + Utils.checkNotNull(to, "to"); + this.to = to; + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public AccountingCreateTransferResponseAccountingTransfer withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public AccountingCreateTransferResponseAccountingTransfer withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreateTransferResponseAccountingTransfer other = (AccountingCreateTransferResponseAccountingTransfer) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.depositedRecordRefs, other.depositedRecordRefs) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.from, other.from) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.to, other.to) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + date, + depositedRecordRefs, + description, + from, + id, + metadata, + modifiedDate, + sourceModifiedDate, + supplementalData, + to, + trackingCategoryRefs); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreateTransferResponseAccountingTransfer.class, + "contactRef", contactRef, + "date", date, + "depositedRecordRefs", depositedRecordRefs, + "description", description, + "from", from, + "id", id, + "metadata", metadata, + "modifiedDate", modifiedDate, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "to", to, + "trackingCategoryRefs", trackingCategoryRefs); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private Optional date = Optional.empty(); + + private JsonNullable> depositedRecordRefs = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private Optional from = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional to = Optional.empty(); + + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + 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(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; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public Builder depositedRecordRefs(java.util.List depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = JsonNullable.of(depositedRecordRefs); + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public Builder depositedRecordRefs(JsonNullable> depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = depositedRecordRefs; + return this; + } + + /** + * Description of the transfer. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the transfer. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder from(TransferAccount from) { + Utils.checkNotNull(from, "from"); + this.from = Optional.ofNullable(from); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder from(Optional from) { + Utils.checkNotNull(from, "from"); + this.from = from; + return this; + } + + /** + * Unique identifier for the transfer. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the transfer. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder to(TransferAccount to) { + Utils.checkNotNull(to, "to"); + this.to = Optional.ofNullable(to); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder to(Optional to) { + Utils.checkNotNull(to, "to"); + this.to = to; + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + public AccountingCreateTransferResponseAccountingTransfer build() { + return new AccountingCreateTransferResponseAccountingTransfer( + contactRef, + date, + depositedRecordRefs, + description, + from, + id, + metadata, + modifiedDate, + sourceModifiedDate, + supplementalData, + to, + trackingCategoryRefs); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNote.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNote.java new file mode 100644 index 00000000..aad5d999 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNote.java @@ -0,0 +1,1697 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCreditNote - > View the coverage for credit notes in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=creditNotes" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Think of a credit note as a voucher issued to a customer. It is a reduction that can be applied against one or multiple invoices. A credit note can either reduce the amount owed or cancel out an invoice entirely. + * + * In the Codat system a credit note is issued to a [customer's](https://docs.codat.io/lending-api#/schemas/Customer) accounts receivable. + * + * It contains details of: + * * The amount of credit remaining and its status. + * * Payment allocations against the payments type, in this case an invoice. + * * Which customers the credit notes have been issued to. + */ + +public class AccountingCreditNote { + + /** + * Additional tax amount applied to credit note. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("additionalTaxAmount") + private Optional additionalTaxAmount; + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("additionalTaxPercentage") + private Optional additionalTaxPercentage; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allocatedOnDate") + private Optional allocatedOnDate; + + /** + * Friendly reference for the credit note. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("creditNoteNumber") + private JsonNullable creditNoteNumber; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * Percentage rate (from 0 to 100) of discounts applied to the credit note. + */ + @JsonProperty("discountPercentage") + private double discountPercentage; + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("issueDate") + private Optional issueDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineItems") + private JsonNullable> lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentAllocations") + private JsonNullable> paymentAllocations; + + /** + * Unused balance of totalAmount originally raised. + */ + @JsonProperty("remainingCredit") + private double remainingCredit; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current state of the credit note. + */ + @JsonProperty("status") + private CreditNoteStatus status; + + /** + * Value of the credit note, including discounts and excluding tax. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Total amount of credit that has been applied to the customer's accounts receivable + */ + @JsonProperty("totalAmount") + private double totalAmount; + + /** + * Any discounts applied to the credit note amount. + */ + @JsonProperty("totalDiscount") + private double totalDiscount; + + /** + * Any tax applied to the credit note amount. + */ + @JsonProperty("totalTaxAmount") + private double totalTaxAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("withholdingTax") + private JsonNullable> withholdingTax; + + public AccountingCreditNote( + @JsonProperty("additionalTaxAmount") Optional additionalTaxAmount, + @JsonProperty("additionalTaxPercentage") Optional additionalTaxPercentage, + @JsonProperty("allocatedOnDate") Optional allocatedOnDate, + @JsonProperty("creditNoteNumber") JsonNullable creditNoteNumber, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("discountPercentage") double discountPercentage, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") Optional issueDate, + @JsonProperty("lineItems") JsonNullable> lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") JsonNullable> paymentAllocations, + @JsonProperty("remainingCredit") double remainingCredit, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") CreditNoteStatus status, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") double totalAmount, + @JsonProperty("totalDiscount") double totalDiscount, + @JsonProperty("totalTaxAmount") double totalTaxAmount, + @JsonProperty("withholdingTax") JsonNullable> withholdingTax) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + Utils.checkNotNull(creditNoteNumber, "creditNoteNumber"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(remainingCredit, "remainingCredit"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(totalDiscount, "totalDiscount"); + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.additionalTaxAmount = additionalTaxAmount; + this.additionalTaxPercentage = additionalTaxPercentage; + this.allocatedOnDate = allocatedOnDate; + this.creditNoteNumber = creditNoteNumber; + this.currency = currency; + this.currencyRate = currencyRate; + this.customerRef = customerRef; + this.discountPercentage = discountPercentage; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.remainingCredit = remainingCredit; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + this.totalDiscount = totalDiscount; + this.totalTaxAmount = totalTaxAmount; + this.withholdingTax = withholdingTax; + } + + /** + * Additional tax amount applied to credit note. + */ + public Optional additionalTaxAmount() { + return additionalTaxAmount; + } + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + public Optional additionalTaxPercentage() { + return additionalTaxPercentage; + } + + /** + * 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 Optional allocatedOnDate() { + return allocatedOnDate; + } + + /** + * Friendly reference for the credit note. + */ + public JsonNullable creditNoteNumber() { + return creditNoteNumber; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the credit note. + */ + public double discountPercentage() { + return discountPercentage; + } + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * 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 Optional issueDate() { + return issueDate; + } + + public JsonNullable> lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public JsonNullable> paymentAllocations() { + return paymentAllocations; + } + + /** + * Unused balance of totalAmount originally raised. + */ + public double remainingCredit() { + return remainingCredit; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current state of the credit note. + */ + public CreditNoteStatus status() { + return status; + } + + /** + * Value of the credit note, including discounts and excluding tax. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Total amount of credit that has been applied to the customer's accounts receivable + */ + public double totalAmount() { + return totalAmount; + } + + /** + * Any discounts applied to the credit note amount. + */ + public double totalDiscount() { + return totalDiscount; + } + + /** + * Any tax applied to the credit note amount. + */ + public double totalTaxAmount() { + return totalTaxAmount; + } + + public JsonNullable> withholdingTax() { + return withholdingTax; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Additional tax amount applied to credit note. + */ + public AccountingCreditNote withAdditionalTaxAmount(double additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = Optional.ofNullable(additionalTaxAmount); + return this; + } + + /** + * Additional tax amount applied to credit note. + */ + public AccountingCreditNote withAdditionalTaxAmount(Optional additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = additionalTaxAmount; + return this; + } + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + public AccountingCreditNote withAdditionalTaxPercentage(double additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = Optional.ofNullable(additionalTaxPercentage); + return this; + } + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + public AccountingCreditNote withAdditionalTaxPercentage(Optional additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = additionalTaxPercentage; + 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 AccountingCreditNote withAllocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 AccountingCreditNote withAllocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Friendly reference for the credit note. + */ + public AccountingCreditNote withCreditNoteNumber(String creditNoteNumber) { + Utils.checkNotNull(creditNoteNumber, "creditNoteNumber"); + this.creditNoteNumber = JsonNullable.of(creditNoteNumber); + return this; + } + + /** + * Friendly reference for the credit note. + */ + public AccountingCreditNote withCreditNoteNumber(JsonNullable creditNoteNumber) { + Utils.checkNotNull(creditNoteNumber, "creditNoteNumber"); + this.creditNoteNumber = creditNoteNumber; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreditNote withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCreditNote withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreditNote withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingCreditNote withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingCreditNote withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountingCreditNote withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the credit note. + */ + public AccountingCreditNote withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + public AccountingCreditNote withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + public AccountingCreditNote withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 AccountingCreditNote withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 AccountingCreditNote withIssueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + public AccountingCreditNote withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + public AccountingCreditNote withLineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingCreditNote withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCreditNote withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCreditNote withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCreditNote withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + public AccountingCreditNote withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + public AccountingCreditNote withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingCreditNote withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingCreditNote withPaymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * Unused balance of totalAmount originally raised. + */ + public AccountingCreditNote withRemainingCredit(double remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = remainingCredit; + return this; + } + + public AccountingCreditNote withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCreditNote withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the credit note. + */ + public AccountingCreditNote withStatus(CreditNoteStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Value of the credit note, including discounts and excluding tax. + */ + public AccountingCreditNote withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreditNote withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCreditNote withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Total amount of credit that has been applied to the customer's accounts receivable + */ + public AccountingCreditNote withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Any discounts applied to the credit note amount. + */ + public AccountingCreditNote withTotalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Any tax applied to the credit note amount. + */ + public AccountingCreditNote withTotalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public AccountingCreditNote withWithholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public AccountingCreditNote withWithholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreditNote other = (AccountingCreditNote) o; + return + java.util.Objects.deepEquals(this.additionalTaxAmount, other.additionalTaxAmount) && + java.util.Objects.deepEquals(this.additionalTaxPercentage, other.additionalTaxPercentage) && + java.util.Objects.deepEquals(this.allocatedOnDate, other.allocatedOnDate) && + java.util.Objects.deepEquals(this.creditNoteNumber, other.creditNoteNumber) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.remainingCredit, other.remainingCredit) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.totalDiscount, other.totalDiscount) && + java.util.Objects.deepEquals(this.totalTaxAmount, other.totalTaxAmount) && + java.util.Objects.deepEquals(this.withholdingTax, other.withholdingTax); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + additionalTaxAmount, + additionalTaxPercentage, + allocatedOnDate, + creditNoteNumber, + currency, + currencyRate, + customerRef, + discountPercentage, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + remainingCredit, + sourceModifiedDate, + status, + subTotal, + supplementalData, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreditNote.class, + "additionalTaxAmount", additionalTaxAmount, + "additionalTaxPercentage", additionalTaxPercentage, + "allocatedOnDate", allocatedOnDate, + "creditNoteNumber", creditNoteNumber, + "currency", currency, + "currencyRate", currencyRate, + "customerRef", customerRef, + "discountPercentage", discountPercentage, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "remainingCredit", remainingCredit, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "subTotal", subTotal, + "supplementalData", supplementalData, + "totalAmount", totalAmount, + "totalDiscount", totalDiscount, + "totalTaxAmount", totalTaxAmount, + "withholdingTax", withholdingTax); + } + + public final static class Builder { + + private Optional additionalTaxAmount = Optional.empty(); + + private Optional additionalTaxPercentage = Optional.empty(); + + private Optional allocatedOnDate = Optional.empty(); + + private JsonNullable creditNoteNumber = JsonNullable.undefined(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional customerRef = Optional.empty(); + + private Double discountPercentage; + + private Optional id = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private JsonNullable> lineItems = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private JsonNullable> paymentAllocations = JsonNullable.undefined(); + + private Double remainingCredit; + + private Optional sourceModifiedDate = Optional.empty(); + + private CreditNoteStatus status; + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Double totalAmount; + + private Double totalDiscount; + + private Double totalTaxAmount; + + private JsonNullable> withholdingTax = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Additional tax amount applied to credit note. + */ + public Builder additionalTaxAmount(double additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = Optional.ofNullable(additionalTaxAmount); + return this; + } + + /** + * Additional tax amount applied to credit note. + */ + public Builder additionalTaxAmount(Optional additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = additionalTaxAmount; + return this; + } + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + public Builder additionalTaxPercentage(double additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = Optional.ofNullable(additionalTaxPercentage); + return this; + } + + /** + * Percentage rate of any additional tax applied to the credit note. + */ + public Builder additionalTaxPercentage(Optional additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = additionalTaxPercentage; + 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 allocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 allocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Friendly reference for the credit note. + */ + public Builder creditNoteNumber(String creditNoteNumber) { + Utils.checkNotNull(creditNoteNumber, "creditNoteNumber"); + this.creditNoteNumber = JsonNullable.of(creditNoteNumber); + return this; + } + + /** + * Friendly reference for the credit note. + */ + public Builder creditNoteNumber(JsonNullable creditNoteNumber) { + Utils.checkNotNull(creditNoteNumber, "creditNoteNumber"); + this.creditNoteNumber = creditNoteNumber; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the credit note. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the credit note, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 issueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + public Builder lineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the credit note. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when a credit note is emailed from the accounting platform to the customer. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * Unused balance of totalAmount originally raised. + */ + public Builder remainingCredit(double remainingCredit) { + Utils.checkNotNull(remainingCredit, "remainingCredit"); + this.remainingCredit = remainingCredit; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the credit note. + */ + public Builder status(CreditNoteStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Value of the credit note, including discounts and excluding tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Total amount of credit that has been applied to the customer's accounts receivable + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Any discounts applied to the credit note amount. + */ + public Builder totalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Any tax applied to the credit note amount. + */ + public Builder totalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder withholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public Builder withholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + public AccountingCreditNote build() { + return new AccountingCreditNote( + additionalTaxAmount, + additionalTaxPercentage, + allocatedOnDate, + creditNoteNumber, + currency, + currencyRate, + customerRef, + discountPercentage, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + remainingCredit, + sourceModifiedDate, + status, + subTotal, + supplementalData, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNotes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNotes.java new file mode 100644 index 00000000..45d21826 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCreditNotes.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingCreditNotes { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingCreditNotes( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingCreditNotes withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingCreditNotes withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingCreditNotes withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingCreditNotes withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingCreditNotes withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingCreditNotes withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCreditNotes other = (AccountingCreditNotes) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingCreditNotes.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingCreditNotes build() { + return new AccountingCreditNotes( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomer.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomer.java new file mode 100644 index 00000000..7f52d011 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomer.java @@ -0,0 +1,928 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingCustomer - > View the coverage for customers in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=customers" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + * + * Customers' data links to accounts receivable [invoices](https://docs.codat.io/lending-api#/schemas/Invoice). + * + */ + +public class AccountingCustomer { + + /** + * An array of Addresses. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private JsonNullable> addresses; + + /** + * Name of the main contact for the identified customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactName") + private JsonNullable contactName; + + /** + * An array of Contacts. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contacts") + private JsonNullable> contacts; + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerName") + private JsonNullable customerName; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("defaultCurrency") + private Optional defaultCurrency; + + /** + * Email address the customer can be contacted by. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emailAddress") + private JsonNullable emailAddress; + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Phone number the customer can be contacted by. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone") + private JsonNullable phone; + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("registrationNumber") + private JsonNullable registrationNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of customer. + */ + @JsonProperty("status") + private CustomerStatus status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Company tax number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxNumber") + private JsonNullable taxNumber; + + public AccountingCustomer( + @JsonProperty("addresses") JsonNullable> addresses, + @JsonProperty("contactName") JsonNullable contactName, + @JsonProperty("contacts") JsonNullable> contacts, + @JsonProperty("customerName") JsonNullable customerName, + @JsonProperty("defaultCurrency") Optional defaultCurrency, + @JsonProperty("emailAddress") JsonNullable emailAddress, + @JsonProperty("id") Optional id, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("phone") JsonNullable phone, + @JsonProperty("registrationNumber") JsonNullable registrationNumber, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") CustomerStatus status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxNumber") JsonNullable taxNumber) { + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(contactName, "contactName"); + Utils.checkNotNull(contacts, "contacts"); + Utils.checkNotNull(customerName, "customerName"); + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(phone, "phone"); + Utils.checkNotNull(registrationNumber, "registrationNumber"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxNumber, "taxNumber"); + this.addresses = addresses; + this.contactName = contactName; + this.contacts = contacts; + this.customerName = customerName; + this.defaultCurrency = defaultCurrency; + this.emailAddress = emailAddress; + this.id = id; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.phone = phone; + this.registrationNumber = registrationNumber; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + this.taxNumber = taxNumber; + } + + /** + * An array of Addresses. + */ + public JsonNullable> addresses() { + return addresses; + } + + /** + * Name of the main contact for the identified customer. + */ + public JsonNullable contactName() { + return contactName; + } + + /** + * An array of Contacts. + */ + public JsonNullable> contacts() { + return contacts; + } + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + public JsonNullable customerName() { + return customerName; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional defaultCurrency() { + return defaultCurrency; + } + + /** + * Email address the customer can be contacted by. + */ + public JsonNullable emailAddress() { + return emailAddress; + } + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Phone number the customer can be contacted by. + */ + public JsonNullable phone() { + return phone; + } + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + public JsonNullable registrationNumber() { + return registrationNumber; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of customer. + */ + public CustomerStatus status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Company tax number. + */ + public JsonNullable taxNumber() { + return taxNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array of Addresses. + */ + public AccountingCustomer withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public AccountingCustomer withAddresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the identified customer. + */ + public AccountingCustomer withContactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the identified customer. + */ + public AccountingCustomer withContactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * An array of Contacts. + */ + public AccountingCustomer withContacts(java.util.List contacts) { + Utils.checkNotNull(contacts, "contacts"); + this.contacts = JsonNullable.of(contacts); + return this; + } + + /** + * An array of Contacts. + */ + public AccountingCustomer withContacts(JsonNullable> contacts) { + Utils.checkNotNull(contacts, "contacts"); + this.contacts = contacts; + return this; + } + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + public AccountingCustomer withCustomerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = JsonNullable.of(customerName); + return this; + } + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + public AccountingCustomer withCustomerName(JsonNullable customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCustomer withDefaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = Optional.ofNullable(defaultCurrency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingCustomer withDefaultCurrency(Optional defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address the customer can be contacted by. + */ + public AccountingCustomer withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address the customer can be contacted by. + */ + public AccountingCustomer withEmailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + public AccountingCustomer withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + public AccountingCustomer withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingCustomer withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingCustomer withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingCustomer withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingCustomer withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number the customer can be contacted by. + */ + public AccountingCustomer withPhone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number the customer can be contacted by. + */ + public AccountingCustomer withPhone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + public AccountingCustomer withRegistrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + public AccountingCustomer withRegistrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public AccountingCustomer withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingCustomer withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of customer. + */ + public AccountingCustomer withStatus(CustomerStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCustomer withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingCustomer withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Company tax number. + */ + public AccountingCustomer withTaxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Company tax number. + */ + public AccountingCustomer withTaxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCustomer other = (AccountingCustomer) o; + return + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.contactName, other.contactName) && + java.util.Objects.deepEquals(this.contacts, other.contacts) && + java.util.Objects.deepEquals(this.customerName, other.customerName) && + java.util.Objects.deepEquals(this.defaultCurrency, other.defaultCurrency) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.phone, other.phone) && + java.util.Objects.deepEquals(this.registrationNumber, other.registrationNumber) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxNumber, other.taxNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + addresses, + contactName, + contacts, + customerName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + taxNumber); + } + + @Override + public String toString() { + return Utils.toString(AccountingCustomer.class, + "addresses", addresses, + "contactName", contactName, + "contacts", contacts, + "customerName", customerName, + "defaultCurrency", defaultCurrency, + "emailAddress", emailAddress, + "id", id, + "metadata", metadata, + "modifiedDate", modifiedDate, + "phone", phone, + "registrationNumber", registrationNumber, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData, + "taxNumber", taxNumber); + } + + public final static class Builder { + + private JsonNullable> addresses = JsonNullable.undefined(); + + private JsonNullable contactName = JsonNullable.undefined(); + + private JsonNullable> contacts = JsonNullable.undefined(); + + private JsonNullable customerName = JsonNullable.undefined(); + + private Optional defaultCurrency = Optional.empty(); + + private JsonNullable emailAddress = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable phone = JsonNullable.undefined(); + + private JsonNullable registrationNumber = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private CustomerStatus status; + + private Optional supplementalData = Optional.empty(); + + private JsonNullable taxNumber = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array of Addresses. + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public Builder addresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the identified customer. + */ + public Builder contactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the identified customer. + */ + public Builder contactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * An array of Contacts. + */ + public Builder contacts(java.util.List contacts) { + Utils.checkNotNull(contacts, "contacts"); + this.contacts = JsonNullable.of(contacts); + return this; + } + + /** + * An array of Contacts. + */ + public Builder contacts(JsonNullable> contacts) { + Utils.checkNotNull(contacts, "contacts"); + this.contacts = contacts; + return this; + } + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + public Builder customerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = JsonNullable.of(customerName); + return this; + } + + /** + * Name of the customer as recorded in the accounting system, typically the company name. + */ + public Builder customerName(JsonNullable customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder defaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = Optional.ofNullable(defaultCurrency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder defaultCurrency(Optional defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address the customer can be contacted by. + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address the customer can be contacted by. + */ + public Builder emailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the customer, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number the customer can be contacted by. + */ + public Builder phone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number the customer can be contacted by. + */ + public Builder phone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + public Builder registrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number. In the UK, this is typically the Companies House company registration number. + */ + public Builder registrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of customer. + */ + public Builder status(CustomerStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Company tax number. + */ + public Builder taxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Company tax number. + */ + public Builder taxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + public AccountingCustomer build() { + return new AccountingCustomer( + addresses, + contactName, + contacts, + customerName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + taxNumber); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomerRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomerRef.java new file mode 100644 index 00000000..25404773 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomerRef.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingCustomerRef { + + /** + * `customerName` from the Customer data type + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private JsonNullable companyName; + + /** + * `id` from the Customers data type + */ + @JsonProperty("id") + private String id; + + public AccountingCustomerRef( + @JsonProperty("companyName") JsonNullable companyName, + @JsonProperty("id") String id) { + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(id, "id"); + this.companyName = companyName; + this.id = id; + } + + /** + * `customerName` from the Customer data type + */ + public JsonNullable companyName() { + return companyName; + } + + /** + * `id` from the Customers data type + */ + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * `customerName` from the Customer data type + */ + public AccountingCustomerRef withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = JsonNullable.of(companyName); + return this; + } + + /** + * `customerName` from the Customer data type + */ + public AccountingCustomerRef withCompanyName(JsonNullable companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * `id` from the Customers data type + */ + public AccountingCustomerRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCustomerRef other = (AccountingCustomerRef) o; + return + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyName, + id); + } + + @Override + public String toString() { + return Utils.toString(AccountingCustomerRef.class, + "companyName", companyName, + "id", id); + } + + public final static class Builder { + + private JsonNullable companyName = JsonNullable.undefined(); + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * `customerName` from the Customer data type + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = JsonNullable.of(companyName); + return this; + } + + /** + * `customerName` from the Customer data type + */ + public Builder companyName(JsonNullable companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * `id` from the Customers data type + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingCustomerRef build() { + return new AccountingCustomerRef( + companyName, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomers.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomers.java new file mode 100644 index 00000000..98625456 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingCustomers.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingCustomers { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingCustomers( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingCustomers withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingCustomers withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingCustomers withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingCustomers withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingCustomers withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingCustomers withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingCustomers other = (AccountingCustomers) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingCustomers.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingCustomers build() { + return new AccountingCustomers( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCost.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCost.java new file mode 100644 index 00000000..81904f87 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCost.java @@ -0,0 +1,1126 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingDirectCost - > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. + * + * > View the coverage for direct costs in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directCosts" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Direct costs are the expenses associated with a business' operations. For example, purchases of raw materials and service fees are considered direct costs. + * + * Direct costs include: + * * Purchasing an item and paying it off at the point of the purchase + * * Receiving cash from a refunded item if the refund is made by the supplier + * * Withdrawing money from a bank account + * * Writing a cheque + * + * Direct costs is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + */ + +public class AccountingDirectCost { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Identifier of the direct cost, unique for the company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("issueDate") + private String issueDate; + + /** + * An array of line items. + */ + @JsonProperty("lineItems") + private java.util.List lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * A note attached to the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonProperty("paymentAllocations") + private java.util.List paymentAllocations; + + /** + * User-friendly reference for the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The total amount of the direct costs, excluding any taxes. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * The total amount of tax on the direct costs. + */ + @JsonProperty("taxAmount") + private double taxAmount; + + /** + * The amount of the direct costs, inclusive of tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + public AccountingDirectCost( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("currency") String currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") java.util.List lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") java.util.List paymentAllocations, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxAmount") double taxAmount, + @JsonProperty("totalAmount") double totalAmount) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.contactRef = contactRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Optional id() { + return id; + } + + /** + * 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 String issueDate() { + return issueDate; + } + + /** + * An array of line items. + */ + public java.util.List lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * A note attached to the direct cost. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public java.util.List paymentAllocations() { + return paymentAllocations; + } + + /** + * User-friendly reference for the direct cost. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * The total amount of tax on the direct costs. + */ + public double taxAmount() { + return taxAmount; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public double totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingDirectCost withContactRef(AccountingDirectCostContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingDirectCost withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingDirectCost withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingDirectCost withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingDirectCost withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public AccountingDirectCost withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public AccountingDirectCost withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 AccountingDirectCost withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public AccountingDirectCost withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingDirectCost withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingDirectCost withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingDirectCost withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingDirectCost withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * A note attached to the direct cost. + */ + public AccountingDirectCost withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public AccountingDirectCost withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingDirectCost withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public AccountingDirectCost withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public AccountingDirectCost withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingDirectCost withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingDirectCost withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public AccountingDirectCost withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingDirectCost withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingDirectCost withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public AccountingDirectCost withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public AccountingDirectCost withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingDirectCost other = (AccountingDirectCost) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingDirectCost.class, + "contactRef", contactRef, + "currency", currency, + "currencyRate", currencyRate, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "subTotal", subTotal, + "supplementalData", supplementalData, + "taxAmount", taxAmount, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private String currency; + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private String issueDate; + + private java.util.List lineItems; + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private java.util.List paymentAllocations; + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Double taxAmount; + + private Double totalAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(AccountingDirectCostContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct cost, unique for the company. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingDirectCost build() { + return new AccountingDirectCost( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostContactReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostContactReference.java new file mode 100644 index 00000000..947b51fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostContactReference.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingDirectCostContactReference - A customer or supplier associated with the direct cost. + */ + +public class AccountingDirectCostContactReference { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private JsonNullable dataType; + + /** + * Unique identifier for a customer or supplier. + */ + @JsonProperty("id") + private String id; + + public AccountingDirectCostContactReference( + @JsonProperty("dataType") JsonNullable dataType, + @JsonProperty("id") String id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public JsonNullable dataType() { + return dataType; + } + + /** + * Unique identifier for a customer or supplier. + */ + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public AccountingDirectCostContactReference withDataType(AccountingDirectCostDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public AccountingDirectCostContactReference withDataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public AccountingDirectCostContactReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingDirectCostContactReference other = (AccountingDirectCostContactReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(AccountingDirectCostContactReference.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private JsonNullable dataType = JsonNullable.undefined(); + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(AccountingDirectCostDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingDirectCostContactReference build() { + return new AccountingDirectCostContactReference( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostDataType.java new file mode 100644 index 00000000..d19903c1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCostDataType.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountingDirectCostDataType - Allowed name of the 'dataType'. + */ +public enum AccountingDirectCostDataType { + CUSTOMERS("customers"), + SUPPLIERS("suppliers"); + + @JsonValue + private final String value; + + private AccountingDirectCostDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCosts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCosts.java new file mode 100644 index 00000000..76034387 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectCosts.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingDirectCosts { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingDirectCosts( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingDirectCosts withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingDirectCosts withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingDirectCosts withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingDirectCosts withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingDirectCosts withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingDirectCosts withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingDirectCosts other = (AccountingDirectCosts) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingDirectCosts.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingDirectCosts build() { + return new AccountingDirectCosts( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncome.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncome.java new file mode 100644 index 00000000..629e7b2a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncome.java @@ -0,0 +1,1115 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingDirectIncome - > **Language tip:** Direct incomes may also be referred to as **Receive transactions**, **Receive money transactions**, **Sales receipts**, or **Cash sales** in various accounting platforms. + * + * > View the coverage for direct incomes in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=directIncomes" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Direct incomes are incomes received directly from the business' operations. For example, cash sales of items to a customer, referral commissions, and service fee refunds are considered direct incomes. + * + * Direct incomes include: + * + * - Selling an item directly to a contact, and receiving payment at the point of the sale. + * - Refunding an item in cash to a contact. + * - Depositing money into a bank account. + * + * Direct incomes is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * + */ + +public class AccountingDirectIncome { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Identifier of the direct income, unique for the company. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("issueDate") + private String issueDate; + + /** + * An array of line items. + */ + @JsonProperty("lineItems") + private java.util.List lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + @JsonProperty("paymentAllocations") + private java.util.List paymentAllocations; + + /** + * User-friendly reference for the direct income. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The total amount of the direct incomes, excluding any taxes. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * The total amount of tax on the direct incomes. + */ + @JsonProperty("taxAmount") + private double taxAmount; + + /** + * The amount of the direct incomes, inclusive of tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + public AccountingDirectIncome( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("currency") String currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") Optional id, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") java.util.List lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") java.util.List paymentAllocations, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxAmount") double taxAmount, + @JsonProperty("totalAmount") double totalAmount) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.contactRef = contactRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.id = id; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Identifier of the direct income, unique for the company. + */ + public Optional id() { + return id; + } + + /** + * 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 String issueDate() { + return issueDate; + } + + /** + * An array of line items. + */ + public java.util.List lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + public JsonNullable note() { + return note; + } + + public java.util.List paymentAllocations() { + return paymentAllocations; + } + + /** + * User-friendly reference for the direct income. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The total amount of the direct incomes, excluding any taxes. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * The total amount of tax on the direct incomes. + */ + public double taxAmount() { + return taxAmount; + } + + /** + * The amount of the direct incomes, inclusive of tax. + */ + public double totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingDirectIncome withContactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingDirectIncome withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingDirectIncome withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingDirectIncome withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingDirectIncome withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct income, unique for the company. + */ + public AccountingDirectIncome withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct income, unique for the company. + */ + public AccountingDirectIncome withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 AccountingDirectIncome withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public AccountingDirectIncome withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingDirectIncome withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingDirectIncome withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingDirectIncome withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingDirectIncome withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + public AccountingDirectIncome withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + public AccountingDirectIncome withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public AccountingDirectIncome withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct income. + */ + public AccountingDirectIncome withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct income. + */ + public AccountingDirectIncome withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingDirectIncome withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingDirectIncome withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct incomes, excluding any taxes. + */ + public AccountingDirectIncome withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingDirectIncome withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingDirectIncome withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct incomes. + */ + public AccountingDirectIncome withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct incomes, inclusive of tax. + */ + public AccountingDirectIncome withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingDirectIncome other = (AccountingDirectIncome) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingDirectIncome.class, + "contactRef", contactRef, + "currency", currency, + "currencyRate", currencyRate, + "id", id, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentAllocations", paymentAllocations, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "subTotal", subTotal, + "supplementalData", supplementalData, + "taxAmount", taxAmount, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private String currency; + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private String issueDate; + + private java.util.List lineItems; + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private java.util.List paymentAllocations; + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Double taxAmount; + + private Double totalAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the direct income, unique for the company. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the direct income, unique for the company. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * An optional note on the direct income that can be used to assign the direct income with a reference ID in your application. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct income. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct income. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The total amount of the direct incomes, excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct incomes. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct incomes, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingDirectIncome build() { + return new AccountingDirectIncome( + contactRef, + currency, + currencyRate, + id, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paymentAllocations, + reference, + sourceModifiedDate, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncomes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncomes.java new file mode 100644 index 00000000..4b9542ff --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingDirectIncomes.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingDirectIncomes { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingDirectIncomes( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingDirectIncomes withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingDirectIncomes withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingDirectIncomes withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingDirectIncomes withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingDirectIncomes withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingDirectIncomes withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingDirectIncomes other = (AccountingDirectIncomes) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingDirectIncomes.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingDirectIncomes build() { + return new AccountingDirectIncomes( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoice.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoice.java new file mode 100644 index 00000000..ea0c90de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoice.java @@ -0,0 +1,1984 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingInvoice - > **Invoices or bills?** + * > + * > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company issued an invoice, and is owed money (accounts receivable) we call this an Invoice. + * > + * > See [Bills](https://docs.codat.io/lending-api#/schemas/Bill) for the accounts payable equivalent of bills. + * + * View the coverage for invoices in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=invoices" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * An invoice is an itemized record of goods sold or services provided to a [customer](https://docs.codat.io/lending-api#/schemas/Customer). + * + * In Codat, an invoice contains details of: + * + * - The timeline of the invoice—when it was raised, marked as paid, last edited, and so on. + * - How much the invoice is for, what portion of the invoice is tax or discounts, and what currency the amounts are represented in. + * - Who the invoice has been raised to; the _customer_. + * - The breakdown of what the invoice is for; the _line items_. + * - Any [payments](https://docs.codat.io/lending-api#/schemas/Payment) assigned to the invoice; the _payment allocations_. + * + * > **Invoice PDF downloads** + * > + * > You can <a className="external" href="https://docs.codat.io/lending-api#/operations/get-invoice-pdf" target="_blank">download a PDF version</a> of an invoice for supported integrations. + * > + * > The filename will be invoice-{number}.pdf. + * + * > **Referencing an invoice in Sage 50 and ClearBooks** + * > + * > In Sage 50 and ClearBooks, you may prefer to use the **invoiceNumber** to identify an invoice rather than the invoice **id**. Each time a draft invoice is submitted or printed, the draft **id** becomes void and a submitted invoice with a new **id** exists in its place. In both platforms, the **invoiceNumber** should remain the same. + */ + +public class AccountingInvoice { + + /** + * Additional tax amount applied to invoice. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("additionalTaxAmount") + private Optional additionalTaxAmount; + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("additionalTaxPercentage") + private Optional additionalTaxPercentage; + + /** + * Amount outstanding on the invoice. + */ + @JsonProperty("amountDue") + private double amountDue; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("invoiceNumber") + private JsonNullable invoiceNumber; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("issueDate") + private String issueDate; + + /** + * An array of line items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineItems") + private JsonNullable> lineItems; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paidOnDate") + private Optional paidOnDate; + + /** + * An array of payment allocations. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentAllocations") + private JsonNullable> paymentAllocations; + + /** + * List of references to related Sales orders. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("salesOrderRefs") + private JsonNullable> salesOrderRefs; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + @JsonProperty("status") + private InvoiceStatus status; + + /** + * Total amount of the invoice excluding any taxes. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Amount of the invoice, inclusive of tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + /** + * Numerical value of discounts applied to the invoice. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalDiscount") + private JsonNullable totalDiscount; + + /** + * Amount of tax on the invoice. + */ + @JsonProperty("totalTaxAmount") + private double totalTaxAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("withholdingTax") + private JsonNullable> withholdingTax; + + public AccountingInvoice( + @JsonProperty("additionalTaxAmount") Optional additionalTaxAmount, + @JsonProperty("additionalTaxPercentage") Optional additionalTaxPercentage, + @JsonProperty("amountDue") double amountDue, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") Optional id, + @JsonProperty("invoiceNumber") JsonNullable invoiceNumber, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") JsonNullable> lineItems, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paidOnDate") Optional paidOnDate, + @JsonProperty("paymentAllocations") JsonNullable> paymentAllocations, + @JsonProperty("salesOrderRefs") JsonNullable> salesOrderRefs, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") InvoiceStatus status, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") double totalAmount, + @JsonProperty("totalDiscount") JsonNullable totalDiscount, + @JsonProperty("totalTaxAmount") double totalTaxAmount, + @JsonProperty("withholdingTax") JsonNullable> withholdingTax) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + Utils.checkNotNull(amountDue, "amountDue"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paidOnDate, "paidOnDate"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(salesOrderRefs, "salesOrderRefs"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(totalDiscount, "totalDiscount"); + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.additionalTaxAmount = additionalTaxAmount; + this.additionalTaxPercentage = additionalTaxPercentage; + this.amountDue = amountDue; + this.currency = currency; + this.currencyRate = currencyRate; + this.customerRef = customerRef; + this.discountPercentage = discountPercentage; + this.dueDate = dueDate; + this.id = id; + this.invoiceNumber = invoiceNumber; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paidOnDate = paidOnDate; + this.paymentAllocations = paymentAllocations; + this.salesOrderRefs = salesOrderRefs; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + this.totalDiscount = totalDiscount; + this.totalTaxAmount = totalTaxAmount; + this.withholdingTax = withholdingTax; + } + + /** + * Additional tax amount applied to invoice. + */ + public Optional additionalTaxAmount() { + return additionalTaxAmount; + } + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + public Optional additionalTaxPercentage() { + return additionalTaxPercentage; + } + + /** + * Amount outstanding on the invoice. + */ + public double amountDue() { + return amountDue; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * 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 Optional dueDate() { + return dueDate; + } + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + public JsonNullable invoiceNumber() { + return invoiceNumber; + } + + /** + * 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 String issueDate() { + return issueDate; + } + + /** + * An array of line items. + */ + public JsonNullable> lineItems() { + return lineItems; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + public JsonNullable note() { + return note; + } + + /** + * 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 Optional paidOnDate() { + return paidOnDate; + } + + /** + * An array of payment allocations. + */ + public JsonNullable> paymentAllocations() { + return paymentAllocations; + } + + /** + * List of references to related Sales orders. + */ + public JsonNullable> salesOrderRefs() { + return salesOrderRefs; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public InvoiceStatus status() { + return status; + } + + /** + * Total amount of the invoice excluding any taxes. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Amount of the invoice, inclusive of tax. + */ + public double totalAmount() { + return totalAmount; + } + + /** + * Numerical value of discounts applied to the invoice. + */ + public JsonNullable totalDiscount() { + return totalDiscount; + } + + /** + * Amount of tax on the invoice. + */ + public double totalTaxAmount() { + return totalTaxAmount; + } + + public JsonNullable> withholdingTax() { + return withholdingTax; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Additional tax amount applied to invoice. + */ + public AccountingInvoice withAdditionalTaxAmount(double additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = Optional.ofNullable(additionalTaxAmount); + return this; + } + + /** + * Additional tax amount applied to invoice. + */ + public AccountingInvoice withAdditionalTaxAmount(Optional additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = additionalTaxAmount; + return this; + } + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + public AccountingInvoice withAdditionalTaxPercentage(double additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = Optional.ofNullable(additionalTaxPercentage); + return this; + } + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + public AccountingInvoice withAdditionalTaxPercentage(Optional additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = additionalTaxPercentage; + return this; + } + + /** + * Amount outstanding on the invoice. + */ + public AccountingInvoice withAmountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingInvoice withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingInvoice withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingInvoice withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingInvoice withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingInvoice withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountingInvoice withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + public AccountingInvoice withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + public AccountingInvoice withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + 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 AccountingInvoice withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 AccountingInvoice withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + public AccountingInvoice withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + public AccountingInvoice withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + public AccountingInvoice withInvoiceNumber(String invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = JsonNullable.of(invoiceNumber); + return this; + } + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + public AccountingInvoice withInvoiceNumber(JsonNullable invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = invoiceNumber; + 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 AccountingInvoice withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public AccountingInvoice withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * An array of line items. + */ + public AccountingInvoice withLineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public AccountingInvoice withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingInvoice withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingInvoice withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingInvoice withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + public AccountingInvoice withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + public AccountingInvoice withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + 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 AccountingInvoice withPaidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 AccountingInvoice withPaidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingInvoice withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public AccountingInvoice withPaymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * List of references to related Sales orders. + */ + public AccountingInvoice withSalesOrderRefs(java.util.List salesOrderRefs) { + Utils.checkNotNull(salesOrderRefs, "salesOrderRefs"); + this.salesOrderRefs = JsonNullable.of(salesOrderRefs); + return this; + } + + /** + * List of references to related Sales orders. + */ + public AccountingInvoice withSalesOrderRefs(JsonNullable> salesOrderRefs) { + Utils.checkNotNull(salesOrderRefs, "salesOrderRefs"); + this.salesOrderRefs = salesOrderRefs; + return this; + } + + public AccountingInvoice withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingInvoice withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public AccountingInvoice withStatus(InvoiceStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the invoice excluding any taxes. + */ + public AccountingInvoice withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Total amount of the invoice excluding any taxes. + */ + public AccountingInvoice withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingInvoice withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingInvoice withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the invoice, inclusive of tax. + */ + public AccountingInvoice withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Numerical value of discounts applied to the invoice. + */ + public AccountingInvoice withTotalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = JsonNullable.of(totalDiscount); + return this; + } + + /** + * Numerical value of discounts applied to the invoice. + */ + public AccountingInvoice withTotalDiscount(JsonNullable totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Amount of tax on the invoice. + */ + public AccountingInvoice withTotalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public AccountingInvoice withWithholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public AccountingInvoice withWithholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingInvoice other = (AccountingInvoice) o; + return + java.util.Objects.deepEquals(this.additionalTaxAmount, other.additionalTaxAmount) && + java.util.Objects.deepEquals(this.additionalTaxPercentage, other.additionalTaxPercentage) && + java.util.Objects.deepEquals(this.amountDue, other.amountDue) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.invoiceNumber, other.invoiceNumber) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paidOnDate, other.paidOnDate) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.salesOrderRefs, other.salesOrderRefs) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.totalDiscount, other.totalDiscount) && + java.util.Objects.deepEquals(this.totalTaxAmount, other.totalTaxAmount) && + java.util.Objects.deepEquals(this.withholdingTax, other.withholdingTax); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + additionalTaxAmount, + additionalTaxPercentage, + amountDue, + currency, + currencyRate, + customerRef, + discountPercentage, + dueDate, + id, + invoiceNumber, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paidOnDate, + paymentAllocations, + salesOrderRefs, + sourceModifiedDate, + status, + subTotal, + supplementalData, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + + @Override + public String toString() { + return Utils.toString(AccountingInvoice.class, + "additionalTaxAmount", additionalTaxAmount, + "additionalTaxPercentage", additionalTaxPercentage, + "amountDue", amountDue, + "currency", currency, + "currencyRate", currencyRate, + "customerRef", customerRef, + "discountPercentage", discountPercentage, + "dueDate", dueDate, + "id", id, + "invoiceNumber", invoiceNumber, + "issueDate", issueDate, + "lineItems", lineItems, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paidOnDate", paidOnDate, + "paymentAllocations", paymentAllocations, + "salesOrderRefs", salesOrderRefs, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "subTotal", subTotal, + "supplementalData", supplementalData, + "totalAmount", totalAmount, + "totalDiscount", totalDiscount, + "totalTaxAmount", totalTaxAmount, + "withholdingTax", withholdingTax); + } + + public final static class Builder { + + private Optional additionalTaxAmount = Optional.empty(); + + private Optional additionalTaxPercentage = Optional.empty(); + + private Double amountDue; + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional customerRef = Optional.empty(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional dueDate = Optional.empty(); + + private Optional id = Optional.empty(); + + private JsonNullable invoiceNumber = JsonNullable.undefined(); + + private String issueDate; + + private JsonNullable> lineItems = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional paidOnDate = Optional.empty(); + + private JsonNullable> paymentAllocations = JsonNullable.undefined(); + + private JsonNullable> salesOrderRefs = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private InvoiceStatus status; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private Optional supplementalData = Optional.empty(); + + private Double totalAmount; + + private JsonNullable totalDiscount = JsonNullable.undefined(); + + private Double totalTaxAmount; + + private JsonNullable> withholdingTax = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Additional tax amount applied to invoice. + */ + public Builder additionalTaxAmount(double additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = Optional.ofNullable(additionalTaxAmount); + return this; + } + + /** + * Additional tax amount applied to invoice. + */ + public Builder additionalTaxAmount(Optional additionalTaxAmount) { + Utils.checkNotNull(additionalTaxAmount, "additionalTaxAmount"); + this.additionalTaxAmount = additionalTaxAmount; + return this; + } + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + public Builder additionalTaxPercentage(double additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = Optional.ofNullable(additionalTaxPercentage); + return this; + } + + /** + * Percentage rate of any additional tax applied to the invoice. + */ + public Builder additionalTaxPercentage(Optional additionalTaxPercentage) { + Utils.checkNotNull(additionalTaxPercentage, "additionalTaxPercentage"); + this.additionalTaxPercentage = additionalTaxPercentage; + return this; + } + + /** + * Amount outstanding on the invoice. + */ + public Builder amountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of `5`, not `0.05`. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + 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 dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the invoice, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + public Builder invoiceNumber(String invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = JsonNullable.of(invoiceNumber); + return this; + } + + /** + * Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. + */ + public Builder invoiceNumber(JsonNullable invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = invoiceNumber; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = JsonNullable.of(lineItems); + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(JsonNullable> lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information about the invoice. Where possible, Codat links to a data field in the accounting platform that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting platform to the customer. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + 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 paidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 paidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = JsonNullable.of(paymentAllocations); + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(JsonNullable> paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * List of references to related Sales orders. + */ + public Builder salesOrderRefs(java.util.List salesOrderRefs) { + Utils.checkNotNull(salesOrderRefs, "salesOrderRefs"); + this.salesOrderRefs = JsonNullable.of(salesOrderRefs); + return this; + } + + /** + * List of references to related Sales orders. + */ + public Builder salesOrderRefs(JsonNullable> salesOrderRefs) { + Utils.checkNotNull(salesOrderRefs, "salesOrderRefs"); + this.salesOrderRefs = salesOrderRefs; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public Builder status(InvoiceStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total amount of the invoice excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Total amount of the invoice excluding any taxes. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the invoice, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Numerical value of discounts applied to the invoice. + */ + public Builder totalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = JsonNullable.of(totalDiscount); + return this; + } + + /** + * Numerical value of discounts applied to the invoice. + */ + public Builder totalDiscount(JsonNullable totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Amount of tax on the invoice. + */ + public Builder totalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public Builder withholdingTax(java.util.List withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = JsonNullable.of(withholdingTax); + return this; + } + + public Builder withholdingTax(JsonNullable> withholdingTax) { + Utils.checkNotNull(withholdingTax, "withholdingTax"); + this.withholdingTax = withholdingTax; + return this; + } + + public AccountingInvoice build() { + return new AccountingInvoice( + additionalTaxAmount, + additionalTaxPercentage, + amountDue, + currency, + currencyRate, + customerRef, + discountPercentage, + dueDate, + id, + invoiceNumber, + issueDate, + lineItems, + metadata, + modifiedDate, + note, + paidOnDate, + paymentAllocations, + salesOrderRefs, + sourceModifiedDate, + status, + subTotal, + supplementalData, + totalAmount, + totalDiscount, + totalTaxAmount, + withholdingTax); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoiceDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoiceDataType.java new file mode 100644 index 00000000..ebe7a1b3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoiceDataType.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * AccountingInvoiceDataType - The underlying data type associated to the reference `id`. + */ +public enum AccountingInvoiceDataType { + SALES_ORDERS("salesOrders"); + + @JsonValue + private final String value; + + private AccountingInvoiceDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoices.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoices.java new file mode 100644 index 00000000..213d450f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingInvoices.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingInvoices { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingInvoices( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingInvoices withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingInvoices withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingInvoices withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingInvoices withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingInvoices withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingInvoices withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingInvoices other = (AccountingInvoices) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingInvoices.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingInvoices build() { + return new AccountingInvoices( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournal.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournal.java new file mode 100644 index 00000000..480f2d37 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournal.java @@ -0,0 +1,798 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingJournal - > **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/lending-api#/schemas/JournalEntry) data type + * + * > View the coverage for journals in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/lending-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + * + * When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + * + * Such journals can be divided into two categories: + * + * - Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. + * - General journals: journals used to record transactions that fall outside the scope of the special journals. + * + * Multiple journals or subjournals are used in the following Codat integrations: + * + * - [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) + * - [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) + * - [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + * + * > When pushing journal entries to an accounting platform that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + * + */ + +public class AccountingJournal { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdOn") + private Optional createdOn; + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasChildren") + private Optional hasChildren; + + /** + * Journal ID. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Native journal number or code. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("journalCode") + private JsonNullable journalCode; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentId") + private JsonNullable parentId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current journal status. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * The type of the journal. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private JsonNullable type; + + public AccountingJournal( + @JsonProperty("createdOn") Optional createdOn, + @JsonProperty("hasChildren") Optional hasChildren, + @JsonProperty("id") Optional id, + @JsonProperty("journalCode") JsonNullable journalCode, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") JsonNullable name, + @JsonProperty("parentId") JsonNullable parentId, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("type") JsonNullable type) { + Utils.checkNotNull(createdOn, "createdOn"); + Utils.checkNotNull(hasChildren, "hasChildren"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(journalCode, "journalCode"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(parentId, "parentId"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(type, "type"); + this.createdOn = createdOn; + this.hasChildren = hasChildren; + this.id = id; + this.journalCode = journalCode; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.name = name; + this.parentId = parentId; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.type = type; + } + + /** + * 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 Optional createdOn() { + return createdOn; + } + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + public Optional hasChildren() { + return hasChildren; + } + + /** + * Journal ID. + */ + public Optional id() { + return id; + } + + /** + * Native journal number or code. + */ + public JsonNullable journalCode() { + return journalCode; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + public JsonNullable name() { + return name; + } + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + public JsonNullable parentId() { + return parentId; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current journal status. + */ + public Optional status() { + return status; + } + + /** + * The type of the journal. + */ + public JsonNullable type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 AccountingJournal withCreatedOn(String createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = Optional.ofNullable(createdOn); + 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 AccountingJournal withCreatedOn(Optional createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = createdOn; + return this; + } + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + public AccountingJournal withHasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + public AccountingJournal withHasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * Journal ID. + */ + public AccountingJournal withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Journal ID. + */ + public AccountingJournal withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Native journal number or code. + */ + public AccountingJournal withJournalCode(String journalCode) { + Utils.checkNotNull(journalCode, "journalCode"); + this.journalCode = JsonNullable.of(journalCode); + return this; + } + + /** + * Native journal number or code. + */ + public AccountingJournal withJournalCode(JsonNullable journalCode) { + Utils.checkNotNull(journalCode, "journalCode"); + this.journalCode = journalCode; + return this; + } + + public AccountingJournal withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingJournal withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingJournal withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingJournal withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + public AccountingJournal withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + public AccountingJournal withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + public AccountingJournal withParentId(String parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = JsonNullable.of(parentId); + return this; + } + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + public AccountingJournal withParentId(JsonNullable parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = parentId; + return this; + } + + public AccountingJournal withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingJournal withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current journal status. + */ + public AccountingJournal withStatus(JournalStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current journal status. + */ + public AccountingJournal withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * The type of the journal. + */ + public AccountingJournal withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = JsonNullable.of(type); + return this; + } + + /** + * The type of the journal. + */ + public AccountingJournal withType(JsonNullable type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingJournal other = (AccountingJournal) o; + return + java.util.Objects.deepEquals(this.createdOn, other.createdOn) && + java.util.Objects.deepEquals(this.hasChildren, other.hasChildren) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.journalCode, other.journalCode) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.parentId, other.parentId) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + createdOn, + hasChildren, + id, + journalCode, + metadata, + modifiedDate, + name, + parentId, + sourceModifiedDate, + status, + type); + } + + @Override + public String toString() { + return Utils.toString(AccountingJournal.class, + "createdOn", createdOn, + "hasChildren", hasChildren, + "id", id, + "journalCode", journalCode, + "metadata", metadata, + "modifiedDate", modifiedDate, + "name", name, + "parentId", parentId, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "type", type); + } + + public final static class Builder { + + private Optional createdOn = Optional.empty(); + + private Optional hasChildren = Optional.empty(); + + private Optional id = Optional.empty(); + + private JsonNullable journalCode = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable parentId = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private JsonNullable type = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 createdOn(String createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = Optional.ofNullable(createdOn); + 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 createdOn(Optional createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = createdOn; + return this; + } + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + public Builder hasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * If the journal has child journals, this value is true. If it doesn’t, it is false. + */ + public Builder hasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * Journal ID. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Journal ID. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Native journal number or code. + */ + public Builder journalCode(String journalCode) { + Utils.checkNotNull(journalCode, "journalCode"); + this.journalCode = JsonNullable.of(journalCode); + return this; + } + + /** + * Native journal number or code. + */ + public Builder journalCode(JsonNullable journalCode) { + Utils.checkNotNull(journalCode, "journalCode"); + this.journalCode = journalCode; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Journal name. + * The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + public Builder parentId(String parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = JsonNullable.of(parentId); + return this; + } + + /** + * Parent journal ID. + * If the journal is a parent journal, this value is not present. + */ + public Builder parentId(JsonNullable parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = parentId; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current journal status. + */ + public Builder status(JournalStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current journal status. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * The type of the journal. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = JsonNullable.of(type); + return this; + } + + /** + * The type of the journal. + */ + public Builder type(JsonNullable type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public AccountingJournal build() { + return new AccountingJournal( + createdOn, + hasChildren, + id, + journalCode, + metadata, + modifiedDate, + name, + parentId, + sourceModifiedDate, + status, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntries.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntries.java new file mode 100644 index 00000000..07056db6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntries.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingJournalEntries { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingJournalEntries( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingJournalEntries withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingJournalEntries withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingJournalEntries withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingJournalEntries withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingJournalEntries withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingJournalEntries withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingJournalEntries other = (AccountingJournalEntries) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingJournalEntries.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingJournalEntries build() { + return new AccountingJournalEntries( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntry.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntry.java new file mode 100644 index 00000000..85bad96e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournalEntry.java @@ -0,0 +1,1072 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingJournalEntry - > **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/lending-api#/schemas/Journal) data type + * + * > View the coverage for journal entries in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/lending-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + * + * A journal entry line item is a single transaction line on the journal entry. For example: + * + * - When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. + * - When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + * + * In Codat a journal entry contains details of: + * + * - The date on which the entry was created and posted. + * - Itemised lines, including amounts and currency. + * - A reference to the associated accounts. + * - A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + * + * > **Pushing journal entries** + * > Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + */ + +public class AccountingJournalEntry { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdOn") + private Optional createdOn; + + /** + * Optional description of the journal entry. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * An array of journal lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("journalLines") + private JsonNullable> journalLines; + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("journalRef") + private Optional journalRef; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("postedOn") + private Optional postedOn; + + /** + * Links a journal entry to the underlying record that created it. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRef") + private Optional recordRef; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updatedOn") + private Optional updatedOn; + + public AccountingJournalEntry( + @JsonProperty("createdOn") Optional createdOn, + @JsonProperty("description") JsonNullable description, + @JsonProperty("id") Optional id, + @JsonProperty("journalLines") JsonNullable> journalLines, + @JsonProperty("journalRef") Optional journalRef, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("postedOn") Optional postedOn, + @JsonProperty("recordRef") Optional recordRef, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("updatedOn") Optional updatedOn) { + Utils.checkNotNull(createdOn, "createdOn"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(journalLines, "journalLines"); + Utils.checkNotNull(journalRef, "journalRef"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(postedOn, "postedOn"); + Utils.checkNotNull(recordRef, "recordRef"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(updatedOn, "updatedOn"); + this.createdOn = createdOn; + this.description = description; + this.id = id; + this.journalLines = journalLines; + this.journalRef = journalRef; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.postedOn = postedOn; + this.recordRef = recordRef; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.updatedOn = updatedOn; + } + + /** + * 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 Optional createdOn() { + return createdOn; + } + + /** + * Optional description of the journal entry. + */ + public JsonNullable description() { + return description; + } + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * An array of journal lines. + */ + public JsonNullable> journalLines() { + return journalLines; + } + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + public Optional journalRef() { + return journalRef; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * 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 Optional postedOn() { + return postedOn; + } + + /** + * Links a journal entry to the underlying record that created it. + */ + public Optional recordRef() { + return recordRef; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * 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 Optional updatedOn() { + return updatedOn; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 AccountingJournalEntry withCreatedOn(String createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = Optional.ofNullable(createdOn); + 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 AccountingJournalEntry withCreatedOn(Optional createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = createdOn; + return this; + } + + /** + * Optional description of the journal entry. + */ + public AccountingJournalEntry withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Optional description of the journal entry. + */ + public AccountingJournalEntry withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + public AccountingJournalEntry withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + public AccountingJournalEntry withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of journal lines. + */ + public AccountingJournalEntry withJournalLines(java.util.List journalLines) { + Utils.checkNotNull(journalLines, "journalLines"); + this.journalLines = JsonNullable.of(journalLines); + return this; + } + + /** + * An array of journal lines. + */ + public AccountingJournalEntry withJournalLines(JsonNullable> journalLines) { + Utils.checkNotNull(journalLines, "journalLines"); + this.journalLines = journalLines; + return this; + } + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + public AccountingJournalEntry withJournalRef(JournalRef journalRef) { + Utils.checkNotNull(journalRef, "journalRef"); + this.journalRef = Optional.ofNullable(journalRef); + return this; + } + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + public AccountingJournalEntry withJournalRef(Optional journalRef) { + Utils.checkNotNull(journalRef, "journalRef"); + this.journalRef = journalRef; + return this; + } + + public AccountingJournalEntry withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingJournalEntry withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingJournalEntry withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingJournalEntry withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 AccountingJournalEntry withPostedOn(String postedOn) { + Utils.checkNotNull(postedOn, "postedOn"); + this.postedOn = Optional.ofNullable(postedOn); + 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 AccountingJournalEntry withPostedOn(Optional postedOn) { + Utils.checkNotNull(postedOn, "postedOn"); + this.postedOn = postedOn; + return this; + } + + /** + * Links a journal entry to the underlying record that created it. + */ + public AccountingJournalEntry withRecordRef(JournalEntryRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links a journal entry to the underlying record that created it. + */ + public AccountingJournalEntry withRecordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + public AccountingJournalEntry withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingJournalEntry withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingJournalEntry withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingJournalEntry withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + 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 AccountingJournalEntry withUpdatedOn(String updatedOn) { + Utils.checkNotNull(updatedOn, "updatedOn"); + this.updatedOn = Optional.ofNullable(updatedOn); + 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 AccountingJournalEntry withUpdatedOn(Optional updatedOn) { + Utils.checkNotNull(updatedOn, "updatedOn"); + this.updatedOn = updatedOn; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingJournalEntry other = (AccountingJournalEntry) o; + return + java.util.Objects.deepEquals(this.createdOn, other.createdOn) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.journalLines, other.journalLines) && + java.util.Objects.deepEquals(this.journalRef, other.journalRef) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.postedOn, other.postedOn) && + java.util.Objects.deepEquals(this.recordRef, other.recordRef) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.updatedOn, other.updatedOn); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + createdOn, + description, + id, + journalLines, + journalRef, + metadata, + modifiedDate, + postedOn, + recordRef, + sourceModifiedDate, + supplementalData, + updatedOn); + } + + @Override + public String toString() { + return Utils.toString(AccountingJournalEntry.class, + "createdOn", createdOn, + "description", description, + "id", id, + "journalLines", journalLines, + "journalRef", journalRef, + "metadata", metadata, + "modifiedDate", modifiedDate, + "postedOn", postedOn, + "recordRef", recordRef, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "updatedOn", updatedOn); + } + + public final static class Builder { + + private Optional createdOn = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private JsonNullable> journalLines = JsonNullable.undefined(); + + private Optional journalRef = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional postedOn = Optional.empty(); + + private Optional recordRef = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional updatedOn = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 createdOn(String createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = Optional.ofNullable(createdOn); + 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 createdOn(Optional createdOn) { + Utils.checkNotNull(createdOn, "createdOn"); + this.createdOn = createdOn; + return this; + } + + /** + * Optional description of the journal entry. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Optional description of the journal entry. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier of the journal entry for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of journal lines. + */ + public Builder journalLines(java.util.List journalLines) { + Utils.checkNotNull(journalLines, "journalLines"); + this.journalLines = JsonNullable.of(journalLines); + return this; + } + + /** + * An array of journal lines. + */ + public Builder journalLines(JsonNullable> journalLines) { + Utils.checkNotNull(journalLines, "journalLines"); + this.journalLines = journalLines; + return this; + } + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + public Builder journalRef(JournalRef journalRef) { + Utils.checkNotNull(journalRef, "journalRef"); + this.journalRef = Optional.ofNullable(journalRef); + return this; + } + + /** + * Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + public Builder journalRef(Optional journalRef) { + Utils.checkNotNull(journalRef, "journalRef"); + this.journalRef = journalRef; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 postedOn(String postedOn) { + Utils.checkNotNull(postedOn, "postedOn"); + this.postedOn = Optional.ofNullable(postedOn); + 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 postedOn(Optional postedOn) { + Utils.checkNotNull(postedOn, "postedOn"); + this.postedOn = postedOn; + return this; + } + + /** + * Links a journal entry to the underlying record that created it. + */ + public Builder recordRef(JournalEntryRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links a journal entry to the underlying record that created it. + */ + public Builder recordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + 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 updatedOn(String updatedOn) { + Utils.checkNotNull(updatedOn, "updatedOn"); + this.updatedOn = Optional.ofNullable(updatedOn); + 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 updatedOn(Optional updatedOn) { + Utils.checkNotNull(updatedOn, "updatedOn"); + this.updatedOn = updatedOn; + return this; + } + + public AccountingJournalEntry build() { + return new AccountingJournalEntry( + createdOn, + description, + id, + journalLines, + journalRef, + metadata, + modifiedDate, + postedOn, + recordRef, + sourceModifiedDate, + supplementalData, + updatedOn); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournals.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournals.java new file mode 100644 index 00000000..80ca7f39 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingJournals.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingJournals { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingJournals( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingJournals withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingJournals withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingJournals withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingJournals withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingJournals withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingJournals withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingJournals other = (AccountingJournals) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingJournals.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingJournals build() { + return new AccountingJournals( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayment.java new file mode 100644 index 00000000..0f2df03c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayment.java @@ -0,0 +1,1838 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingPayment - > **Payments or bill payments?** + * > + * > In Codat, payments represent accounts receivable only. For accounts payable, see [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). These include [bills](https://docs.codat.io/lending-api#/schemas/Bill) and credit notes against bills. + * + * > View the coverage for payments in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * Payments include all accounts receivable transaction data. This includes [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote). + * + * A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to: + * + * - A payment made against an invoice, like a credit card, cheque, or cash payment. + * - An allocation of a customer's credit note, either to an invoice or maybe a refund. + * - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account. + * + * Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details. + * + * In Codat, a payment contains details of: + * + * - When the payment was recorded in the accounting system. + * - How much it is for and in what currency that amount is in. + * - Who the payment was _paid by_ – the _customer_. + * - The payment method used. + * - The breakdown of the types of payments – the _line items_. + * + * Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + * + * ## Payment types + * + * ## Payment of an invoice + * + * A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties: + * + * - An _amount_ that indicates the amount of the invoice that was paid. This is always positive. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of **link**, in this case an `Invoice`. + * - An **id** that contains the ID of the invoice that was paid. + * - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment. + * + * ## Payment of multiple invoices + * + * A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books: + * + * - The payment has multiple entries in its **lines** array, one for each invoice that is paid. Each line follows the example and rules described in [Payment of an invoice](#payment-of-an-invoice). + * - The payment has a line with multiple links to each invoice. This occurs when the proportion of the original payment allocated to each invoice is not available. + * + * Each **line** has the same properties as those described in [Payment of an invoice](#payment-of-an-invoice), with the **amount** indicating how much of the payment was allocated to the invoice. The sum of line amounts equals the **totalAmount** on the payment. + * + * ## Payments and refunds on account + * + * A payment on account, that is a payment that doesn’t pay a specific invoice, has one entry in its lines array. The **line** has the following properties: + * + * - A **totalAmount** that indicates the amount paid by a customer or refunded to them by a company. A payment to the customer is always negative. A refund is always positive. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + * - The **id** containing the ID of the customer. + * - The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund. + * + * It is possible to have a payment that is part _on account_ and part _allocated_ to an invoice. Each line should follow the examples above. + * + * ## Using a credit note to pay an invoice + * + * The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties: + * + * - An **amount** that indicates the amount of money moved, which in this case is `0`, as the credit note and invoice allocation must balance each other. + * - A **links** array containing two elements: + * - The first **link** has: + * - A **type** that indicates the type of **link**, in this case an `Invoice`. + * - An **id** that contains the ID of the invoice that was paid. + * - The second **link** has: + * - A **type** that indicates the type of **link**, in this case a `CreditNote`. + * - An **id** that contains the ID of the credit note used by this payment. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment. + * + * ## Refunding a credit note + * + * A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties: + * + * - An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund. + * - A **links** array that contains one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `CreditNote`. + * - An **id** that contains the ID of the credit note that was refunded. + * + * The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable. + * + * ## Refunding a payment + * + * If a payment is refunded, for example, if a customer overpaid an invoice and the overpayment is returned to the customer, there are two payment records: + * + * - One for the incoming over payment. + * - Another for the outgoing refund. + * + * The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties: + * + * - An **amount** that indicates the amount that was refunded. This is always negative. + * - A **links** array that contains one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `Payment`. + * - An **id** that contains the ID of the payment that was refunded. + * + * The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable. + * + * The payment that was refunded has a line where the **amount** is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was used to partly pay an invoice. + * + * For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines: + * + * - One for £1,000 linked to the invoice that was paid. + * - Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment. + * + * The **line** linked to the payment has the following properties: + * + * - An **amount** that indicates the amount that was refunded. This is positive as its money that was added to accounts receivable. It's balanced out by the negative amount of the refund. + * - A **links** array containing one element with the following properties: + * - A **type** that indicates the type of **link**, in this case a `Refund`. + * - An **id** that contains the ID of the payment that refunded this line. + * + * > **Support for linked payments** + * > + * > Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account. + * + * ## Foreign currencies + * + * There are two types of currency rate that are included in the payments data type: + * + * Payment currency rate: + * + * - Base currency of the accounts receivable account. + * - Foreign currency of the payment. + * + * Payment line link currency rate: + * + * - Base currency of the item the link represents. + * - Foreign currency of the payment. + * + * These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a payment is applied to an item in a currency that doesn't match either: + * + * - The base currency for the accounts receivable account. + * - The currency of the item. + * + * ```json title="Currency rate example" + * { + * "id": "123", + * "note": "", + * "totalAmount": 99.99, + * "currency": "GBP", + * "lines": [ + * { + * "amount": 99.99, + * "links": [ + * { + * "type": "Invoice", + * "id": "178", + * "amount": -50, + * "currencyRate": 1.9998 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Example data + * + * > **Object properties** + * > + * > For the sake of brevity, the examples here may omit properties from objects. For the full object definition, see [Payments](https://api.codat.io/swagger/index.html#/Payments). + * + * ## Simple examples + * + * ```json title="Payment for invoice" + * { + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Allocation of credit note" + * { + * "totalAmount": 0, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Payment of invoice and payment on account" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "y", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Refund of credit note" + * { + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Refund on accounts receivable account" + * { + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Linked refund on accounts receivable account" + * { + * "id" : "payment-001", + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Refund", + * "id" : "refund-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * { + * "id" : "refund-001", + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "Payment", + * "id" : "payment-001", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Using a credit note and cash to pay an invoice" + * { + * "totalAmount": 250, + * "lines": [ + * { + * "amount": 0, + * "links": [ + * { + * "type": "Invoice", + * "id": "x", + * "amount": -750 + * }, + * { + * "type": "CreditNote", + * "id": "y", + * "amount": 750 + * } + * ] + * }, + * { + * "amount": 250, + * "links": [ + * { + * "type": "Invoice", + * "id": "x", + * "amount": -250 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Complex examples + * + * ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice" + * { + * "totalAmount": 1000, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "customer-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes pay two invoices with no allocation amount specified" + * { + * "totalAmount": 0, + * "lines": [ + * { + * "amount" : 0, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "w", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash" + * { + * "totalAmount": 2000, + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "w", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "x", + * "amount" : -1000 + * }, + * { + * "type" : "Invoice", + * "id" : "u", + * "amount" : -1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "y", + * "amount" : 1000 + * }, + * { + * "type" : "CreditNote", + * "id" : "z", + * "amount" : 1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Refund", + * "id" : "refund-001", + * "amount" : -1000 + * } + * ] + * } + * ] + * } + * { + * "id" : "refund-001", + * "totalAmount": -1000, + * "lines": [ + * { + * "amount" : -1000, + * "links" : [ + * { + * "type" : "Payment", + * "id" : "payment-001", + * "amount" : 1000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * In this example, a payment on account is used to pay the same invoice in January and again in February. + * + * ```json title="January" + * { + * "id": "001", + * "totalAmount": 5000, + * "date" : "1901-01-01", + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 4000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "PaymentOnAccount-y", + * "amount" : -4000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="February" + * { + * "id": "001", + * "totalAmount": 5000, + * "date" : "1901-02-01", + * "lines": [ + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-x", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 1000, + * "links" : [ + * { + * "type" : "Invoice", + * "id" : "Invoice-y", + * "amount" : -1000 + * } + * ] + * }, + * { + * "amount" : 3000, + * "links" : [ + * { + * "type" : "PaymentOnAccount", + * "id" : "PaymentOnAccount-y", + * "amount" : -3000 + * } + * ] + * } + * ] + * } + * ``` + * + * + * + * ```json title="Two credit notes and some cash pay two invoices with no allocations specified" + * { + * "totalAmount": 500, + * "lines": [ + * { + * "amount": 500, + * "links": [{ + * "type": "Invoice", + * "id": "a", + * "amount": -1000 + * }, { + * "type": "Invoice", + * "id": "b", + * "amount": -1000 + * }, { + * "type": "CreditNote", + * "id": "y", + * "amount": 750 + * },{ + * "type": "CreditNote", + * "id": "z", + * "amount": 750 + * } + * ] + * } + * ] + * } + * ``` + */ + +public class AccountingPayment { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("date") + private String date; + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * An array of payment lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lines") + private JsonNullable> lines; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information associated with the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentMethodRef") + private Optional paymentMethodRef; + + /** + * Friendly reference for the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public AccountingPayment( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("date") String date, + @JsonProperty("id") Optional id, + @JsonProperty("lines") JsonNullable> lines, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentMethodRef") Optional paymentMethodRef, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lines, "lines"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.accountRef = accountRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.customerRef = customerRef; + this.date = date; + this.id = id; + this.lines = lines; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.note = note; + this.paymentMethodRef = paymentMethodRef; + this.reference = reference; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * 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 String date() { + return date; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * An array of payment lines. + */ + public JsonNullable> lines() { + return lines; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information associated with the payment. + */ + public JsonNullable note() { + return note; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Optional paymentMethodRef() { + return paymentMethodRef; + } + + /** + * Friendly reference for the payment. + */ + public JsonNullable reference() { + return reference; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingPayment withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public AccountingPayment withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingPayment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AccountingPayment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingPayment withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public AccountingPayment withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public AccountingPayment withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountingPayment withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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 AccountingPayment withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public AccountingPayment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public AccountingPayment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of payment lines. + */ + public AccountingPayment withLines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of payment lines. + */ + public AccountingPayment withLines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public AccountingPayment withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingPayment withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingPayment withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingPayment withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information associated with the payment. + */ + public AccountingPayment withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information associated with the payment. + */ + public AccountingPayment withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public AccountingPayment withPaymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public AccountingPayment withPaymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Friendly reference for the payment. + */ + public AccountingPayment withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Friendly reference for the payment. + */ + public AccountingPayment withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public AccountingPayment withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingPayment withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingPayment withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingPayment withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public AccountingPayment withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public AccountingPayment withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingPayment other = (AccountingPayment) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lines, other.lines) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentMethodRef, other.paymentMethodRef) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + currency, + currencyRate, + customerRef, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(AccountingPayment.class, + "accountRef", accountRef, + "currency", currency, + "currencyRate", currencyRate, + "customerRef", customerRef, + "date", date, + "id", id, + "lines", lines, + "metadata", metadata, + "modifiedDate", modifiedDate, + "note", note, + "paymentMethodRef", paymentMethodRef, + "reference", reference, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional customerRef = Optional.empty(); + + private String date; + + private Optional id = Optional.empty(); + + private JsonNullable> lines = JsonNullable.undefined(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional paymentMethodRef = Optional.empty(); + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the payment, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An array of payment lines. + */ + public Builder lines(java.util.List lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = JsonNullable.of(lines); + return this; + } + + /** + * An array of payment lines. + */ + public Builder lines(JsonNullable> lines) { + Utils.checkNotNull(lines, "lines"); + this.lines = lines; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information associated with the payment. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Any additional information associated with the payment. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Friendly reference for the payment. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Friendly reference for the payment. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public AccountingPayment build() { + return new AccountingPayment( + accountRef, + currency, + currencyRate, + customerRef, + date, + id, + lines, + metadata, + modifiedDate, + note, + paymentMethodRef, + reference, + sourceModifiedDate, + supplementalData, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPaymentAllocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPaymentAllocation.java new file mode 100644 index 00000000..107cf4a8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPaymentAllocation.java @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class AccountingPaymentAllocation { + + @JsonProperty("allocation") + private Allocation allocation; + + @JsonProperty("payment") + private PaymentAllocationPayment payment; + + public AccountingPaymentAllocation( + @JsonProperty("allocation") Allocation allocation, + @JsonProperty("payment") PaymentAllocationPayment payment) { + Utils.checkNotNull(allocation, "allocation"); + Utils.checkNotNull(payment, "payment"); + this.allocation = allocation; + this.payment = payment; + } + + public Allocation allocation() { + return allocation; + } + + public PaymentAllocationPayment payment() { + return payment; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingPaymentAllocation withAllocation(Allocation allocation) { + Utils.checkNotNull(allocation, "allocation"); + this.allocation = allocation; + return this; + } + + public AccountingPaymentAllocation withPayment(PaymentAllocationPayment payment) { + Utils.checkNotNull(payment, "payment"); + this.payment = payment; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingPaymentAllocation other = (AccountingPaymentAllocation) o; + return + java.util.Objects.deepEquals(this.allocation, other.allocation) && + java.util.Objects.deepEquals(this.payment, other.payment); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allocation, + payment); + } + + @Override + public String toString() { + return Utils.toString(AccountingPaymentAllocation.class, + "allocation", allocation, + "payment", payment); + } + + public final static class Builder { + + private Allocation allocation; + + private PaymentAllocationPayment payment; + + private Builder() { + // force use of static builder() method + } + + public Builder allocation(Allocation allocation) { + Utils.checkNotNull(allocation, "allocation"); + this.allocation = allocation; + return this; + } + + public Builder payment(PaymentAllocationPayment payment) { + Utils.checkNotNull(payment, "payment"); + this.payment = payment; + return this; + } + + public AccountingPaymentAllocation build() { + return new AccountingPaymentAllocation( + allocation, + payment); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayments.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayments.java new file mode 100644 index 00000000..f914145d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingPayments.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingPayments { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingPayments( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingPayments withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingPayments withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingPayments withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingPayments withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingPayments withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingPayments withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingPayments other = (AccountingPayments) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingPayments.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingPayments build() { + return new AccountingPayments( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingProfitAndLossReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingProfitAndLossReport.java new file mode 100644 index 00000000..9eb5ff31 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingProfitAndLossReport.java @@ -0,0 +1,535 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountingProfitAndLossReport - > **Language tip:** Profit and loss statement is also referred to as **income statement** under US GAAP (Generally Accepted Accounting Principles). + * + * > View the coverage for profit and loss in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=profitAndLoss" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * The purpose of a profit and loss report is to present the financial performance of a company over a specified time period. + * + * A profit and loss report shows a company's total income and expenses for a specified period of time and whether a profit or loss has been made. + * + * > **Profit and loss or balance sheet?** + * > Profit and loss reports summarise the total revenue, expenses, and profit or loss over a specified time period. A balance sheet report presents all assets, liability, and equity for a given date. + * + * + * **Structure of this report** + * This report will reflect the structure and line descriptions that the business has set in their own accounting platform. + * + * **History** + * By default, Codat pulls (up to) 24 months of profit and loss history for a company. You can adjust this to fetch more history, where available, by updating the `monthsToSync` value for `profitAndLoss` on the [data type settings endpoint](https://docs.codat.io/lending-api#/operations/post-profile-syncSettings). + * + * **Want to pull this in a standardised structure?** + * Our [Enhanced Financials](https://docs.codat.io/assess/reports/enhanced-financials/financials) endpoints provide the same report under standardized headings, allowing you to pull it in the same format for all of your business customers. + */ + +public class AccountingProfitAndLossReport { + + /** + * Base currency of the company in which the profit and loss report is presented. + */ + @JsonProperty("currency") + private String currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("earliestAvailableMonth") + private Optional earliestAvailableMonth; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("mostRecentAvailableMonth") + private Optional mostRecentAvailableMonth; + + /** + * The basis of a report. + */ + @JsonProperty("reportBasis") + private ReportBasis reportBasis; + + /** + * An array of profit and loss reports. + */ + @JsonProperty("reports") + private java.util.List reports; + + public AccountingProfitAndLossReport( + @JsonProperty("currency") String currency, + @JsonProperty("earliestAvailableMonth") Optional earliestAvailableMonth, + @JsonProperty("mostRecentAvailableMonth") Optional mostRecentAvailableMonth, + @JsonProperty("reportBasis") ReportBasis reportBasis, + @JsonProperty("reports") java.util.List reports) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + Utils.checkNotNull(reportBasis, "reportBasis"); + Utils.checkNotNull(reports, "reports"); + this.currency = currency; + this.earliestAvailableMonth = earliestAvailableMonth; + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + this.reportBasis = reportBasis; + this.reports = reports; + } + + /** + * Base currency of the company in which the profit and loss report is presented. + */ + public String currency() { + return currency; + } + + /** + * 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 Optional earliestAvailableMonth() { + return earliestAvailableMonth; + } + + /** + * 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 Optional mostRecentAvailableMonth() { + return mostRecentAvailableMonth; + } + + /** + * The basis of a report. + */ + public ReportBasis reportBasis() { + return reportBasis; + } + + /** + * An array of profit and loss reports. + */ + public java.util.List reports() { + return reports; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Base currency of the company in which the profit and loss report is presented. + */ + public AccountingProfitAndLossReport withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 AccountingProfitAndLossReport withEarliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 AccountingProfitAndLossReport withEarliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 AccountingProfitAndLossReport withMostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 AccountingProfitAndLossReport withMostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * The basis of a report. + */ + public AccountingProfitAndLossReport withReportBasis(ReportBasis reportBasis) { + Utils.checkNotNull(reportBasis, "reportBasis"); + this.reportBasis = reportBasis; + return this; + } + + /** + * An array of profit and loss reports. + */ + public AccountingProfitAndLossReport withReports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingProfitAndLossReport other = (AccountingProfitAndLossReport) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.earliestAvailableMonth, other.earliestAvailableMonth) && + java.util.Objects.deepEquals(this.mostRecentAvailableMonth, other.mostRecentAvailableMonth) && + java.util.Objects.deepEquals(this.reportBasis, other.reportBasis) && + java.util.Objects.deepEquals(this.reports, other.reports); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reportBasis, + reports); + } + + @Override + public String toString() { + return Utils.toString(AccountingProfitAndLossReport.class, + "currency", currency, + "earliestAvailableMonth", earliestAvailableMonth, + "mostRecentAvailableMonth", mostRecentAvailableMonth, + "reportBasis", reportBasis, + "reports", reports); + } + + public final static class Builder { + + private String currency; + + private Optional earliestAvailableMonth = Optional.empty(); + + private Optional mostRecentAvailableMonth = Optional.empty(); + + private ReportBasis reportBasis; + + private java.util.List reports; + + private Builder() { + // force use of static builder() method + } + + /** + * Base currency of the company in which the profit and loss report is presented. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 earliestAvailableMonth(String earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = Optional.ofNullable(earliestAvailableMonth); + 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 earliestAvailableMonth(Optional earliestAvailableMonth) { + Utils.checkNotNull(earliestAvailableMonth, "earliestAvailableMonth"); + this.earliestAvailableMonth = earliestAvailableMonth; + 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 mostRecentAvailableMonth(String mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = Optional.ofNullable(mostRecentAvailableMonth); + 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 mostRecentAvailableMonth(Optional mostRecentAvailableMonth) { + Utils.checkNotNull(mostRecentAvailableMonth, "mostRecentAvailableMonth"); + this.mostRecentAvailableMonth = mostRecentAvailableMonth; + return this; + } + + /** + * The basis of a report. + */ + public Builder reportBasis(ReportBasis reportBasis) { + Utils.checkNotNull(reportBasis, "reportBasis"); + this.reportBasis = reportBasis; + return this; + } + + /** + * An array of profit and loss reports. + */ + public Builder reports(java.util.List reports) { + Utils.checkNotNull(reports, "reports"); + this.reports = reports; + return this; + } + + public AccountingProfitAndLossReport build() { + return new AccountingProfitAndLossReport( + currency, + earliestAvailableMonth, + mostRecentAvailableMonth, + reportBasis, + reports); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSupplier.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSupplier.java new file mode 100644 index 00000000..1d1d812a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSupplier.java @@ -0,0 +1,830 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingSupplier - > View the coverage for suppliers in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers" target="_blank">Data coverage explorer</a>. + * + * ## Overview + * + * From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/lending-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/lending-api#/schemas/Bill). + */ + +public class AccountingSupplier { + + /** + * An array of Addresses. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private JsonNullable> addresses; + + /** + * Name of the main contact for the supplier. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactName") + private JsonNullable contactName; + + /** + * Default currency the supplier's transactional data is recorded in. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("defaultCurrency") + private JsonNullable defaultCurrency; + + /** + * Email address that the supplier may be contacted on. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emailAddress") + private JsonNullable emailAddress; + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Phone number that the supplier may be contacted on. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone") + private JsonNullable phone; + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("registrationNumber") + private JsonNullable registrationNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the supplier. + */ + @JsonProperty("status") + private SupplierStatus status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierName") + private JsonNullable supplierName; + + /** + * Supplier's company tax number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxNumber") + private JsonNullable taxNumber; + + public AccountingSupplier( + @JsonProperty("addresses") JsonNullable> addresses, + @JsonProperty("contactName") JsonNullable contactName, + @JsonProperty("defaultCurrency") JsonNullable defaultCurrency, + @JsonProperty("emailAddress") JsonNullable emailAddress, + @JsonProperty("id") Optional id, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("phone") JsonNullable phone, + @JsonProperty("registrationNumber") JsonNullable registrationNumber, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") SupplierStatus status, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("supplierName") JsonNullable supplierName, + @JsonProperty("taxNumber") JsonNullable taxNumber) { + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(contactName, "contactName"); + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(phone, "phone"); + Utils.checkNotNull(registrationNumber, "registrationNumber"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(supplierName, "supplierName"); + Utils.checkNotNull(taxNumber, "taxNumber"); + this.addresses = addresses; + this.contactName = contactName; + this.defaultCurrency = defaultCurrency; + this.emailAddress = emailAddress; + this.id = id; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.phone = phone; + this.registrationNumber = registrationNumber; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + this.supplierName = supplierName; + this.taxNumber = taxNumber; + } + + /** + * An array of Addresses. + */ + public JsonNullable> addresses() { + return addresses; + } + + /** + * Name of the main contact for the supplier. + */ + public JsonNullable contactName() { + return contactName; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public JsonNullable defaultCurrency() { + return defaultCurrency; + } + + /** + * Email address that the supplier may be contacted on. + */ + public JsonNullable emailAddress() { + return emailAddress; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public JsonNullable phone() { + return phone; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public JsonNullable registrationNumber() { + return registrationNumber; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the supplier. + */ + public SupplierStatus status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public JsonNullable supplierName() { + return supplierName; + } + + /** + * Supplier's company tax number. + */ + public JsonNullable taxNumber() { + return taxNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array of Addresses. + */ + public AccountingSupplier withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public AccountingSupplier withAddresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public AccountingSupplier withContactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public AccountingSupplier withContactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public AccountingSupplier withDefaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = JsonNullable.of(defaultCurrency); + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public AccountingSupplier withDefaultCurrency(JsonNullable defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public AccountingSupplier withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public AccountingSupplier withEmailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public AccountingSupplier withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public AccountingSupplier withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingSupplier withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingSupplier withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingSupplier withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingSupplier withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public AccountingSupplier withPhone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public AccountingSupplier withPhone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public AccountingSupplier withRegistrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public AccountingSupplier withRegistrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public AccountingSupplier withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingSupplier withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the supplier. + */ + public AccountingSupplier withStatus(SupplierStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingSupplier withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingSupplier withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public AccountingSupplier withSupplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public AccountingSupplier withSupplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + /** + * Supplier's company tax number. + */ + public AccountingSupplier withTaxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Supplier's company tax number. + */ + public AccountingSupplier withTaxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingSupplier other = (AccountingSupplier) o; + return + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.contactName, other.contactName) && + java.util.Objects.deepEquals(this.defaultCurrency, other.defaultCurrency) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.phone, other.phone) && + java.util.Objects.deepEquals(this.registrationNumber, other.registrationNumber) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.supplierName, other.supplierName) && + java.util.Objects.deepEquals(this.taxNumber, other.taxNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + addresses, + contactName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + supplierName, + taxNumber); + } + + @Override + public String toString() { + return Utils.toString(AccountingSupplier.class, + "addresses", addresses, + "contactName", contactName, + "defaultCurrency", defaultCurrency, + "emailAddress", emailAddress, + "id", id, + "metadata", metadata, + "modifiedDate", modifiedDate, + "phone", phone, + "registrationNumber", registrationNumber, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData, + "supplierName", supplierName, + "taxNumber", taxNumber); + } + + public final static class Builder { + + private JsonNullable> addresses = JsonNullable.undefined(); + + private JsonNullable contactName = JsonNullable.undefined(); + + private JsonNullable defaultCurrency = JsonNullable.undefined(); + + private JsonNullable emailAddress = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable phone = JsonNullable.undefined(); + + private JsonNullable registrationNumber = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private SupplierStatus status; + + private Optional supplementalData = Optional.empty(); + + private JsonNullable supplierName = JsonNullable.undefined(); + + private JsonNullable taxNumber = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array of Addresses. + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = JsonNullable.of(addresses); + return this; + } + + /** + * An array of Addresses. + */ + public Builder addresses(JsonNullable> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public Builder contactName(String contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = JsonNullable.of(contactName); + return this; + } + + /** + * Name of the main contact for the supplier. + */ + public Builder contactName(JsonNullable contactName) { + Utils.checkNotNull(contactName, "contactName"); + this.contactName = contactName; + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public Builder defaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = JsonNullable.of(defaultCurrency); + return this; + } + + /** + * Default currency the supplier's transactional data is recorded in. + */ + public Builder defaultCurrency(JsonNullable defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = JsonNullable.of(emailAddress); + return this; + } + + /** + * Email address that the supplier may be contacted on. + */ + public Builder emailAddress(JsonNullable emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the supplier, unique to the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public Builder phone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * Phone number that the supplier may be contacted on. + */ + public Builder phone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public Builder registrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = JsonNullable.of(registrationNumber); + return this; + } + + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + */ + public Builder registrationNumber(JsonNullable registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the supplier. + */ + public Builder status(SupplierStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public Builder supplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + */ + public Builder supplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + /** + * Supplier's company tax number. + */ + public Builder taxNumber(String taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = JsonNullable.of(taxNumber); + return this; + } + + /** + * Supplier's company tax number. + */ + public Builder taxNumber(JsonNullable taxNumber) { + Utils.checkNotNull(taxNumber, "taxNumber"); + this.taxNumber = taxNumber; + return this; + } + + public AccountingSupplier build() { + return new AccountingSupplier( + addresses, + contactName, + defaultCurrency, + emailAddress, + id, + metadata, + modifiedDate, + phone, + registrationNumber, + sourceModifiedDate, + status, + supplementalData, + supplierName, + taxNumber); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSuppliers.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSuppliers.java new file mode 100644 index 00000000..e56c8f0a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingSuppliers.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingSuppliers { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingSuppliers( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingSuppliers withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingSuppliers withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingSuppliers withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingSuppliers withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingSuppliers withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingSuppliers withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingSuppliers other = (AccountingSuppliers) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingSuppliers.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingSuppliers build() { + return new AccountingSuppliers( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfer.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfer.java new file mode 100644 index 00000000..1c7dbde3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfer.java @@ -0,0 +1,837 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingTransfer - > View the coverage for transfers in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=transfers" target="_blank">Data coverage explorer</a>. + * + * A transfer records the movement of money between two bank accounts, or between a bank account and a nominal account. It is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction). + */ + +public class AccountingTransfer { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("depositedRecordRefs") + private JsonNullable> depositedRecordRefs; + + /** + * Description of the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Account details of the account sending or receiving the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("from") + private Optional from; + + /** + * Unique identifier for the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional metadata; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Account details of the account sending or receiving the transfer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("to") + private Optional to; + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + private JsonNullable> trackingCategoryRefs; + + public AccountingTransfer( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("date") Optional date, + @JsonProperty("depositedRecordRefs") JsonNullable> depositedRecordRefs, + @JsonProperty("description") JsonNullable description, + @JsonProperty("from") Optional from, + @JsonProperty("id") Optional id, + @JsonProperty("metadata") Optional metadata, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("to") Optional to, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(from, "from"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(metadata, "metadata"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(to, "to"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.contactRef = contactRef; + this.date = date; + this.depositedRecordRefs = depositedRecordRefs; + this.description = description; + this.from = from; + this.id = id; + this.metadata = metadata; + this.modifiedDate = modifiedDate; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.to = to; + this.trackingCategoryRefs = trackingCategoryRefs; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public JsonNullable> depositedRecordRefs() { + return depositedRecordRefs; + } + + /** + * Description of the transfer. + */ + public JsonNullable description() { + return description; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Optional from() { + return from; + } + + /** + * Unique identifier for the transfer. + */ + public Optional id() { + return id; + } + + public Optional metadata() { + return metadata; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Optional to() { + return to; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingTransfer withContactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public AccountingTransfer withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + 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 AccountingTransfer 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 AccountingTransfer withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public AccountingTransfer withDepositedRecordRefs(java.util.List depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = JsonNullable.of(depositedRecordRefs); + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public AccountingTransfer withDepositedRecordRefs(JsonNullable> depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = depositedRecordRefs; + return this; + } + + /** + * Description of the transfer. + */ + public AccountingTransfer withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the transfer. + */ + public AccountingTransfer withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingTransfer withFrom(TransferAccount from) { + Utils.checkNotNull(from, "from"); + this.from = Optional.ofNullable(from); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingTransfer withFrom(Optional from) { + Utils.checkNotNull(from, "from"); + this.from = from; + return this; + } + + /** + * Unique identifier for the transfer. + */ + public AccountingTransfer withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the transfer. + */ + public AccountingTransfer withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public AccountingTransfer withMetadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public AccountingTransfer withMetadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public AccountingTransfer withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public AccountingTransfer withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public AccountingTransfer withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public AccountingTransfer withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingTransfer withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public AccountingTransfer withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingTransfer withTo(TransferAccount to) { + Utils.checkNotNull(to, "to"); + this.to = Optional.ofNullable(to); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public AccountingTransfer withTo(Optional to) { + Utils.checkNotNull(to, "to"); + this.to = to; + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public AccountingTransfer withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public AccountingTransfer withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingTransfer other = (AccountingTransfer) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.depositedRecordRefs, other.depositedRecordRefs) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.from, other.from) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.metadata, other.metadata) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.to, other.to) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + date, + depositedRecordRefs, + description, + from, + id, + metadata, + modifiedDate, + sourceModifiedDate, + supplementalData, + to, + trackingCategoryRefs); + } + + @Override + public String toString() { + return Utils.toString(AccountingTransfer.class, + "contactRef", contactRef, + "date", date, + "depositedRecordRefs", depositedRecordRefs, + "description", description, + "from", from, + "id", id, + "metadata", metadata, + "modifiedDate", modifiedDate, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "to", to, + "trackingCategoryRefs", trackingCategoryRefs); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private Optional date = Optional.empty(); + + private JsonNullable> depositedRecordRefs = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private Optional from = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional metadata = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional to = Optional.empty(); + + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(ContactRef contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + 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(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; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public Builder depositedRecordRefs(java.util.List depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = JsonNullable.of(depositedRecordRefs); + return this; + } + + /** + * List of selected transactions to associate with the transfer. Use this field to include transactions which are posted to the _undeposited funds_ (or other holding) account within the transfer. + */ + public Builder depositedRecordRefs(JsonNullable> depositedRecordRefs) { + Utils.checkNotNull(depositedRecordRefs, "depositedRecordRefs"); + this.depositedRecordRefs = depositedRecordRefs; + return this; + } + + /** + * Description of the transfer. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the transfer. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder from(TransferAccount from) { + Utils.checkNotNull(from, "from"); + this.from = Optional.ofNullable(from); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder from(Optional from) { + Utils.checkNotNull(from, "from"); + this.from = from; + return this; + } + + /** + * Unique identifier for the transfer. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the transfer. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder metadata(Metadata metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder to(TransferAccount to) { + Utils.checkNotNull(to, "to"); + this.to = Optional.ofNullable(to); + return this; + } + + /** + * Account details of the account sending or receiving the transfer. + */ + public Builder to(Optional to) { + Utils.checkNotNull(to, "to"); + this.to = to; + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories this transfer is being tracked against. + */ + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + public AccountingTransfer build() { + return new AccountingTransfer( + contactRef, + date, + depositedRecordRefs, + description, + from, + id, + metadata, + modifiedDate, + sourceModifiedDate, + supplementalData, + to, + trackingCategoryRefs); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfers.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfers.java new file mode 100644 index 00000000..faedc7a6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountingTransfers.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AccountingTransfers { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public AccountingTransfers( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountingTransfers withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public AccountingTransfers withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public AccountingTransfers withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public AccountingTransfers withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public AccountingTransfers withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public AccountingTransfers withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingTransfers other = (AccountingTransfers) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(AccountingTransfers.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public AccountingTransfers build() { + return new AccountingTransfers( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Accounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Accounts.java new file mode 100644 index 00000000..bfdfd32b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Accounts.java @@ -0,0 +1,506 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Accounts { + + /** + * The name of the account according to the provider. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountName") + private Optional accountName; + + /** + * The bank or other financial institution providing the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountProvider") + private Optional accountProvider; + + /** + * The type of banking account, e.g. credit or debit. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountType") + private Optional accountType; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * The balance of the bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currentBalance") + private Optional currentBalance; + + /** + * Name of the banking data source, e.g. "Plaid". + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("platformName") + private Optional platformName; + + /** + * A source reference containing the `sourceType` object "Banking". + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceRef") + private Optional sourceRef; + + public Accounts( + @JsonProperty("accountName") Optional accountName, + @JsonProperty("accountProvider") Optional accountProvider, + @JsonProperty("accountType") Optional accountType, + @JsonProperty("currency") Optional currency, + @JsonProperty("currentBalance") Optional currentBalance, + @JsonProperty("platformName") Optional platformName, + @JsonProperty("sourceRef") Optional sourceRef) { + Utils.checkNotNull(accountName, "accountName"); + Utils.checkNotNull(accountProvider, "accountProvider"); + Utils.checkNotNull(accountType, "accountType"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currentBalance, "currentBalance"); + Utils.checkNotNull(platformName, "platformName"); + Utils.checkNotNull(sourceRef, "sourceRef"); + this.accountName = accountName; + this.accountProvider = accountProvider; + this.accountType = accountType; + this.currency = currency; + this.currentBalance = currentBalance; + this.platformName = platformName; + this.sourceRef = sourceRef; + } + + /** + * The name of the account according to the provider. + */ + public Optional accountName() { + return accountName; + } + + /** + * The bank or other financial institution providing the account. + */ + public Optional accountProvider() { + return accountProvider; + } + + /** + * The type of banking account, e.g. credit or debit. + */ + public Optional accountType() { + return accountType; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * The balance of the bank account. + */ + public Optional currentBalance() { + return currentBalance; + } + + /** + * Name of the banking data source, e.g. "Plaid". + */ + public Optional platformName() { + return platformName; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Optional sourceRef() { + return sourceRef; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name of the account according to the provider. + */ + public Accounts withAccountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * The name of the account according to the provider. + */ + public Accounts withAccountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public Accounts withAccountProvider(String accountProvider) { + Utils.checkNotNull(accountProvider, "accountProvider"); + this.accountProvider = Optional.ofNullable(accountProvider); + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public Accounts withAccountProvider(Optional accountProvider) { + Utils.checkNotNull(accountProvider, "accountProvider"); + this.accountProvider = accountProvider; + return this; + } + + /** + * The type of banking account, e.g. credit or debit. + */ + public Accounts withAccountType(String accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of banking account, e.g. credit or debit. + */ + public Accounts withAccountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Accounts withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Accounts withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The balance of the bank account. + */ + public Accounts withCurrentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = Optional.ofNullable(currentBalance); + return this; + } + + /** + * The balance of the bank account. + */ + public Accounts withCurrentBalance(Optional currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Name of the banking data source, e.g. "Plaid". + */ + public Accounts withPlatformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = Optional.ofNullable(platformName); + return this; + } + + /** + * Name of the banking data source, e.g. "Plaid". + */ + public Accounts withPlatformName(Optional platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Accounts withSourceRef(SourceRef sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = Optional.ofNullable(sourceRef); + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Accounts withSourceRef(Optional sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = sourceRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Accounts other = (Accounts) o; + return + java.util.Objects.deepEquals(this.accountName, other.accountName) && + java.util.Objects.deepEquals(this.accountProvider, other.accountProvider) && + java.util.Objects.deepEquals(this.accountType, other.accountType) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currentBalance, other.currentBalance) && + java.util.Objects.deepEquals(this.platformName, other.platformName) && + java.util.Objects.deepEquals(this.sourceRef, other.sourceRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountName, + accountProvider, + accountType, + currency, + currentBalance, + platformName, + sourceRef); + } + + @Override + public String toString() { + return Utils.toString(Accounts.class, + "accountName", accountName, + "accountProvider", accountProvider, + "accountType", accountType, + "currency", currency, + "currentBalance", currentBalance, + "platformName", platformName, + "sourceRef", sourceRef); + } + + public final static class Builder { + + private Optional accountName = Optional.empty(); + + private Optional accountProvider = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional currentBalance = Optional.empty(); + + private Optional platformName = Optional.empty(); + + private Optional sourceRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name of the account according to the provider. + */ + public Builder accountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * The name of the account according to the provider. + */ + public Builder accountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public Builder accountProvider(String accountProvider) { + Utils.checkNotNull(accountProvider, "accountProvider"); + this.accountProvider = Optional.ofNullable(accountProvider); + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public Builder accountProvider(Optional accountProvider) { + Utils.checkNotNull(accountProvider, "accountProvider"); + this.accountProvider = accountProvider; + return this; + } + + /** + * The type of banking account, e.g. credit or debit. + */ + public Builder accountType(String accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + * The type of banking account, e.g. credit or debit. + */ + public Builder accountType(Optional accountType) { + Utils.checkNotNull(accountType, "accountType"); + this.accountType = accountType; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The balance of the bank account. + */ + public Builder currentBalance(double currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = Optional.ofNullable(currentBalance); + return this; + } + + /** + * The balance of the bank account. + */ + public Builder currentBalance(Optional currentBalance) { + Utils.checkNotNull(currentBalance, "currentBalance"); + this.currentBalance = currentBalance; + return this; + } + + /** + * Name of the banking data source, e.g. "Plaid". + */ + public Builder platformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = Optional.ofNullable(platformName); + return this; + } + + /** + * Name of the banking data source, e.g. "Plaid". + */ + public Builder platformName(Optional platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Builder sourceRef(SourceRef sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = Optional.ofNullable(sourceRef); + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Builder sourceRef(Optional sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = sourceRef; + return this; + } + + public Accounts build() { + return new Accounts( + accountName, + accountProvider, + accountType, + currency, + currentBalance, + platformName, + sourceRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsPayableTracking.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsPayableTracking.java new file mode 100644 index 00000000..bff2434d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsPayableTracking.java @@ -0,0 +1,250 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountsPayableTracking - Categories, and a project and customer, against which the item is tracked. + */ + +public class AccountsPayableTracking { + + @JsonProperty("categoryRefs") + private java.util.List categoryRefs; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + @JsonProperty("isBilledTo") + private BilledToType isBilledTo; + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + @JsonProperty("isRebilledTo") + private BilledToType isRebilledTo; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("projectRef") + private Optional projectRef; + + public AccountsPayableTracking( + @JsonProperty("categoryRefs") java.util.List categoryRefs, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("isBilledTo") BilledToType isBilledTo, + @JsonProperty("isRebilledTo") BilledToType isRebilledTo, + @JsonProperty("projectRef") Optional projectRef) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(isBilledTo, "isBilledTo"); + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + Utils.checkNotNull(projectRef, "projectRef"); + this.categoryRefs = categoryRefs; + this.customerRef = customerRef; + this.isBilledTo = isBilledTo; + this.isRebilledTo = isRebilledTo; + this.projectRef = projectRef; + } + + public java.util.List categoryRefs() { + return categoryRefs; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public BilledToType isBilledTo() { + return isBilledTo; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public BilledToType isRebilledTo() { + return isRebilledTo; + } + + public Optional projectRef() { + return projectRef; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountsPayableTracking withCategoryRefs(java.util.List categoryRefs) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + this.categoryRefs = categoryRefs; + return this; + } + + public AccountsPayableTracking withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountsPayableTracking withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public AccountsPayableTracking withIsBilledTo(BilledToType isBilledTo) { + Utils.checkNotNull(isBilledTo, "isBilledTo"); + this.isBilledTo = isBilledTo; + return this; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public AccountsPayableTracking withIsRebilledTo(BilledToType isRebilledTo) { + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + this.isRebilledTo = isRebilledTo; + return this; + } + + public AccountsPayableTracking withProjectRef(ProjectRef projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = Optional.ofNullable(projectRef); + return this; + } + + public AccountsPayableTracking withProjectRef(Optional projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = projectRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountsPayableTracking other = (AccountsPayableTracking) o; + return + java.util.Objects.deepEquals(this.categoryRefs, other.categoryRefs) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.isBilledTo, other.isBilledTo) && + java.util.Objects.deepEquals(this.isRebilledTo, other.isRebilledTo) && + java.util.Objects.deepEquals(this.projectRef, other.projectRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + categoryRefs, + customerRef, + isBilledTo, + isRebilledTo, + projectRef); + } + + @Override + public String toString() { + return Utils.toString(AccountsPayableTracking.class, + "categoryRefs", categoryRefs, + "customerRef", customerRef, + "isBilledTo", isBilledTo, + "isRebilledTo", isRebilledTo, + "projectRef", projectRef); + } + + public final static class Builder { + + private java.util.List categoryRefs; + + private Optional customerRef = Optional.empty(); + + private BilledToType isBilledTo; + + private BilledToType isRebilledTo; + + private Optional projectRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder categoryRefs(java.util.List categoryRefs) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + this.categoryRefs = categoryRefs; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public Builder isBilledTo(BilledToType isBilledTo) { + Utils.checkNotNull(isBilledTo, "isBilledTo"); + this.isBilledTo = isBilledTo; + return this; + } + + /** + * Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ + public Builder isRebilledTo(BilledToType isRebilledTo) { + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + this.isRebilledTo = isRebilledTo; + return this; + } + + public Builder projectRef(ProjectRef projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = Optional.ofNullable(projectRef); + return this; + } + + public Builder projectRef(Optional projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = projectRef; + return this; + } + + public AccountsPayableTracking build() { + return new AccountsPayableTracking( + categoryRefs, + customerRef, + isBilledTo, + isRebilledTo, + projectRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsReceivableTracking.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsReceivableTracking.java new file mode 100644 index 00000000..9880b121 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AccountsReceivableTracking.java @@ -0,0 +1,321 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * AccountsReceivableTracking - Categories, and a project and customer, against which the item is tracked. + */ + +public class AccountsReceivableTracking { + + @JsonProperty("categoryRefs") + private java.util.List categoryRefs; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + @JsonProperty("isBilledTo") + private BilledToType1 isBilledTo; + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + @JsonProperty("isRebilledTo") + private BilledToType1 isRebilledTo; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("projectRef") + private Optional projectRef; + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRef") + private Optional recordRef; + + public AccountsReceivableTracking( + @JsonProperty("categoryRefs") java.util.List categoryRefs, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("isBilledTo") BilledToType1 isBilledTo, + @JsonProperty("isRebilledTo") BilledToType1 isRebilledTo, + @JsonProperty("projectRef") Optional projectRef, + @JsonProperty("recordRef") Optional recordRef) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(isBilledTo, "isBilledTo"); + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + Utils.checkNotNull(projectRef, "projectRef"); + Utils.checkNotNull(recordRef, "recordRef"); + this.categoryRefs = categoryRefs; + this.customerRef = customerRef; + this.isBilledTo = isBilledTo; + this.isRebilledTo = isRebilledTo; + this.projectRef = projectRef; + this.recordRef = recordRef; + } + + public java.util.List categoryRefs() { + return categoryRefs; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public BilledToType1 isBilledTo() { + return isBilledTo; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public BilledToType1 isRebilledTo() { + return isRebilledTo; + } + + public Optional projectRef() { + return projectRef; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Optional recordRef() { + return recordRef; + } + + public final static Builder builder() { + return new Builder(); + } + + public AccountsReceivableTracking withCategoryRefs(java.util.List categoryRefs) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + this.categoryRefs = categoryRefs; + return this; + } + + public AccountsReceivableTracking withCustomerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public AccountsReceivableTracking withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public AccountsReceivableTracking withIsBilledTo(BilledToType1 isBilledTo) { + Utils.checkNotNull(isBilledTo, "isBilledTo"); + this.isBilledTo = isBilledTo; + return this; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public AccountsReceivableTracking withIsRebilledTo(BilledToType1 isRebilledTo) { + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + this.isRebilledTo = isRebilledTo; + return this; + } + + public AccountsReceivableTracking withProjectRef(ProjectRef projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = Optional.ofNullable(projectRef); + return this; + } + + public AccountsReceivableTracking withProjectRef(Optional projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = projectRef; + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public AccountsReceivableTracking withRecordRef(RecordReference recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public AccountsReceivableTracking withRecordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountsReceivableTracking other = (AccountsReceivableTracking) o; + return + java.util.Objects.deepEquals(this.categoryRefs, other.categoryRefs) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.isBilledTo, other.isBilledTo) && + java.util.Objects.deepEquals(this.isRebilledTo, other.isRebilledTo) && + java.util.Objects.deepEquals(this.projectRef, other.projectRef) && + java.util.Objects.deepEquals(this.recordRef, other.recordRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + categoryRefs, + customerRef, + isBilledTo, + isRebilledTo, + projectRef, + recordRef); + } + + @Override + public String toString() { + return Utils.toString(AccountsReceivableTracking.class, + "categoryRefs", categoryRefs, + "customerRef", customerRef, + "isBilledTo", isBilledTo, + "isRebilledTo", isRebilledTo, + "projectRef", projectRef, + "recordRef", recordRef); + } + + public final static class Builder { + + private java.util.List categoryRefs; + + private Optional customerRef = Optional.empty(); + + private BilledToType1 isBilledTo; + + private BilledToType1 isRebilledTo; + + private Optional projectRef = Optional.empty(); + + private Optional recordRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder categoryRefs(java.util.List categoryRefs) { + Utils.checkNotNull(categoryRefs, "categoryRefs"); + this.categoryRefs = categoryRefs; + return this; + } + + public Builder customerRef(AccountingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public Builder isBilledTo(BilledToType1 isBilledTo) { + Utils.checkNotNull(isBilledTo, "isBilledTo"); + this.isBilledTo = isBilledTo; + return this; + } + + /** + * Defines if the bill or bill credit note is billed/rebilled to a project. + */ + public Builder isRebilledTo(BilledToType1 isRebilledTo) { + Utils.checkNotNull(isRebilledTo, "isRebilledTo"); + this.isRebilledTo = isRebilledTo; + return this; + } + + public Builder projectRef(ProjectRef projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = Optional.ofNullable(projectRef); + return this; + } + + public Builder projectRef(Optional projectRef) { + Utils.checkNotNull(projectRef, "projectRef"); + this.projectRef = projectRef; + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Builder recordRef(RecordReference recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Builder recordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + public AccountsReceivableTracking build() { + return new AccountsReceivableTracking( + categoryRefs, + customerRef, + isBilledTo, + isRebilledTo, + projectRef, + recordRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCreditor.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCreditor.java new file mode 100644 index 00000000..2ad01fdb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCreditor.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AgedCreditor { + + /** + * Array of aged creditors by currency. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("agedCurrencyOutstanding") + private Optional> agedCurrencyOutstanding; + + /** + * Supplier ID of the aged creditor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierId") + private Optional supplierId; + + /** + * Supplier name of the aged creditor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierName") + private Optional supplierName; + + public AgedCreditor( + @JsonProperty("agedCurrencyOutstanding") Optional> agedCurrencyOutstanding, + @JsonProperty("supplierId") Optional supplierId, + @JsonProperty("supplierName") Optional supplierName) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + Utils.checkNotNull(supplierId, "supplierId"); + Utils.checkNotNull(supplierName, "supplierName"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + this.supplierId = supplierId; + this.supplierName = supplierName; + } + + /** + * Array of aged creditors by currency. + */ + public Optional> agedCurrencyOutstanding() { + return agedCurrencyOutstanding; + } + + /** + * Supplier ID of the aged creditor. + */ + public Optional supplierId() { + return supplierId; + } + + /** + * Supplier name of the aged creditor. + */ + public Optional supplierName() { + return supplierName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Array of aged creditors by currency. + */ + public AgedCreditor withAgedCurrencyOutstanding(java.util.List agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = Optional.ofNullable(agedCurrencyOutstanding); + return this; + } + + /** + * Array of aged creditors by currency. + */ + public AgedCreditor withAgedCurrencyOutstanding(Optional> agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + return this; + } + + /** + * Supplier ID of the aged creditor. + */ + public AgedCreditor withSupplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = Optional.ofNullable(supplierId); + return this; + } + + /** + * Supplier ID of the aged creditor. + */ + public AgedCreditor withSupplierId(Optional supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + /** + * Supplier name of the aged creditor. + */ + public AgedCreditor withSupplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = Optional.ofNullable(supplierName); + return this; + } + + /** + * Supplier name of the aged creditor. + */ + public AgedCreditor withSupplierName(Optional supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgedCreditor other = (AgedCreditor) o; + return + java.util.Objects.deepEquals(this.agedCurrencyOutstanding, other.agedCurrencyOutstanding) && + java.util.Objects.deepEquals(this.supplierId, other.supplierId) && + java.util.Objects.deepEquals(this.supplierName, other.supplierName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + agedCurrencyOutstanding, + supplierId, + supplierName); + } + + @Override + public String toString() { + return Utils.toString(AgedCreditor.class, + "agedCurrencyOutstanding", agedCurrencyOutstanding, + "supplierId", supplierId, + "supplierName", supplierName); + } + + public final static class Builder { + + private Optional> agedCurrencyOutstanding = Optional.empty(); + + private Optional supplierId = Optional.empty(); + + private Optional supplierName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Array of aged creditors by currency. + */ + public Builder agedCurrencyOutstanding(java.util.List agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = Optional.ofNullable(agedCurrencyOutstanding); + return this; + } + + /** + * Array of aged creditors by currency. + */ + public Builder agedCurrencyOutstanding(Optional> agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + return this; + } + + /** + * Supplier ID of the aged creditor. + */ + public Builder supplierId(String supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = Optional.ofNullable(supplierId); + return this; + } + + /** + * Supplier ID of the aged creditor. + */ + public Builder supplierId(Optional supplierId) { + Utils.checkNotNull(supplierId, "supplierId"); + this.supplierId = supplierId; + return this; + } + + /** + * Supplier name of the aged creditor. + */ + public Builder supplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = Optional.ofNullable(supplierName); + return this; + } + + /** + * Supplier name of the aged creditor. + */ + public Builder supplierName(Optional supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + public AgedCreditor build() { + return new AgedCreditor( + agedCurrencyOutstanding, + supplierId, + supplierName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCurrencyOutstanding.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCurrencyOutstanding.java new file mode 100644 index 00000000..4bd5a4e7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedCurrencyOutstanding.java @@ -0,0 +1,211 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AgedCurrencyOutstanding { + + /** + * Array of outstanding amounts by period. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("agedOutstandingAmounts") + private Optional> agedOutstandingAmounts; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + public AgedCurrencyOutstanding( + @JsonProperty("agedOutstandingAmounts") Optional> agedOutstandingAmounts, + @JsonProperty("currency") Optional currency) { + Utils.checkNotNull(agedOutstandingAmounts, "agedOutstandingAmounts"); + Utils.checkNotNull(currency, "currency"); + this.agedOutstandingAmounts = agedOutstandingAmounts; + this.currency = currency; + } + + /** + * Array of outstanding amounts by period. + */ + public Optional> agedOutstandingAmounts() { + return agedOutstandingAmounts; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Array of outstanding amounts by period. + */ + public AgedCurrencyOutstanding withAgedOutstandingAmounts(java.util.List agedOutstandingAmounts) { + Utils.checkNotNull(agedOutstandingAmounts, "agedOutstandingAmounts"); + this.agedOutstandingAmounts = Optional.ofNullable(agedOutstandingAmounts); + return this; + } + + /** + * Array of outstanding amounts by period. + */ + public AgedCurrencyOutstanding withAgedOutstandingAmounts(Optional> agedOutstandingAmounts) { + Utils.checkNotNull(agedOutstandingAmounts, "agedOutstandingAmounts"); + this.agedOutstandingAmounts = agedOutstandingAmounts; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AgedCurrencyOutstanding withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public AgedCurrencyOutstanding withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgedCurrencyOutstanding other = (AgedCurrencyOutstanding) o; + return + java.util.Objects.deepEquals(this.agedOutstandingAmounts, other.agedOutstandingAmounts) && + java.util.Objects.deepEquals(this.currency, other.currency); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + agedOutstandingAmounts, + currency); + } + + @Override + public String toString() { + return Utils.toString(AgedCurrencyOutstanding.class, + "agedOutstandingAmounts", agedOutstandingAmounts, + "currency", currency); + } + + public final static class Builder { + + private Optional> agedOutstandingAmounts = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Array of outstanding amounts by period. + */ + public Builder agedOutstandingAmounts(java.util.List agedOutstandingAmounts) { + Utils.checkNotNull(agedOutstandingAmounts, "agedOutstandingAmounts"); + this.agedOutstandingAmounts = Optional.ofNullable(agedOutstandingAmounts); + return this; + } + + /** + * Array of outstanding amounts by period. + */ + public Builder agedOutstandingAmounts(Optional> agedOutstandingAmounts) { + Utils.checkNotNull(agedOutstandingAmounts, "agedOutstandingAmounts"); + this.agedOutstandingAmounts = agedOutstandingAmounts; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public AgedCurrencyOutstanding build() { + return new AgedCurrencyOutstanding( + agedOutstandingAmounts, + currency); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AgedDebtor.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedDebtor.java new file mode 100644 index 00000000..8be6ef04 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedDebtor.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AgedDebtor { + + /** + * Array of aged debtors by currency. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("agedCurrencyOutstanding") + private Optional> agedCurrencyOutstanding; + + /** + * Customer ID of the aged debtor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerId") + private Optional customerId; + + /** + * Customer name of the aged debtor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerName") + private Optional customerName; + + public AgedDebtor( + @JsonProperty("agedCurrencyOutstanding") Optional> agedCurrencyOutstanding, + @JsonProperty("customerId") Optional customerId, + @JsonProperty("customerName") Optional customerName) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + Utils.checkNotNull(customerId, "customerId"); + Utils.checkNotNull(customerName, "customerName"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + this.customerId = customerId; + this.customerName = customerName; + } + + /** + * Array of aged debtors by currency. + */ + public Optional> agedCurrencyOutstanding() { + return agedCurrencyOutstanding; + } + + /** + * Customer ID of the aged debtor. + */ + public Optional customerId() { + return customerId; + } + + /** + * Customer name of the aged debtor. + */ + public Optional customerName() { + return customerName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Array of aged debtors by currency. + */ + public AgedDebtor withAgedCurrencyOutstanding(java.util.List agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = Optional.ofNullable(agedCurrencyOutstanding); + return this; + } + + /** + * Array of aged debtors by currency. + */ + public AgedDebtor withAgedCurrencyOutstanding(Optional> agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + return this; + } + + /** + * Customer ID of the aged debtor. + */ + public AgedDebtor withCustomerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = Optional.ofNullable(customerId); + return this; + } + + /** + * Customer ID of the aged debtor. + */ + public AgedDebtor withCustomerId(Optional customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + /** + * Customer name of the aged debtor. + */ + public AgedDebtor withCustomerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = Optional.ofNullable(customerName); + return this; + } + + /** + * Customer name of the aged debtor. + */ + public AgedDebtor withCustomerName(Optional customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgedDebtor other = (AgedDebtor) o; + return + java.util.Objects.deepEquals(this.agedCurrencyOutstanding, other.agedCurrencyOutstanding) && + java.util.Objects.deepEquals(this.customerId, other.customerId) && + java.util.Objects.deepEquals(this.customerName, other.customerName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + agedCurrencyOutstanding, + customerId, + customerName); + } + + @Override + public String toString() { + return Utils.toString(AgedDebtor.class, + "agedCurrencyOutstanding", agedCurrencyOutstanding, + "customerId", customerId, + "customerName", customerName); + } + + public final static class Builder { + + private Optional> agedCurrencyOutstanding = Optional.empty(); + + private Optional customerId = Optional.empty(); + + private Optional customerName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Array of aged debtors by currency. + */ + public Builder agedCurrencyOutstanding(java.util.List agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = Optional.ofNullable(agedCurrencyOutstanding); + return this; + } + + /** + * Array of aged debtors by currency. + */ + public Builder agedCurrencyOutstanding(Optional> agedCurrencyOutstanding) { + Utils.checkNotNull(agedCurrencyOutstanding, "agedCurrencyOutstanding"); + this.agedCurrencyOutstanding = agedCurrencyOutstanding; + return this; + } + + /** + * Customer ID of the aged debtor. + */ + public Builder customerId(String customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = Optional.ofNullable(customerId); + return this; + } + + /** + * Customer ID of the aged debtor. + */ + public Builder customerId(Optional customerId) { + Utils.checkNotNull(customerId, "customerId"); + this.customerId = customerId; + return this; + } + + /** + * Customer name of the aged debtor. + */ + public Builder customerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = Optional.ofNullable(customerName); + return this; + } + + /** + * Customer name of the aged debtor. + */ + public Builder customerName(Optional customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + public AgedDebtor build() { + return new AgedDebtor( + agedCurrencyOutstanding, + customerId, + customerName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmount.java new file mode 100644 index 00000000..440b0d7d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmount.java @@ -0,0 +1,509 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AgedOutstandingAmount { + + /** + * The amount outstanding. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * Array of details. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("details") + private Optional> details; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fromDate") + private Optional fromDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("toDate") + private Optional toDate; + + public AgedOutstandingAmount( + @JsonProperty("amount") Optional amount, + @JsonProperty("details") Optional> details, + @JsonProperty("fromDate") Optional fromDate, + @JsonProperty("toDate") Optional toDate) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(details, "details"); + Utils.checkNotNull(fromDate, "fromDate"); + Utils.checkNotNull(toDate, "toDate"); + this.amount = amount; + this.details = details; + this.fromDate = fromDate; + this.toDate = toDate; + } + + /** + * The amount outstanding. + */ + public Optional amount() { + return amount; + } + + /** + * Array of details. + */ + public Optional> details() { + return details; + } + + /** + * 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 Optional fromDate() { + return fromDate; + } + + /** + * 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 Optional toDate() { + return toDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The amount outstanding. + */ + public AgedOutstandingAmount withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount outstanding. + */ + public AgedOutstandingAmount withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Array of details. + */ + public AgedOutstandingAmount withDetails(java.util.List details) { + Utils.checkNotNull(details, "details"); + this.details = Optional.ofNullable(details); + return this; + } + + /** + * Array of details. + */ + public AgedOutstandingAmount withDetails(Optional> details) { + Utils.checkNotNull(details, "details"); + this.details = details; + 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 AgedOutstandingAmount withFromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 AgedOutstandingAmount withFromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + 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 AgedOutstandingAmount withToDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 AgedOutstandingAmount withToDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgedOutstandingAmount other = (AgedOutstandingAmount) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.details, other.details) && + java.util.Objects.deepEquals(this.fromDate, other.fromDate) && + java.util.Objects.deepEquals(this.toDate, other.toDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + details, + fromDate, + toDate); + } + + @Override + public String toString() { + return Utils.toString(AgedOutstandingAmount.class, + "amount", amount, + "details", details, + "fromDate", fromDate, + "toDate", toDate); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional> details = Optional.empty(); + + private Optional fromDate = Optional.empty(); + + private Optional toDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The amount outstanding. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount outstanding. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Array of details. + */ + public Builder details(java.util.List details) { + Utils.checkNotNull(details, "details"); + this.details = Optional.ofNullable(details); + return this; + } + + /** + * Array of details. + */ + public Builder details(Optional> details) { + Utils.checkNotNull(details, "details"); + this.details = details; + 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 fromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 fromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + 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 toDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 toDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + public AgedOutstandingAmount build() { + return new AgedOutstandingAmount( + amount, + details, + fromDate, + toDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmountDetail.java b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmountDetail.java new file mode 100644 index 00000000..76fd5d54 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/AgedOutstandingAmountDetail.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class AgedOutstandingAmountDetail { + + /** + * The amount outstanding. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * Name of data type with outstanding amount for given period. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public AgedOutstandingAmountDetail( + @JsonProperty("amount") Optional amount, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(name, "name"); + this.amount = amount; + this.name = name; + } + + /** + * The amount outstanding. + */ + public Optional amount() { + return amount; + } + + /** + * Name of data type with outstanding amount for given period. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The amount outstanding. + */ + public AgedOutstandingAmountDetail withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount outstanding. + */ + public AgedOutstandingAmountDetail withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name of data type with outstanding amount for given period. + */ + public AgedOutstandingAmountDetail withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of data type with outstanding amount for given period. + */ + public AgedOutstandingAmountDetail withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgedOutstandingAmountDetail other = (AgedOutstandingAmountDetail) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + name); + } + + @Override + public String toString() { + return Utils.toString(AgedOutstandingAmountDetail.class, + "amount", amount, + "name", name); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The amount outstanding. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount outstanding. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name of data type with outstanding amount for given period. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of data type with outstanding amount for given period. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AgedOutstandingAmountDetail build() { + return new AgedOutstandingAmountDetail( + amount, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Allocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Allocation.java new file mode 100644 index 00000000..f7228e93 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Allocation.java @@ -0,0 +1,624 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class Allocation { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allocatedOnDate") + private Optional allocatedOnDate; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * The total amount that has been allocated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public Allocation( + @JsonProperty("allocatedOnDate") Optional allocatedOnDate, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.allocatedOnDate = allocatedOnDate; + this.currency = currency; + this.currencyRate = currencyRate; + this.totalAmount = totalAmount; + } + + /** + * 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 Optional allocatedOnDate() { + return allocatedOnDate; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * The total amount that has been allocated. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 Allocation withAllocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 Allocation withAllocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Allocation withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Allocation withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Allocation withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Allocation withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * The total amount that has been allocated. + */ + public Allocation withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * The total amount that has been allocated. + */ + public Allocation withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Allocation other = (Allocation) o; + return + java.util.Objects.deepEquals(this.allocatedOnDate, other.allocatedOnDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allocatedOnDate, + currency, + currencyRate, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(Allocation.class, + "allocatedOnDate", allocatedOnDate, + "currency", currency, + "currencyRate", currencyRate, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional allocatedOnDate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 allocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 allocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * The total amount that has been allocated. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * The total amount that has been allocated. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public Allocation build() { + return new Allocation( + allocatedOnDate, + currency, + currencyRate, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Attachments.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Attachments.java new file mode 100644 index 00000000..b8d5636b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Attachments.java @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class Attachments { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attachments") + private JsonNullable> attachments; + + public Attachments( + @JsonProperty("attachments") JsonNullable> attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + } + + public JsonNullable> attachments() { + return attachments; + } + + public final static Builder builder() { + return new Builder(); + } + + public Attachments withAttachments(java.util.List attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = JsonNullable.of(attachments); + return this; + } + + public Attachments withAttachments(JsonNullable> attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attachments other = (Attachments) o; + return + java.util.Objects.deepEquals(this.attachments, other.attachments); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachments); + } + + @Override + public String toString() { + return Utils.toString(Attachments.class, + "attachments", attachments); + } + + public final static class Builder { + + private JsonNullable> attachments = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder attachments(java.util.List attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = JsonNullable.of(attachments); + return this; + } + + public Builder attachments(JsonNullable> attachments) { + Utils.checkNotNull(attachments, "attachments"); + this.attachments = attachments; + return this; + } + + public Attachments build() { + return new Attachments( + attachments); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BalanceSheet.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BalanceSheet.java new file mode 100644 index 00000000..064193b9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BalanceSheet.java @@ -0,0 +1,387 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BalanceSheet { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("assets") + private Optional assets; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("equity") + private Optional equity; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("liabilities") + private Optional liabilities; + + /** + * Value of net assets for a company in their base currency. + */ + @JsonProperty("netAssets") + private double netAssets; + + public BalanceSheet( + @JsonProperty("assets") Optional assets, + @JsonProperty("date") Optional date, + @JsonProperty("equity") Optional equity, + @JsonProperty("liabilities") Optional liabilities, + @JsonProperty("netAssets") double netAssets) { + Utils.checkNotNull(assets, "assets"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(equity, "equity"); + Utils.checkNotNull(liabilities, "liabilities"); + Utils.checkNotNull(netAssets, "netAssets"); + this.assets = assets; + this.date = date; + this.equity = equity; + this.liabilities = liabilities; + this.netAssets = netAssets; + } + + public Optional assets() { + return assets; + } + + /** + * 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 Optional date() { + return date; + } + + public Optional equity() { + return equity; + } + + public Optional liabilities() { + return liabilities; + } + + /** + * Value of net assets for a company in their base currency. + */ + public double netAssets() { + return netAssets; + } + + public final static Builder builder() { + return new Builder(); + } + + public BalanceSheet withAssets(ReportLine assets) { + Utils.checkNotNull(assets, "assets"); + this.assets = Optional.ofNullable(assets); + return this; + } + + public BalanceSheet withAssets(Optional assets) { + Utils.checkNotNull(assets, "assets"); + this.assets = assets; + 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 BalanceSheet 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 BalanceSheet withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + public BalanceSheet withEquity(ReportLineInput equity) { + Utils.checkNotNull(equity, "equity"); + this.equity = Optional.ofNullable(equity); + return this; + } + + public BalanceSheet withEquity(Optional equity) { + Utils.checkNotNull(equity, "equity"); + this.equity = equity; + return this; + } + + public BalanceSheet withLiabilities(ReportLineInput liabilities) { + Utils.checkNotNull(liabilities, "liabilities"); + this.liabilities = Optional.ofNullable(liabilities); + return this; + } + + public BalanceSheet withLiabilities(Optional liabilities) { + Utils.checkNotNull(liabilities, "liabilities"); + this.liabilities = liabilities; + return this; + } + + /** + * Value of net assets for a company in their base currency. + */ + public BalanceSheet withNetAssets(double netAssets) { + Utils.checkNotNull(netAssets, "netAssets"); + this.netAssets = netAssets; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceSheet other = (BalanceSheet) o; + return + java.util.Objects.deepEquals(this.assets, other.assets) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.equity, other.equity) && + java.util.Objects.deepEquals(this.liabilities, other.liabilities) && + java.util.Objects.deepEquals(this.netAssets, other.netAssets); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + assets, + date, + equity, + liabilities, + netAssets); + } + + @Override + public String toString() { + return Utils.toString(BalanceSheet.class, + "assets", assets, + "date", date, + "equity", equity, + "liabilities", liabilities, + "netAssets", netAssets); + } + + public final static class Builder { + + private Optional assets = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional equity = Optional.empty(); + + private Optional liabilities = Optional.empty(); + + private Double netAssets; + + private Builder() { + // force use of static builder() method + } + + public Builder assets(ReportLine assets) { + Utils.checkNotNull(assets, "assets"); + this.assets = Optional.ofNullable(assets); + return this; + } + + public Builder assets(Optional assets) { + Utils.checkNotNull(assets, "assets"); + this.assets = assets; + 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(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; + } + + public Builder equity(ReportLineInput equity) { + Utils.checkNotNull(equity, "equity"); + this.equity = Optional.ofNullable(equity); + return this; + } + + public Builder equity(Optional equity) { + Utils.checkNotNull(equity, "equity"); + this.equity = equity; + return this; + } + + public Builder liabilities(ReportLineInput liabilities) { + Utils.checkNotNull(liabilities, "liabilities"); + this.liabilities = Optional.ofNullable(liabilities); + return this; + } + + public Builder liabilities(Optional liabilities) { + Utils.checkNotNull(liabilities, "liabilities"); + this.liabilities = liabilities; + return this; + } + + /** + * Value of net assets for a company in their base currency. + */ + public Builder netAssets(double netAssets) { + Utils.checkNotNull(netAssets, "netAssets"); + this.netAssets = netAssets; + return this; + } + + public BalanceSheet build() { + return new BalanceSheet( + assets, + date, + equity, + liabilities, + netAssets); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankAccountRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankAccountRef.java new file mode 100644 index 00000000..c68bb6a7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankAccountRef.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * BankAccountRef - Links to the Account transactions data type. + */ + +public class BankAccountRef { + + /** + * Bank account 'id' for the account transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * bank account 'name' for the account transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public BankAccountRef( + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * Bank account 'id' for the account transaction. + */ + public Optional id() { + return id; + } + + /** + * bank account 'name' for the account transaction. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Bank account 'id' for the account transaction. + */ + public BankAccountRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Bank account 'id' for the account transaction. + */ + public BankAccountRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * bank account 'name' for the account transaction. + */ + public BankAccountRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * bank account 'name' for the account transaction. + */ + public BankAccountRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankAccountRef other = (BankAccountRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(BankAccountRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Bank account 'id' for the account transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Bank account 'id' for the account transaction. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * bank account 'name' for the account transaction. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * bank account 'name' for the account transaction. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public BankAccountRef build() { + return new BankAccountRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankTransactionType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankTransactionType.java new file mode 100644 index 00000000..047826fc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankTransactionType.java @@ -0,0 +1,44 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BankTransactionType - Type of transaction for the bank statement line. + */ +public enum BankTransactionType { + UNKNOWN("Unknown"), + CREDIT("Credit"), + DEBIT("Debit"), + INT_("Int"), + DIV("Div"), + FEE("Fee"), + SER_CHG("SerChg"), + DEP("Dep"), + ATM("Atm"), + POS("Pos"), + XFER("Xfer"), + CHECK("Check"), + PAYMENT("Payment"), + CASH("Cash"), + DIRECT_DEP("DirectDep"), + DIRECT_DEBIT("DirectDebit"), + REPEAT_PMT("RepeatPmt"), + OTHER("Other"); + + @JsonValue + private final String value; + + private BankTransactionType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccount.java new file mode 100644 index 00000000..c9767fb0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccount.java @@ -0,0 +1,553 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * BankingAccount - This data type provides a list of all the SMB's bank accounts, with rich data like balances, account numbers, and institutions holding the accounts. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-accounts). + * + * Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + */ + +public class BankingAccount { + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + @JsonProperty("balance") + private AccountBalanceAmounts balance; + + /** + * The currency code for the account. + */ + @JsonProperty("currency") + private String currency; + + /** + * The name of the person or company who holds the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("holder") + private JsonNullable holder; + + /** + * The ID of the account from the provider. + */ + @JsonProperty("id") + private String id; + + /** + * An object containing bank account identification information. + */ + @JsonProperty("identifiers") + private AccountIdentifiers identifiers; + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("informalName") + private JsonNullable informalName; + + /** + * The bank or other financial institution providing the account. + */ + @JsonProperty("institution") + private AccountInstitution institution; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * The name of the account according to the provider. + */ + @JsonProperty("name") + private String name; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + @JsonProperty("type") + private AccountingBankAccountType type; + + public BankingAccount( + @JsonProperty("balance") AccountBalanceAmounts balance, + @JsonProperty("currency") String currency, + @JsonProperty("holder") JsonNullable holder, + @JsonProperty("id") String id, + @JsonProperty("identifiers") AccountIdentifiers identifiers, + @JsonProperty("informalName") JsonNullable informalName, + @JsonProperty("institution") AccountInstitution institution, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") String name, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("type") AccountingBankAccountType type) { + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(holder, "holder"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(identifiers, "identifiers"); + Utils.checkNotNull(informalName, "informalName"); + Utils.checkNotNull(institution, "institution"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(type, "type"); + this.balance = balance; + this.currency = currency; + this.holder = holder; + this.id = id; + this.identifiers = identifiers; + this.informalName = informalName; + this.institution = institution; + this.modifiedDate = modifiedDate; + this.name = name; + this.sourceModifiedDate = sourceModifiedDate; + this.type = type; + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public AccountBalanceAmounts balance() { + return balance; + } + + /** + * The currency code for the account. + */ + public String currency() { + return currency; + } + + /** + * The name of the person or company who holds the account. + */ + public JsonNullable holder() { + return holder; + } + + /** + * The ID of the account from the provider. + */ + public String id() { + return id; + } + + /** + * An object containing bank account identification information. + */ + public AccountIdentifiers identifiers() { + return identifiers; + } + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + public JsonNullable informalName() { + return informalName; + } + + /** + * The bank or other financial institution providing the account. + */ + public AccountInstitution institution() { + return institution; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * The name of the account according to the provider. + */ + public String name() { + return name; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public AccountingBankAccountType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public BankingAccount withBalance(AccountBalanceAmounts balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency code for the account. + */ + public BankingAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The name of the person or company who holds the account. + */ + public BankingAccount withHolder(String holder) { + Utils.checkNotNull(holder, "holder"); + this.holder = JsonNullable.of(holder); + return this; + } + + /** + * The name of the person or company who holds the account. + */ + public BankingAccount withHolder(JsonNullable holder) { + Utils.checkNotNull(holder, "holder"); + this.holder = holder; + return this; + } + + /** + * The ID of the account from the provider. + */ + public BankingAccount withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An object containing bank account identification information. + */ + public BankingAccount withIdentifiers(AccountIdentifiers identifiers) { + Utils.checkNotNull(identifiers, "identifiers"); + this.identifiers = identifiers; + return this; + } + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + public BankingAccount withInformalName(String informalName) { + Utils.checkNotNull(informalName, "informalName"); + this.informalName = JsonNullable.of(informalName); + return this; + } + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + public BankingAccount withInformalName(JsonNullable informalName) { + Utils.checkNotNull(informalName, "informalName"); + this.informalName = informalName; + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public BankingAccount withInstitution(AccountInstitution institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public BankingAccount withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public BankingAccount withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the account according to the provider. + */ + public BankingAccount withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public BankingAccount withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public BankingAccount withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public BankingAccount withType(AccountingBankAccountType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingAccount other = (BankingAccount) o; + return + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.holder, other.holder) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.identifiers, other.identifiers) && + java.util.Objects.deepEquals(this.informalName, other.informalName) && + java.util.Objects.deepEquals(this.institution, other.institution) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + balance, + currency, + holder, + id, + identifiers, + informalName, + institution, + modifiedDate, + name, + sourceModifiedDate, + type); + } + + @Override + public String toString() { + return Utils.toString(BankingAccount.class, + "balance", balance, + "currency", currency, + "holder", holder, + "id", id, + "identifiers", identifiers, + "informalName", informalName, + "institution", institution, + "modifiedDate", modifiedDate, + "name", name, + "sourceModifiedDate", sourceModifiedDate, + "type", type); + } + + public final static class Builder { + + private AccountBalanceAmounts balance; + + private String currency; + + private JsonNullable holder = JsonNullable.undefined(); + + private String id; + + private AccountIdentifiers identifiers; + + private JsonNullable informalName = JsonNullable.undefined(); + + private AccountInstitution institution; + + private Optional modifiedDate = Optional.empty(); + + private String name; + + private Optional sourceModifiedDate = Optional.empty(); + + private AccountingBankAccountType type; + + private Builder() { + // force use of static builder() method + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public Builder balance(AccountBalanceAmounts balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The currency code for the account. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The name of the person or company who holds the account. + */ + public Builder holder(String holder) { + Utils.checkNotNull(holder, "holder"); + this.holder = JsonNullable.of(holder); + return this; + } + + /** + * The name of the person or company who holds the account. + */ + public Builder holder(JsonNullable holder) { + Utils.checkNotNull(holder, "holder"); + this.holder = holder; + return this; + } + + /** + * The ID of the account from the provider. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * An object containing bank account identification information. + */ + public Builder identifiers(AccountIdentifiers identifiers) { + Utils.checkNotNull(identifiers, "identifiers"); + this.identifiers = identifiers; + return this; + } + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + public Builder informalName(String informalName) { + Utils.checkNotNull(informalName, "informalName"); + this.informalName = JsonNullable.of(informalName); + return this; + } + + /** + * The friendly name of the account, chosen by the holder. This may not have been set by the account holder and therefore is not always available. + */ + public Builder informalName(JsonNullable informalName) { + Utils.checkNotNull(informalName, "informalName"); + this.informalName = informalName; + return this; + } + + /** + * The bank or other financial institution providing the account. + */ + public Builder institution(AccountInstitution institution) { + Utils.checkNotNull(institution, "institution"); + this.institution = institution; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the account according to the provider. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The type of transactions and balances on the account. + * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + */ + public Builder type(AccountingBankAccountType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public BankingAccount build() { + return new BankingAccount( + balance, + currency, + holder, + id, + identifiers, + informalName, + institution, + modifiedDate, + name, + sourceModifiedDate, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalance.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalance.java new file mode 100644 index 00000000..2ae244d1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalance.java @@ -0,0 +1,342 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * BankingAccountBalance - The Banking Account Balances data type provides a list of balances for a bank account including end-of-day batch balance or running balances per transaction. + * + * Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + * + * > **How often should I pull Account Balances?** + * > + * > Because these balances are closing balances, we recommend you pull Account Balance no more frequently than daily. If you require a live intraday balance, this can be found for each account on the [Account](https://docs.codat.io/lending-api#/schemas/Account) data type. + * > + * > Whilst you can choose to sync hourly, this may incur usage charges from Plaid or TrueLayer. + */ + +public class BankingAccountBalance { + + /** + * The unique identifier of the account. + */ + @JsonProperty("accountId") + private String accountId; + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + @JsonProperty("balance") + private AccountBalanceAmounts balance; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("date") + private String date; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + public BankingAccountBalance( + @JsonProperty("accountId") String accountId, + @JsonProperty("balance") AccountBalanceAmounts balance, + @JsonProperty("date") String date, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.accountId = accountId; + this.balance = balance; + this.date = date; + this.modifiedDate = modifiedDate; + this.sourceModifiedDate = sourceModifiedDate; + } + + /** + * The unique identifier of the account. + */ + public String accountId() { + return accountId; + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public AccountBalanceAmounts balance() { + return balance; + } + + /** + * 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 String date() { + return date; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identifier of the account. + */ + public BankingAccountBalance withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public BankingAccountBalance withBalance(AccountBalanceAmounts balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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 BankingAccountBalance withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + public BankingAccountBalance withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public BankingAccountBalance withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public BankingAccountBalance withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public BankingAccountBalance withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingAccountBalance other = (BankingAccountBalance) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + balance, + date, + modifiedDate, + sourceModifiedDate); + } + + @Override + public String toString() { + return Utils.toString(BankingAccountBalance.class, + "accountId", accountId, + "balance", balance, + "date", date, + "modifiedDate", modifiedDate, + "sourceModifiedDate", sourceModifiedDate); + } + + public final static class Builder { + + private String accountId; + + private AccountBalanceAmounts balance; + + private String date; + + private Optional modifiedDate = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identifier of the account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Depending on the data provided by the underlying bank, not all balances are always available. + */ + public Builder balance(AccountBalanceAmounts balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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(String date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + public BankingAccountBalance build() { + return new BankingAccountBalance( + accountId, + balance, + date, + modifiedDate, + sourceModifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalances.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalances.java new file mode 100644 index 00000000..93f1d5c3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccountBalances.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BankingAccountBalances { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public BankingAccountBalances( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public BankingAccountBalances withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public BankingAccountBalances withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public BankingAccountBalances withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public BankingAccountBalances withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public BankingAccountBalances withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public BankingAccountBalances withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingAccountBalances other = (BankingAccountBalances) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(BankingAccountBalances.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public BankingAccountBalances build() { + return new BankingAccountBalances( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccounts.java new file mode 100644 index 00000000..d076cfa1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingAccounts.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BankingAccounts { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public BankingAccounts( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public BankingAccounts withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public BankingAccounts withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public BankingAccounts withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public BankingAccounts withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public BankingAccounts withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public BankingAccounts withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingAccounts other = (BankingAccounts) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(BankingAccounts.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public BankingAccounts build() { + return new BankingAccounts( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransaction.java new file mode 100644 index 00000000..0643114d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransaction.java @@ -0,0 +1,896 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * BankingTransaction - The Banking Transactions data type provides an immutable source of up-to-date information on income and expenditure. + * + * Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + * + * View the coverage for banking transactions in the [Data Coverage Explorer](https://knowledge.codat.io/supported-features/banking?view=tab-by-data-type&dataType=banking-transactions). + */ + +public class BankingTransaction { + + /** + * The unique identifier of the bank account. + */ + @JsonProperty("accountId") + private String accountId; + + /** + * The amount of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("authorizedDate") + private Optional authorizedDate; + + /** + * Code to identify the underlying transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + /** + * The currency of the bank transaction. + */ + @JsonProperty("currency") + private String currency; + + /** + * The description of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * The unique identifier of the bank transaction. + */ + @JsonProperty("id") + private String id; + + /** + * The name of the merchant. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("merchantName") + private JsonNullable merchantName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("postedDate") + private Optional postedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * An object of bank transaction category reference data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactionCategoryRef") + private Optional transactionCategoryRef; + + public BankingTransaction( + @JsonProperty("accountId") String accountId, + @JsonProperty("amount") Optional amount, + @JsonProperty("authorizedDate") Optional authorizedDate, + @JsonProperty("code") Optional code, + @JsonProperty("currency") String currency, + @JsonProperty("description") JsonNullable description, + @JsonProperty("id") String id, + @JsonProperty("merchantName") JsonNullable merchantName, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("postedDate") Optional postedDate, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("transactionCategoryRef") Optional transactionCategoryRef) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(authorizedDate, "authorizedDate"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(merchantName, "merchantName"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(postedDate, "postedDate"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(transactionCategoryRef, "transactionCategoryRef"); + this.accountId = accountId; + this.amount = amount; + this.authorizedDate = authorizedDate; + this.code = code; + this.currency = currency; + this.description = description; + this.id = id; + this.merchantName = merchantName; + this.modifiedDate = modifiedDate; + this.postedDate = postedDate; + this.sourceModifiedDate = sourceModifiedDate; + this.transactionCategoryRef = transactionCategoryRef; + } + + /** + * The unique identifier of the bank account. + */ + public String accountId() { + return accountId; + } + + /** + * The amount of the bank transaction. + */ + public Optional amount() { + return amount; + } + + /** + * 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 Optional authorizedDate() { + return authorizedDate; + } + + /** + * Code to identify the underlying transaction. + */ + public Optional code() { + return code; + } + + /** + * The currency of the bank transaction. + */ + public String currency() { + return currency; + } + + /** + * The description of the bank transaction. + */ + public JsonNullable description() { + return description; + } + + /** + * The unique identifier of the bank transaction. + */ + public String id() { + return id; + } + + /** + * The name of the merchant. + */ + public JsonNullable merchantName() { + return merchantName; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * 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 Optional postedDate() { + return postedDate; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * An object of bank transaction category reference data. + */ + public Optional transactionCategoryRef() { + return transactionCategoryRef; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identifier of the bank account. + */ + public BankingTransaction withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * The amount of the bank transaction. + */ + public BankingTransaction withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount of the bank transaction. + */ + public BankingTransaction withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 BankingTransaction withAuthorizedDate(String authorizedDate) { + Utils.checkNotNull(authorizedDate, "authorizedDate"); + this.authorizedDate = Optional.ofNullable(authorizedDate); + 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 BankingTransaction withAuthorizedDate(Optional authorizedDate) { + Utils.checkNotNull(authorizedDate, "authorizedDate"); + this.authorizedDate = authorizedDate; + return this; + } + + /** + * Code to identify the underlying transaction. + */ + public BankingTransaction withCode(TransactionCode code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + /** + * Code to identify the underlying transaction. + */ + public BankingTransaction withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + /** + * The currency of the bank transaction. + */ + public BankingTransaction withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The description of the bank transaction. + */ + public BankingTransaction withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the bank transaction. + */ + public BankingTransaction withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public BankingTransaction withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the merchant. + */ + public BankingTransaction withMerchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = JsonNullable.of(merchantName); + return this; + } + + /** + * The name of the merchant. + */ + public BankingTransaction withMerchantName(JsonNullable merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + public BankingTransaction withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public BankingTransaction withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 BankingTransaction withPostedDate(String postedDate) { + Utils.checkNotNull(postedDate, "postedDate"); + this.postedDate = Optional.ofNullable(postedDate); + 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 BankingTransaction withPostedDate(Optional postedDate) { + Utils.checkNotNull(postedDate, "postedDate"); + this.postedDate = postedDate; + return this; + } + + public BankingTransaction withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public BankingTransaction withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * An object of bank transaction category reference data. + */ + public BankingTransaction withTransactionCategoryRef(TransactionCategoryRef transactionCategoryRef) { + Utils.checkNotNull(transactionCategoryRef, "transactionCategoryRef"); + this.transactionCategoryRef = Optional.ofNullable(transactionCategoryRef); + return this; + } + + /** + * An object of bank transaction category reference data. + */ + public BankingTransaction withTransactionCategoryRef(Optional transactionCategoryRef) { + Utils.checkNotNull(transactionCategoryRef, "transactionCategoryRef"); + this.transactionCategoryRef = transactionCategoryRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingTransaction other = (BankingTransaction) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.authorizedDate, other.authorizedDate) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.merchantName, other.merchantName) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.postedDate, other.postedDate) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.transactionCategoryRef, other.transactionCategoryRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + amount, + authorizedDate, + code, + currency, + description, + id, + merchantName, + modifiedDate, + postedDate, + sourceModifiedDate, + transactionCategoryRef); + } + + @Override + public String toString() { + return Utils.toString(BankingTransaction.class, + "accountId", accountId, + "amount", amount, + "authorizedDate", authorizedDate, + "code", code, + "currency", currency, + "description", description, + "id", id, + "merchantName", merchantName, + "modifiedDate", modifiedDate, + "postedDate", postedDate, + "sourceModifiedDate", sourceModifiedDate, + "transactionCategoryRef", transactionCategoryRef); + } + + public final static class Builder { + + private String accountId; + + private Optional amount = Optional.empty(); + + private Optional authorizedDate = Optional.empty(); + + private Optional code = Optional.empty(); + + private String currency; + + private JsonNullable description = JsonNullable.undefined(); + + private String id; + + private JsonNullable merchantName = JsonNullable.undefined(); + + private Optional modifiedDate = Optional.empty(); + + private Optional postedDate = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional transactionCategoryRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identifier of the bank account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * The amount of the bank transaction. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount of the bank transaction. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 authorizedDate(String authorizedDate) { + Utils.checkNotNull(authorizedDate, "authorizedDate"); + this.authorizedDate = Optional.ofNullable(authorizedDate); + 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 authorizedDate(Optional authorizedDate) { + Utils.checkNotNull(authorizedDate, "authorizedDate"); + this.authorizedDate = authorizedDate; + return this; + } + + /** + * Code to identify the underlying transaction. + */ + public Builder code(TransactionCode code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + /** + * Code to identify the underlying transaction. + */ + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + /** + * The currency of the bank transaction. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The description of the bank transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the bank transaction. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the merchant. + */ + public Builder merchantName(String merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = JsonNullable.of(merchantName); + return this; + } + + /** + * The name of the merchant. + */ + public Builder merchantName(JsonNullable merchantName) { + Utils.checkNotNull(merchantName, "merchantName"); + this.merchantName = merchantName; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 postedDate(String postedDate) { + Utils.checkNotNull(postedDate, "postedDate"); + this.postedDate = Optional.ofNullable(postedDate); + 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 postedDate(Optional postedDate) { + Utils.checkNotNull(postedDate, "postedDate"); + this.postedDate = postedDate; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * An object of bank transaction category reference data. + */ + public Builder transactionCategoryRef(TransactionCategoryRef transactionCategoryRef) { + Utils.checkNotNull(transactionCategoryRef, "transactionCategoryRef"); + this.transactionCategoryRef = Optional.ofNullable(transactionCategoryRef); + return this; + } + + /** + * An object of bank transaction category reference data. + */ + public Builder transactionCategoryRef(Optional transactionCategoryRef) { + Utils.checkNotNull(transactionCategoryRef, "transactionCategoryRef"); + this.transactionCategoryRef = transactionCategoryRef; + return this; + } + + public BankingTransaction build() { + return new BankingTransaction( + accountId, + amount, + authorizedDate, + code, + currency, + description, + id, + merchantName, + modifiedDate, + postedDate, + sourceModifiedDate, + transactionCategoryRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategories.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategories.java new file mode 100644 index 00000000..021478eb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategories.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BankingTransactionCategories { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public BankingTransactionCategories( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public BankingTransactionCategories withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public BankingTransactionCategories withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public BankingTransactionCategories withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public BankingTransactionCategories withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public BankingTransactionCategories withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public BankingTransactionCategories withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingTransactionCategories other = (BankingTransactionCategories) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(BankingTransactionCategories.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public BankingTransactionCategories build() { + return new BankingTransactionCategories( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategory.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategory.java new file mode 100644 index 00000000..41efb9ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionCategory.java @@ -0,0 +1,402 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * BankingTransactionCategory - The Banking Transaction Categories data type provides a list of hierarchical categories associated with a transaction for greater contextual meaning to transaction activity. + * + * Responses are paged, so you should provide `page` and `pageSize` query parameters in your request. + */ + +public class BankingTransactionCategory { + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasChildren") + private Optional hasChildren; + + /** + * The unique identifier of the bank transaction category. + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * The name of the bank transaction category. + */ + @JsonProperty("name") + private String name; + + /** + * The unique identifier of the parent bank transaction category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("parentId") + private JsonNullable parentId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The status of the transaction category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + public BankingTransactionCategory( + @JsonProperty("hasChildren") Optional hasChildren, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") String name, + @JsonProperty("parentId") JsonNullable parentId, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(hasChildren, "hasChildren"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(parentId, "parentId"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + this.hasChildren = hasChildren; + this.id = id; + this.modifiedDate = modifiedDate; + this.name = name; + this.parentId = parentId; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + } + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + public Optional hasChildren() { + return hasChildren; + } + + /** + * The unique identifier of the bank transaction category. + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * The name of the bank transaction category. + */ + public String name() { + return name; + } + + /** + * The unique identifier of the parent bank transaction category. + */ + public JsonNullable parentId() { + return parentId; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The status of the transaction category. + */ + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + public BankingTransactionCategory withHasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + public BankingTransactionCategory withHasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * The unique identifier of the bank transaction category. + */ + public BankingTransactionCategory withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public BankingTransactionCategory withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public BankingTransactionCategory withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the bank transaction category. + */ + public BankingTransactionCategory withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The unique identifier of the parent bank transaction category. + */ + public BankingTransactionCategory withParentId(String parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = JsonNullable.of(parentId); + return this; + } + + /** + * The unique identifier of the parent bank transaction category. + */ + public BankingTransactionCategory withParentId(JsonNullable parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = parentId; + return this; + } + + public BankingTransactionCategory withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public BankingTransactionCategory withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the transaction category. + */ + public BankingTransactionCategory withStatus(TransactionCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the transaction category. + */ + public BankingTransactionCategory withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingTransactionCategory other = (BankingTransactionCategory) o; + return + java.util.Objects.deepEquals(this.hasChildren, other.hasChildren) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.parentId, other.parentId) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + hasChildren, + id, + modifiedDate, + name, + parentId, + sourceModifiedDate, + status); + } + + @Override + public String toString() { + return Utils.toString(BankingTransactionCategory.class, + "hasChildren", hasChildren, + "id", id, + "modifiedDate", modifiedDate, + "name", name, + "parentId", parentId, + "sourceModifiedDate", sourceModifiedDate, + "status", status); + } + + public final static class Builder { + + private Optional hasChildren = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private String name; + + private JsonNullable parentId = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + public Builder hasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * A Boolean indicating whether there are other bank transaction categories beneath this one in the hierarchy. + */ + public Builder hasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * The unique identifier of the bank transaction category. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the bank transaction category. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The unique identifier of the parent bank transaction category. + */ + public Builder parentId(String parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = JsonNullable.of(parentId); + return this; + } + + /** + * The unique identifier of the parent bank transaction category. + */ + public Builder parentId(JsonNullable parentId) { + Utils.checkNotNull(parentId, "parentId"); + this.parentId = parentId; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the transaction category. + */ + public Builder status(TransactionCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the transaction category. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public BankingTransactionCategory build() { + return new BankingTransactionCategory( + hasChildren, + id, + modifiedDate, + name, + parentId, + sourceModifiedDate, + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionRef.java new file mode 100644 index 00000000..00503552 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactionRef.java @@ -0,0 +1,578 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BankingTransactionRef { + + /** + * Unique identifier of the bank transaction's account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private Optional accountId; + + /** + * Name given to account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountName") + private Optional accountName; + + /** + * Bank transaction amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * Unique identifier of the bank transaction's connection. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnectionId") + private Optional dataConnectionId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * Description given to bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * Unique identifier for the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public BankingTransactionRef( + @JsonProperty("accountId") Optional accountId, + @JsonProperty("accountName") Optional accountName, + @JsonProperty("amount") Optional amount, + @JsonProperty("dataConnectionId") Optional dataConnectionId, + @JsonProperty("date") Optional date, + @JsonProperty("description") Optional description, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(accountName, "accountName"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + this.accountId = accountId; + this.accountName = accountName; + this.amount = amount; + this.dataConnectionId = dataConnectionId; + this.date = date; + this.description = description; + this.id = id; + } + + /** + * Unique identifier of the bank transaction's account. + */ + public Optional accountId() { + return accountId; + } + + /** + * Name given to account. + */ + public Optional accountName() { + return accountName; + } + + /** + * Bank transaction amount. + */ + public Optional amount() { + return amount; + } + + /** + * Unique identifier of the bank transaction's connection. + */ + public Optional dataConnectionId() { + return dataConnectionId; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * Description given to bank transaction. + */ + public Optional description() { + return description; + } + + /** + * Unique identifier for the bank transaction. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier of the bank transaction's account. + */ + public BankingTransactionRef withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier of the bank transaction's account. + */ + public BankingTransactionRef withAccountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Name given to account. + */ + public BankingTransactionRef withAccountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * Name given to account. + */ + public BankingTransactionRef withAccountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Bank transaction amount. + */ + public BankingTransactionRef withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Bank transaction amount. + */ + public BankingTransactionRef withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Unique identifier of the bank transaction's connection. + */ + public BankingTransactionRef withDataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * Unique identifier of the bank transaction's connection. + */ + public BankingTransactionRef withDataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + 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 BankingTransactionRef 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 BankingTransactionRef withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Description given to bank transaction. + */ + public BankingTransactionRef withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description given to bank transaction. + */ + public BankingTransactionRef withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Unique identifier for the bank transaction. + */ + public BankingTransactionRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the bank transaction. + */ + public BankingTransactionRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingTransactionRef other = (BankingTransactionRef) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.accountName, other.accountName) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.dataConnectionId, other.dataConnectionId) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + accountName, + amount, + dataConnectionId, + date, + description, + id); + } + + @Override + public String toString() { + return Utils.toString(BankingTransactionRef.class, + "accountId", accountId, + "accountName", accountName, + "amount", amount, + "dataConnectionId", dataConnectionId, + "date", date, + "description", description, + "id", id); + } + + public final static class Builder { + + private Optional accountId = Optional.empty(); + + private Optional accountName = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional dataConnectionId = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier of the bank transaction's account. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * Unique identifier of the bank transaction's account. + */ + public Builder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Name given to account. + */ + public Builder accountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * Name given to account. + */ + public Builder accountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Bank transaction amount. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Bank transaction amount. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Unique identifier of the bank transaction's connection. + */ + public Builder dataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * Unique identifier of the bank transaction's connection. + */ + public Builder dataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + 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(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; + } + + /** + * Description given to bank transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description given to bank transaction. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Unique identifier for the bank transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the bank transaction. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public BankingTransactionRef build() { + return new BankingTransactionRef( + accountId, + accountName, + amount, + dataConnectionId, + date, + description, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactions.java new file mode 100644 index 00000000..00cba44c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BankingTransactions.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class BankingTransactions { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public BankingTransactions( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public BankingTransactions withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public BankingTransactions withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public BankingTransactions withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public BankingTransactions withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public BankingTransactions withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public BankingTransactions withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankingTransactions other = (BankingTransactions) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(BankingTransactions.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public BankingTransactions build() { + return new BankingTransactions( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteLineItem.java new file mode 100644 index 00000000..1b880c0f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteLineItem.java @@ -0,0 +1,854 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class BillCreditNoteLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Value of any discounts applied. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Percentage rate of any discount applied to the line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * Number of units of the goods or service for which credit has been received. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Amount of tax associated with the line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * Total amount of the line item, including discounts and tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + @Deprecated + private JsonNullable> trackingCategoryRefs; + + /** + * Unit price of the goods or service. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + public BillCreditNoteLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("tracking") Optional tracking, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(tracking, "tracking"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.itemRef = itemRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.tracking = tracking; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + public JsonNullable description() { + return description; + } + + /** + * Value of any discounts applied. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * Number of units of the goods or service for which credit has been received. + */ + public double quantity() { + return quantity; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Amount of tax associated with the line item. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Optional tracking() { + return tracking; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * Unit price of the goods or service. + */ + public double unitAmount() { + return unitAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public BillCreditNoteLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public BillCreditNoteLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + public BillCreditNoteLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + public BillCreditNoteLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Value of any discounts applied. + */ + public BillCreditNoteLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Value of any discounts applied. + */ + public BillCreditNoteLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public BillCreditNoteLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public BillCreditNoteLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public BillCreditNoteLineItem withItemRef(ItemReference itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public BillCreditNoteLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of the goods or service for which credit has been received. + */ + public BillCreditNoteLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public BillCreditNoteLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public BillCreditNoteLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public BillCreditNoteLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public BillCreditNoteLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public BillCreditNoteLineItem withTaxRateRef(TaxRateReference taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public BillCreditNoteLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public BillCreditNoteLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public BillCreditNoteLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public BillCreditNoteLineItem withTracking(AccountsPayableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public BillCreditNoteLineItem withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public BillCreditNoteLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public BillCreditNoteLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Unit price of the goods or service. + */ + public BillCreditNoteLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BillCreditNoteLineItem other = (BillCreditNoteLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + + @Override + public String toString() { + return Utils.toString(BillCreditNoteLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "itemRef", itemRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "tracking", tracking, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional itemRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private Optional tracking = Optional.empty(); + + @Deprecated + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been received. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Value of any discounts applied. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Value of any discounts applied. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(ItemReference itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of the goods or service for which credit has been received. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateReference taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(AccountsPayableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Unit price of the goods or service. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + public BillCreditNoteLineItem build() { + return new BillCreditNoteLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteStatus.java new file mode 100644 index 00000000..41c68b46 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillCreditNoteStatus.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BillCreditNoteStatus - Current state of the bill credit note + */ +public enum BillCreditNoteStatus { + UNKNOWN("Unknown"), + DRAFT("Draft"), + SUBMITTED("Submitted"), + PAID("Paid"), + VOID_("Void"), + PARTIALLY_PAID("PartiallyPaid"); + + @JsonValue + private final String value; + + private BillCreditNoteStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItem.java new file mode 100644 index 00000000..b9b5e396 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItem.java @@ -0,0 +1,1071 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class BillLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Friendly name of the goods or services received. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Percentage rate of any discount applied to the bill. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * The bill is a direct cost if `True`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isDirectCost") + private Optional isDirectCost; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * The bill line's number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineNumber") + private JsonNullable lineNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("purchaseOrderLineRef") + private Optional purchaseOrderLineRef; + + /** + * Number of units of goods or services received. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Amount of tax for the line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * Total amount of the line, including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + /** + * Collection of categories against which this item is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + private JsonNullable> trackingCategoryRefs; + + /** + * Price of each unit of goods or services. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unitOfMeasurement") + private JsonNullable unitOfMeasurement; + + public BillLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("isDirectCost") Optional isDirectCost, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("lineNumber") JsonNullable lineNumber, + @JsonProperty("purchaseOrderLineRef") Optional purchaseOrderLineRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("tracking") Optional tracking, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount, + @JsonProperty("unitOfMeasurement") JsonNullable unitOfMeasurement) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(isDirectCost, "isDirectCost"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(lineNumber, "lineNumber"); + Utils.checkNotNull(purchaseOrderLineRef, "purchaseOrderLineRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(tracking, "tracking"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + Utils.checkNotNull(unitOfMeasurement, "unitOfMeasurement"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.isDirectCost = isDirectCost; + this.itemRef = itemRef; + this.lineNumber = lineNumber; + this.purchaseOrderLineRef = purchaseOrderLineRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.tracking = tracking; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + this.unitOfMeasurement = unitOfMeasurement; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Friendly name of the goods or services received. + */ + public JsonNullable description() { + return description; + } + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Percentage rate of any discount applied to the bill. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * The bill is a direct cost if `True`. + */ + public Optional isDirectCost() { + return isDirectCost; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * The bill line's number. + */ + public JsonNullable lineNumber() { + return lineNumber; + } + + public Optional purchaseOrderLineRef() { + return purchaseOrderLineRef; + } + + /** + * Number of units of goods or services received. + */ + public double quantity() { + return quantity; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Amount of tax for the line. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * Total amount of the line, including tax. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Optional tracking() { + return tracking; + } + + /** + * Collection of categories against which this item is tracked. + */ + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * Price of each unit of goods or services. + */ + public double unitAmount() { + return unitAmount; + } + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + public JsonNullable unitOfMeasurement() { + return unitOfMeasurement; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public BillLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public BillLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services received. + */ + public BillLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services received. + */ + public BillLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + public BillLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + public BillLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the bill. + */ + public BillLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the bill. + */ + public BillLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The bill is a direct cost if `True`. + */ + public BillLineItem withIsDirectCost(boolean isDirectCost) { + Utils.checkNotNull(isDirectCost, "isDirectCost"); + this.isDirectCost = Optional.ofNullable(isDirectCost); + return this; + } + + /** + * The bill is a direct cost if `True`. + */ + public BillLineItem withIsDirectCost(Optional isDirectCost) { + Utils.checkNotNull(isDirectCost, "isDirectCost"); + this.isDirectCost = isDirectCost; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public BillLineItem withItemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public BillLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The bill line's number. + */ + public BillLineItem withLineNumber(String lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = JsonNullable.of(lineNumber); + return this; + } + + /** + * The bill line's number. + */ + public BillLineItem withLineNumber(JsonNullable lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = lineNumber; + return this; + } + + public BillLineItem withPurchaseOrderLineRef(RecordLineReference purchaseOrderLineRef) { + Utils.checkNotNull(purchaseOrderLineRef, "purchaseOrderLineRef"); + this.purchaseOrderLineRef = Optional.ofNullable(purchaseOrderLineRef); + return this; + } + + public BillLineItem withPurchaseOrderLineRef(Optional purchaseOrderLineRef) { + Utils.checkNotNull(purchaseOrderLineRef, "purchaseOrderLineRef"); + this.purchaseOrderLineRef = purchaseOrderLineRef; + return this; + } + + /** + * Number of units of goods or services received. + */ + public BillLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public BillLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public BillLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public BillLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public BillLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public BillLineItem withTaxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public BillLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. + */ + public BillLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. + */ + public BillLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public BillLineItem withTracking(AccountsPayableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public BillLineItem withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Collection of categories against which this item is tracked. + */ + public BillLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Collection of categories against which this item is tracked. + */ + public BillLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + */ + public BillLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + public BillLineItem withUnitOfMeasurement(String unitOfMeasurement) { + Utils.checkNotNull(unitOfMeasurement, "unitOfMeasurement"); + this.unitOfMeasurement = JsonNullable.of(unitOfMeasurement); + return this; + } + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + public BillLineItem withUnitOfMeasurement(JsonNullable unitOfMeasurement) { + Utils.checkNotNull(unitOfMeasurement, "unitOfMeasurement"); + this.unitOfMeasurement = unitOfMeasurement; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BillLineItem other = (BillLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.isDirectCost, other.isDirectCost) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.lineNumber, other.lineNumber) && + java.util.Objects.deepEquals(this.purchaseOrderLineRef, other.purchaseOrderLineRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount) && + java.util.Objects.deepEquals(this.unitOfMeasurement, other.unitOfMeasurement); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectCost, + itemRef, + lineNumber, + purchaseOrderLineRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount, + unitOfMeasurement); + } + + @Override + public String toString() { + return Utils.toString(BillLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "isDirectCost", isDirectCost, + "itemRef", itemRef, + "lineNumber", lineNumber, + "purchaseOrderLineRef", purchaseOrderLineRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "tracking", tracking, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount, + "unitOfMeasurement", unitOfMeasurement); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional isDirectCost = Optional.empty(); + + private Optional itemRef = Optional.empty(); + + private JsonNullable lineNumber = JsonNullable.undefined(); + + private Optional purchaseOrderLineRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private Optional tracking = Optional.empty(); + + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private JsonNullable unitOfMeasurement = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services received. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services received. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Numerical value of any discounts applied. + * + * Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the bill. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the bill. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The bill is a direct cost if `True`. + */ + public Builder isDirectCost(boolean isDirectCost) { + Utils.checkNotNull(isDirectCost, "isDirectCost"); + this.isDirectCost = Optional.ofNullable(isDirectCost); + return this; + } + + /** + * The bill is a direct cost if `True`. + */ + public Builder isDirectCost(Optional isDirectCost) { + Utils.checkNotNull(isDirectCost, "isDirectCost"); + this.isDirectCost = isDirectCost; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The bill line's number. + */ + public Builder lineNumber(String lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = JsonNullable.of(lineNumber); + return this; + } + + /** + * The bill line's number. + */ + public Builder lineNumber(JsonNullable lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = lineNumber; + return this; + } + + public Builder purchaseOrderLineRef(RecordLineReference purchaseOrderLineRef) { + Utils.checkNotNull(purchaseOrderLineRef, "purchaseOrderLineRef"); + this.purchaseOrderLineRef = Optional.ofNullable(purchaseOrderLineRef); + return this; + } + + public Builder purchaseOrderLineRef(Optional purchaseOrderLineRef) { + Utils.checkNotNull(purchaseOrderLineRef, "purchaseOrderLineRef"); + this.purchaseOrderLineRef = purchaseOrderLineRef; + return this; + } + + /** + * Number of units of goods or services received. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(AccountsPayableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Collection of categories against which this item is tracked. + */ + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Collection of categories against which this item is tracked. + */ + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + public Builder unitOfMeasurement(String unitOfMeasurement) { + Utils.checkNotNull(unitOfMeasurement, "unitOfMeasurement"); + this.unitOfMeasurement = JsonNullable.of(unitOfMeasurement); + return this; + } + + /** + * The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). + */ + public Builder unitOfMeasurement(JsonNullable unitOfMeasurement) { + Utils.checkNotNull(unitOfMeasurement, "unitOfMeasurement"); + this.unitOfMeasurement = unitOfMeasurement; + return this; + } + + public BillLineItem build() { + return new BillLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectCost, + itemRef, + lineNumber, + purchaseOrderLineRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount, + unitOfMeasurement); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItemDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItemDataType.java new file mode 100644 index 00000000..c924df1d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillLineItemDataType.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BillLineItemDataType - Allowed name of the 'dataType'. + */ +public enum BillLineItemDataType { + PURCHASE_ORDERS("purchaseOrders"); + + @JsonValue + private final String value; + + private BillLineItemDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLine.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLine.java new file mode 100644 index 00000000..9743fbc5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLine.java @@ -0,0 +1,306 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class BillPaymentLine { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allocatedOnDate") + private Optional allocatedOnDate; + + /** + * Amount in the bill payment currency. + */ + @JsonProperty("amount") + private double amount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private JsonNullable> links; + + public BillPaymentLine( + @JsonProperty("allocatedOnDate") Optional allocatedOnDate, + @JsonProperty("amount") double amount, + @JsonProperty("links") JsonNullable> links) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(links, "links"); + this.allocatedOnDate = allocatedOnDate; + this.amount = amount; + this.links = links; + } + + /** + * 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 Optional allocatedOnDate() { + return allocatedOnDate; + } + + /** + * Amount in the bill payment currency. + */ + public double amount() { + return amount; + } + + public JsonNullable> links() { + return links; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 BillPaymentLine withAllocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 BillPaymentLine withAllocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Amount in the bill payment currency. + */ + public BillPaymentLine withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public BillPaymentLine withLinks(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + public BillPaymentLine withLinks(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BillPaymentLine other = (BillPaymentLine) o; + return + java.util.Objects.deepEquals(this.allocatedOnDate, other.allocatedOnDate) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.links, other.links); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allocatedOnDate, + amount, + links); + } + + @Override + public String toString() { + return Utils.toString(BillPaymentLine.class, + "allocatedOnDate", allocatedOnDate, + "amount", amount, + "links", links); + } + + public final static class Builder { + + private Optional allocatedOnDate = Optional.empty(); + + private Double amount; + + private JsonNullable> links = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 allocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 allocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Amount in the bill payment currency. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public Builder links(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + public Builder links(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + public BillPaymentLine build() { + return new BillPaymentLine( + allocatedOnDate, + amount, + links); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLink.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLink.java new file mode 100644 index 00000000..418cd813 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLink.java @@ -0,0 +1,478 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class BillPaymentLineLink { + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private JsonNullable amount; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Unique identifier of the transaction represented by the link. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private JsonNullable id; + + /** + * Types of links to bill payment lines. + */ + @JsonProperty("type") + private BillPaymentLineLinkType type; + + public BillPaymentLineLink( + @JsonProperty("amount") JsonNullable amount, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") JsonNullable id, + @JsonProperty("type") BillPaymentLineLinkType type) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.amount = amount; + this.currencyRate = currencyRate; + this.id = id; + this.type = type; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + public JsonNullable amount() { + return amount; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public JsonNullable id() { + return id; + } + + /** + * Types of links to bill payment lines. + */ + public BillPaymentLineLinkType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + public BillPaymentLineLink withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + public BillPaymentLineLink withAmount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public BillPaymentLineLink withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public BillPaymentLineLink withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public BillPaymentLineLink withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = JsonNullable.of(id); + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public BillPaymentLineLink withId(JsonNullable id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Types of links to bill payment lines. + */ + public BillPaymentLineLink withType(BillPaymentLineLinkType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BillPaymentLineLink other = (BillPaymentLineLink) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + currencyRate, + id, + type); + } + + @Override + public String toString() { + return Utils.toString(BillPaymentLineLink.class, + "amount", amount, + "currencyRate", currencyRate, + "id", id, + "type", type); + } + + public final static class Builder { + + private JsonNullable amount = JsonNullable.undefined(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private JsonNullable id = JsonNullable.undefined(); + + private BillPaymentLineLinkType type; + + private Builder() { + // force use of static builder() method + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * + * - A negative link amount reduces the outstanding amount on the accounts payable account. + * - A positive link amount increases the outstanding amount on the accounts payable account. + */ + public Builder amount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = JsonNullable.of(id); + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public Builder id(JsonNullable id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Types of links to bill payment lines. + */ + public Builder type(BillPaymentLineLinkType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public BillPaymentLineLink build() { + return new BillPaymentLineLink( + amount, + currencyRate, + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLinkType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLinkType.java new file mode 100644 index 00000000..2ccb57de --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillPaymentLineLinkType.java @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BillPaymentLineLinkType - Types of links to bill payment lines. + */ +public enum BillPaymentLineLinkType { + UNKNOWN("Unknown"), + UNLINKED("Unlinked"), + BILL("Bill"), + OTHER("Other"), + CREDIT_NOTE("CreditNote"), + BILL_PAYMENT("BillPayment"), + PAYMENT_ON_ACCOUNT("PaymentOnAccount"), + REFUND("Refund"), + MANUAL_JOURNAL("ManualJournal"), + DISCOUNT("Discount"); + + @JsonValue + private final String value; + + private BillPaymentLineLinkType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BillStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BillStatus.java new file mode 100644 index 00000000..de24e0e2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BillStatus.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BillStatus - Current state of the bill. + */ +public enum BillStatus { + UNKNOWN("Unknown"), + OPEN("Open"), + PARTIALLY_PAID("PartiallyPaid"), + PAID("Paid"), + VOID_("Void"), + DRAFT("Draft"); + + @JsonValue + private final String value; + + private BillStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType.java new file mode 100644 index 00000000..7c02b1fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BilledToType - Defines if the invoice or credit note is billed/rebilled to a project or customer. + */ +public enum BilledToType { + UNKNOWN("Unknown"), + NOT_APPLICABLE("NotApplicable"), + CUSTOMER("Customer"), + PROJECT("Project"); + + @JsonValue + private final String value; + + private BilledToType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType1.java b/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType1.java new file mode 100644 index 00000000..db15d35b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/BilledToType1.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * BilledToType1 - Defines if the bill or bill credit note is billed/rebilled to a project. + */ +public enum BilledToType1 { + UNKNOWN("Unknown"), + NOT_APPLICABLE("NotApplicable"), + PROJECT("Project"); + + @JsonValue + private final String value; + + private BilledToType1(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CashFlowStatement.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CashFlowStatement.java new file mode 100644 index 00000000..699b907a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CashFlowStatement.java @@ -0,0 +1,473 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CashFlowStatement { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cashPayments") + private Optional cashPayments; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("cashReceipts") + private Optional cashReceipts; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fromDate") + private Optional fromDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("toDate") + private Optional toDate; + + public CashFlowStatement( + @JsonProperty("cashPayments") Optional cashPayments, + @JsonProperty("cashReceipts") Optional cashReceipts, + @JsonProperty("fromDate") Optional fromDate, + @JsonProperty("toDate") Optional toDate) { + Utils.checkNotNull(cashPayments, "cashPayments"); + Utils.checkNotNull(cashReceipts, "cashReceipts"); + Utils.checkNotNull(fromDate, "fromDate"); + Utils.checkNotNull(toDate, "toDate"); + this.cashPayments = cashPayments; + this.cashReceipts = cashReceipts; + this.fromDate = fromDate; + this.toDate = toDate; + } + + public Optional cashPayments() { + return cashPayments; + } + + public Optional cashReceipts() { + return cashReceipts; + } + + /** + * 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 Optional fromDate() { + return fromDate; + } + + /** + * 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 Optional toDate() { + return toDate; + } + + public final static Builder builder() { + return new Builder(); + } + + public CashFlowStatement withCashPayments(ReportLineInput cashPayments) { + Utils.checkNotNull(cashPayments, "cashPayments"); + this.cashPayments = Optional.ofNullable(cashPayments); + return this; + } + + public CashFlowStatement withCashPayments(Optional cashPayments) { + Utils.checkNotNull(cashPayments, "cashPayments"); + this.cashPayments = cashPayments; + return this; + } + + public CashFlowStatement withCashReceipts(ReportLineInput cashReceipts) { + Utils.checkNotNull(cashReceipts, "cashReceipts"); + this.cashReceipts = Optional.ofNullable(cashReceipts); + return this; + } + + public CashFlowStatement withCashReceipts(Optional cashReceipts) { + Utils.checkNotNull(cashReceipts, "cashReceipts"); + this.cashReceipts = cashReceipts; + 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 CashFlowStatement withFromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 CashFlowStatement withFromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + 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 CashFlowStatement withToDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 CashFlowStatement withToDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashFlowStatement other = (CashFlowStatement) o; + return + java.util.Objects.deepEquals(this.cashPayments, other.cashPayments) && + java.util.Objects.deepEquals(this.cashReceipts, other.cashReceipts) && + java.util.Objects.deepEquals(this.fromDate, other.fromDate) && + java.util.Objects.deepEquals(this.toDate, other.toDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + cashPayments, + cashReceipts, + fromDate, + toDate); + } + + @Override + public String toString() { + return Utils.toString(CashFlowStatement.class, + "cashPayments", cashPayments, + "cashReceipts", cashReceipts, + "fromDate", fromDate, + "toDate", toDate); + } + + public final static class Builder { + + private Optional cashPayments = Optional.empty(); + + private Optional cashReceipts = Optional.empty(); + + private Optional fromDate = Optional.empty(); + + private Optional toDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder cashPayments(ReportLineInput cashPayments) { + Utils.checkNotNull(cashPayments, "cashPayments"); + this.cashPayments = Optional.ofNullable(cashPayments); + return this; + } + + public Builder cashPayments(Optional cashPayments) { + Utils.checkNotNull(cashPayments, "cashPayments"); + this.cashPayments = cashPayments; + return this; + } + + public Builder cashReceipts(ReportLineInput cashReceipts) { + Utils.checkNotNull(cashReceipts, "cashReceipts"); + this.cashReceipts = Optional.ofNullable(cashReceipts); + return this; + } + + public Builder cashReceipts(Optional cashReceipts) { + Utils.checkNotNull(cashReceipts, "cashReceipts"); + this.cashReceipts = cashReceipts; + 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 fromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 fromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + 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 toDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 toDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + public CashFlowStatement build() { + return new CashFlowStatement( + cashPayments, + cashReceipts, + fromDate, + toDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhook.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhook.java new file mode 100644 index 00000000..6ae08d7a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhook.java @@ -0,0 +1,455 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ClientRateLimitReachedWebhook - Webhook request body for a client that has reached their rate limit. + */ + +public class ClientRateLimitReachedWebhook { + + /** + * Unique identifier of the webhook event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("AlertId") + private Optional alertId; + + /** + * Unique identifier for your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientId") + private Optional clientId; + + /** + * Name of your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientName") + private Optional clientName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Data") + private Optional data; + + /** + * A human readable message about the webhook. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Message") + private Optional message; + + /** + * Unique identifier for the rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleId") + private Optional ruleId; + + /** + * The type of rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleType") + private Optional ruleType; + + public ClientRateLimitReachedWebhook( + @JsonProperty("AlertId") Optional alertId, + @JsonProperty("ClientId") Optional clientId, + @JsonProperty("ClientName") Optional clientName, + @JsonProperty("Data") Optional data, + @JsonProperty("Message") Optional message, + @JsonProperty("RuleId") Optional ruleId, + @JsonProperty("RuleType") Optional ruleType) { + Utils.checkNotNull(alertId, "alertId"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(clientName, "clientName"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(ruleId, "ruleId"); + Utils.checkNotNull(ruleType, "ruleType"); + this.alertId = alertId; + this.clientId = clientId; + this.clientName = clientName; + this.data = data; + this.message = message; + this.ruleId = ruleId; + this.ruleType = ruleType; + } + + /** + * Unique identifier of the webhook event. + */ + public Optional alertId() { + return alertId; + } + + /** + * Unique identifier for your client in Codat. + */ + public Optional clientId() { + return clientId; + } + + /** + * Name of your client in Codat. + */ + public Optional clientName() { + return clientName; + } + + public Optional data() { + return data; + } + + /** + * A human readable message about the webhook. + */ + public Optional message() { + return message; + } + + /** + * Unique identifier for the rule. + */ + public Optional ruleId() { + return ruleId; + } + + /** + * The type of rule. + */ + public Optional ruleType() { + return ruleType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier of the webhook event. + */ + public ClientRateLimitReachedWebhook withAlertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public ClientRateLimitReachedWebhook withAlertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public ClientRateLimitReachedWebhook withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public ClientRateLimitReachedWebhook withClientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public ClientRateLimitReachedWebhook withClientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public ClientRateLimitReachedWebhook withClientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + public ClientRateLimitReachedWebhook withData(ClientRateLimitReachedWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public ClientRateLimitReachedWebhook withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * A human readable message about the webhook. + */ + public ClientRateLimitReachedWebhook withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public ClientRateLimitReachedWebhook withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public ClientRateLimitReachedWebhook withRuleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public ClientRateLimitReachedWebhook withRuleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public ClientRateLimitReachedWebhook withRuleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public ClientRateLimitReachedWebhook withRuleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientRateLimitReachedWebhook other = (ClientRateLimitReachedWebhook) o; + return + java.util.Objects.deepEquals(this.alertId, other.alertId) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.clientName, other.clientName) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.ruleId, other.ruleId) && + java.util.Objects.deepEquals(this.ruleType, other.ruleType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + alertId, + clientId, + clientName, + data, + message, + ruleId, + ruleType); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitReachedWebhook.class, + "alertId", alertId, + "clientId", clientId, + "clientName", clientName, + "data", data, + "message", message, + "ruleId", ruleId, + "ruleType", ruleType); + } + + public final static class Builder { + + private Optional alertId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientName = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional ruleId = Optional.empty(); + + private Optional ruleType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + public Builder data(ClientRateLimitReachedWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + public ClientRateLimitReachedWebhook build() { + return new ClientRateLimitReachedWebhook( + alertId, + clientId, + clientName, + data, + message, + ruleId, + ruleType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhookData.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhookData.java new file mode 100644 index 00000000..7c7367c5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitReachedWebhookData.java @@ -0,0 +1,283 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ClientRateLimitReachedWebhookData { + + /** + * The number of available requests per day. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("DailyQuota") + private Optional dailyQuota; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ExpiresUtc") + private Optional expiresUtc; + + public ClientRateLimitReachedWebhookData( + @JsonProperty("DailyQuota") Optional dailyQuota, + @JsonProperty("ExpiresUtc") Optional expiresUtc) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.dailyQuota = dailyQuota; + this.expiresUtc = expiresUtc; + } + + /** + * The number of available requests per day. + */ + public Optional dailyQuota() { + return dailyQuota; + } + + /** + * 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 Optional expiresUtc() { + return expiresUtc; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The number of available requests per day. + */ + public ClientRateLimitReachedWebhookData withDailyQuota(long dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = Optional.ofNullable(dailyQuota); + return this; + } + + /** + * The number of available requests per day. + */ + public ClientRateLimitReachedWebhookData withDailyQuota(Optional dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = dailyQuota; + 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 ClientRateLimitReachedWebhookData withExpiresUtc(String expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = Optional.ofNullable(expiresUtc); + 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 ClientRateLimitReachedWebhookData withExpiresUtc(Optional expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = expiresUtc; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientRateLimitReachedWebhookData other = (ClientRateLimitReachedWebhookData) o; + return + java.util.Objects.deepEquals(this.dailyQuota, other.dailyQuota) && + java.util.Objects.deepEquals(this.expiresUtc, other.expiresUtc); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dailyQuota, + expiresUtc); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitReachedWebhookData.class, + "dailyQuota", dailyQuota, + "expiresUtc", expiresUtc); + } + + public final static class Builder { + + private Optional dailyQuota = Optional.empty(); + + private Optional expiresUtc = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The number of available requests per day. + */ + public Builder dailyQuota(long dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = Optional.ofNullable(dailyQuota); + return this; + } + + /** + * The number of available requests per day. + */ + public Builder dailyQuota(Optional dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = dailyQuota; + 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 expiresUtc(String expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = Optional.ofNullable(expiresUtc); + 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 expiresUtc(Optional expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = expiresUtc; + return this; + } + + public ClientRateLimitReachedWebhookData build() { + return new ClientRateLimitReachedWebhookData( + dailyQuota, + expiresUtc); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhook.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhook.java new file mode 100644 index 00000000..dbd45083 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhook.java @@ -0,0 +1,455 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ClientRateLimitResetWebhook - Webhook request body for a client that has had their rate limit reset. + */ + +public class ClientRateLimitResetWebhook { + + /** + * Unique identifier of the webhook event. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("AlertId") + private Optional alertId; + + /** + * Unique identifier for your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientId") + private Optional clientId; + + /** + * Name of your client in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ClientName") + private Optional clientName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Data") + private Optional data; + + /** + * A human readable message about the webhook. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("Message") + private Optional message; + + /** + * Unique identifier for the rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleId") + private Optional ruleId; + + /** + * The type of rule. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RuleType") + private Optional ruleType; + + public ClientRateLimitResetWebhook( + @JsonProperty("AlertId") Optional alertId, + @JsonProperty("ClientId") Optional clientId, + @JsonProperty("ClientName") Optional clientName, + @JsonProperty("Data") Optional data, + @JsonProperty("Message") Optional message, + @JsonProperty("RuleId") Optional ruleId, + @JsonProperty("RuleType") Optional ruleType) { + Utils.checkNotNull(alertId, "alertId"); + Utils.checkNotNull(clientId, "clientId"); + Utils.checkNotNull(clientName, "clientName"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(ruleId, "ruleId"); + Utils.checkNotNull(ruleType, "ruleType"); + this.alertId = alertId; + this.clientId = clientId; + this.clientName = clientName; + this.data = data; + this.message = message; + this.ruleId = ruleId; + this.ruleType = ruleType; + } + + /** + * Unique identifier of the webhook event. + */ + public Optional alertId() { + return alertId; + } + + /** + * Unique identifier for your client in Codat. + */ + public Optional clientId() { + return clientId; + } + + /** + * Name of your client in Codat. + */ + public Optional clientName() { + return clientName; + } + + public Optional data() { + return data; + } + + /** + * A human readable message about the webhook. + */ + public Optional message() { + return message; + } + + /** + * Unique identifier for the rule. + */ + public Optional ruleId() { + return ruleId; + } + + /** + * The type of rule. + */ + public Optional ruleType() { + return ruleType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier of the webhook event. + */ + public ClientRateLimitResetWebhook withAlertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public ClientRateLimitResetWebhook withAlertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public ClientRateLimitResetWebhook withClientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public ClientRateLimitResetWebhook withClientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public ClientRateLimitResetWebhook withClientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public ClientRateLimitResetWebhook withClientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + public ClientRateLimitResetWebhook withData(ClientRateLimitResetWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public ClientRateLimitResetWebhook withData(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * A human readable message about the webhook. + */ + public ClientRateLimitResetWebhook withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public ClientRateLimitResetWebhook withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public ClientRateLimitResetWebhook withRuleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public ClientRateLimitResetWebhook withRuleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public ClientRateLimitResetWebhook withRuleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public ClientRateLimitResetWebhook withRuleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientRateLimitResetWebhook other = (ClientRateLimitResetWebhook) o; + return + java.util.Objects.deepEquals(this.alertId, other.alertId) && + java.util.Objects.deepEquals(this.clientId, other.clientId) && + java.util.Objects.deepEquals(this.clientName, other.clientName) && + java.util.Objects.deepEquals(this.data, other.data) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.ruleId, other.ruleId) && + java.util.Objects.deepEquals(this.ruleType, other.ruleType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + alertId, + clientId, + clientName, + data, + message, + ruleId, + ruleType); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitResetWebhook.class, + "alertId", alertId, + "clientId", clientId, + "clientName", clientName, + "data", data, + "message", message, + "ruleId", ruleId, + "ruleType", ruleType); + } + + public final static class Builder { + + private Optional alertId = Optional.empty(); + + private Optional clientId = Optional.empty(); + + private Optional clientName = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional ruleId = Optional.empty(); + + private Optional ruleType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(String alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = Optional.ofNullable(alertId); + return this; + } + + /** + * Unique identifier of the webhook event. + */ + public Builder alertId(Optional alertId) { + Utils.checkNotNull(alertId, "alertId"); + this.alertId = alertId; + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(String clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = Optional.ofNullable(clientId); + return this; + } + + /** + * Unique identifier for your client in Codat. + */ + public Builder clientId(Optional clientId) { + Utils.checkNotNull(clientId, "clientId"); + this.clientId = clientId; + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(String clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = Optional.ofNullable(clientName); + return this; + } + + /** + * Name of your client in Codat. + */ + public Builder clientName(Optional clientName) { + Utils.checkNotNull(clientName, "clientName"); + this.clientName = clientName; + return this; + } + + public Builder data(ClientRateLimitResetWebhookData data) { + Utils.checkNotNull(data, "data"); + this.data = Optional.ofNullable(data); + return this; + } + + public Builder data(Optional data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * A human readable message about the webhook. + */ + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(String ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = Optional.ofNullable(ruleId); + return this; + } + + /** + * Unique identifier for the rule. + */ + public Builder ruleId(Optional ruleId) { + Utils.checkNotNull(ruleId, "ruleId"); + this.ruleId = ruleId; + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(String ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = Optional.ofNullable(ruleType); + return this; + } + + /** + * The type of rule. + */ + public Builder ruleType(Optional ruleType) { + Utils.checkNotNull(ruleType, "ruleType"); + this.ruleType = ruleType; + return this; + } + + public ClientRateLimitResetWebhook build() { + return new ClientRateLimitResetWebhook( + alertId, + clientId, + clientName, + data, + message, + ruleId, + ruleType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhookData.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhookData.java new file mode 100644 index 00000000..525f9676 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ClientRateLimitResetWebhookData.java @@ -0,0 +1,402 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ClientRateLimitResetWebhookData { + + /** + * The number of available requests per day. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("DailyQuota") + private Optional dailyQuota; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ExpiresUtc") + private Optional expiresUtc; + + /** + * Total number of request remaining for your client. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("QuotaRemaining") + private JsonNullable quotaRemaining; + + /** + * The reason for your rate limit quota being reset. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ResetReason") + private Optional resetReason; + + public ClientRateLimitResetWebhookData( + @JsonProperty("DailyQuota") Optional dailyQuota, + @JsonProperty("ExpiresUtc") Optional expiresUtc, + @JsonProperty("QuotaRemaining") JsonNullable quotaRemaining, + @JsonProperty("ResetReason") Optional resetReason) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + Utils.checkNotNull(expiresUtc, "expiresUtc"); + Utils.checkNotNull(quotaRemaining, "quotaRemaining"); + Utils.checkNotNull(resetReason, "resetReason"); + this.dailyQuota = dailyQuota; + this.expiresUtc = expiresUtc; + this.quotaRemaining = quotaRemaining; + this.resetReason = resetReason; + } + + /** + * The number of available requests per day. + */ + public Optional dailyQuota() { + return dailyQuota; + } + + /** + * 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 Optional expiresUtc() { + return expiresUtc; + } + + /** + * Total number of request remaining for your client. + */ + public JsonNullable quotaRemaining() { + return quotaRemaining; + } + + /** + * The reason for your rate limit quota being reset. + */ + public Optional resetReason() { + return resetReason; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The number of available requests per day. + */ + public ClientRateLimitResetWebhookData withDailyQuota(long dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = Optional.ofNullable(dailyQuota); + return this; + } + + /** + * The number of available requests per day. + */ + public ClientRateLimitResetWebhookData withDailyQuota(Optional dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = dailyQuota; + 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 ClientRateLimitResetWebhookData withExpiresUtc(String expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = Optional.ofNullable(expiresUtc); + 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 ClientRateLimitResetWebhookData withExpiresUtc(Optional expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = expiresUtc; + return this; + } + + /** + * Total number of request remaining for your client. + */ + public ClientRateLimitResetWebhookData withQuotaRemaining(long quotaRemaining) { + Utils.checkNotNull(quotaRemaining, "quotaRemaining"); + this.quotaRemaining = JsonNullable.of(quotaRemaining); + return this; + } + + /** + * Total number of request remaining for your client. + */ + public ClientRateLimitResetWebhookData withQuotaRemaining(JsonNullable quotaRemaining) { + Utils.checkNotNull(quotaRemaining, "quotaRemaining"); + this.quotaRemaining = quotaRemaining; + return this; + } + + /** + * The reason for your rate limit quota being reset. + */ + public ClientRateLimitResetWebhookData withResetReason(String resetReason) { + Utils.checkNotNull(resetReason, "resetReason"); + this.resetReason = Optional.ofNullable(resetReason); + return this; + } + + /** + * The reason for your rate limit quota being reset. + */ + public ClientRateLimitResetWebhookData withResetReason(Optional resetReason) { + Utils.checkNotNull(resetReason, "resetReason"); + this.resetReason = resetReason; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientRateLimitResetWebhookData other = (ClientRateLimitResetWebhookData) o; + return + java.util.Objects.deepEquals(this.dailyQuota, other.dailyQuota) && + java.util.Objects.deepEquals(this.expiresUtc, other.expiresUtc) && + java.util.Objects.deepEquals(this.quotaRemaining, other.quotaRemaining) && + java.util.Objects.deepEquals(this.resetReason, other.resetReason); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dailyQuota, + expiresUtc, + quotaRemaining, + resetReason); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitResetWebhookData.class, + "dailyQuota", dailyQuota, + "expiresUtc", expiresUtc, + "quotaRemaining", quotaRemaining, + "resetReason", resetReason); + } + + public final static class Builder { + + private Optional dailyQuota = Optional.empty(); + + private Optional expiresUtc = Optional.empty(); + + private JsonNullable quotaRemaining = JsonNullable.undefined(); + + private Optional resetReason = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The number of available requests per day. + */ + public Builder dailyQuota(long dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = Optional.ofNullable(dailyQuota); + return this; + } + + /** + * The number of available requests per day. + */ + public Builder dailyQuota(Optional dailyQuota) { + Utils.checkNotNull(dailyQuota, "dailyQuota"); + this.dailyQuota = dailyQuota; + 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 expiresUtc(String expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = Optional.ofNullable(expiresUtc); + 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 expiresUtc(Optional expiresUtc) { + Utils.checkNotNull(expiresUtc, "expiresUtc"); + this.expiresUtc = expiresUtc; + return this; + } + + /** + * Total number of request remaining for your client. + */ + public Builder quotaRemaining(long quotaRemaining) { + Utils.checkNotNull(quotaRemaining, "quotaRemaining"); + this.quotaRemaining = JsonNullable.of(quotaRemaining); + return this; + } + + /** + * Total number of request remaining for your client. + */ + public Builder quotaRemaining(JsonNullable quotaRemaining) { + Utils.checkNotNull(quotaRemaining, "quotaRemaining"); + this.quotaRemaining = quotaRemaining; + return this; + } + + /** + * The reason for your rate limit quota being reset. + */ + public Builder resetReason(String resetReason) { + Utils.checkNotNull(resetReason, "resetReason"); + this.resetReason = Optional.ofNullable(resetReason); + return this; + } + + /** + * The reason for your rate limit quota being reset. + */ + public Builder resetReason(Optional resetReason) { + Utils.checkNotNull(resetReason, "resetReason"); + this.resetReason = resetReason; + return this; + } + + public ClientRateLimitResetWebhookData build() { + return new ClientRateLimitResetWebhookData( + dailyQuota, + expiresUtc, + quotaRemaining, + resetReason); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CodatFile.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CodatFile.java new file mode 100644 index 00000000..144a96bd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CodatFile.java @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class CodatFile { + + @SpeakeasyMetadata("multipartForm:content") + private byte[] content; + + @SpeakeasyMetadata("multipartForm:name=fileName") + private String fileName; + + public CodatFile( + byte[] content, + String fileName) { + Utils.checkNotNull(content, "content"); + Utils.checkNotNull(fileName, "fileName"); + this.content = content; + this.fileName = fileName; + } + + public byte[] content() { + return content; + } + + public String fileName() { + return fileName; + } + + public final static Builder builder() { + return new Builder(); + } + + public CodatFile withContent(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + public CodatFile withFileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CodatFile other = (CodatFile) o; + return + java.util.Objects.deepEquals(this.content, other.content) && + java.util.Objects.deepEquals(this.fileName, other.fileName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + content, + fileName); + } + + @Override + public String toString() { + return Utils.toString(CodatFile.class, + "content", content, + "fileName", fileName); + } + + public final static class Builder { + + private byte[] content; + + private String fileName; + + private Builder() { + // force use of static builder() method + } + + public Builder content(byte[] content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + public Builder fileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + public CodatFile build() { + return new CodatFile( + content, + fileName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddress.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddress.java new file mode 100644 index 00000000..123402be --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddress.java @@ -0,0 +1,470 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceAddress { + + /** + * The third line of the address, or city + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("city") + private Optional city; + + /** + * The country for the address + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private Optional country; + + /** + * The first line of the address + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("line1") + private Optional line1; + + /** + * The second line of the address + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("line2") + private Optional line2; + + /** + * The postal (or zip) code for the address + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("postalCode") + private Optional postalCode; + + /** + * The fourth line of the address, or region + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("region") + private Optional region; + + /** + * The type of the address + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public CommerceAddress( + @JsonProperty("city") Optional city, + @JsonProperty("country") Optional country, + @JsonProperty("line1") Optional line1, + @JsonProperty("line2") Optional line2, + @JsonProperty("postalCode") Optional postalCode, + @JsonProperty("region") Optional region, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(city, "city"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(line1, "line1"); + Utils.checkNotNull(line2, "line2"); + Utils.checkNotNull(postalCode, "postalCode"); + Utils.checkNotNull(region, "region"); + Utils.checkNotNull(type, "type"); + this.city = city; + this.country = country; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.region = region; + this.type = type; + } + + /** + * The third line of the address, or city + */ + public Optional city() { + return city; + } + + /** + * The country for the address + */ + public Optional country() { + return country; + } + + /** + * The first line of the address + */ + public Optional line1() { + return line1; + } + + /** + * The second line of the address + */ + public Optional line2() { + return line2; + } + + /** + * The postal (or zip) code for the address + */ + public Optional postalCode() { + return postalCode; + } + + /** + * The fourth line of the address, or region + */ + public Optional region() { + return region; + } + + /** + * The type of the address + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The third line of the address, or city + */ + public CommerceAddress withCity(String city) { + Utils.checkNotNull(city, "city"); + this.city = Optional.ofNullable(city); + return this; + } + + /** + * The third line of the address, or city + */ + public CommerceAddress withCity(Optional city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + /** + * The country for the address + */ + public CommerceAddress withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + /** + * The country for the address + */ + public CommerceAddress withCountry(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + /** + * The first line of the address + */ + public CommerceAddress withLine1(String line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = Optional.ofNullable(line1); + return this; + } + + /** + * The first line of the address + */ + public CommerceAddress withLine1(Optional line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = line1; + return this; + } + + /** + * The second line of the address + */ + public CommerceAddress withLine2(String line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = Optional.ofNullable(line2); + return this; + } + + /** + * The second line of the address + */ + public CommerceAddress withLine2(Optional line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = line2; + return this; + } + + /** + * The postal (or zip) code for the address + */ + public CommerceAddress withPostalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + /** + * The postal (or zip) code for the address + */ + public CommerceAddress withPostalCode(Optional postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + /** + * The fourth line of the address, or region + */ + public CommerceAddress withRegion(String region) { + Utils.checkNotNull(region, "region"); + this.region = Optional.ofNullable(region); + return this; + } + + /** + * The fourth line of the address, or region + */ + public CommerceAddress withRegion(Optional region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * The type of the address + */ + public CommerceAddress withType(CommerceAddressType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the address + */ + public CommerceAddress withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceAddress other = (CommerceAddress) o; + return + java.util.Objects.deepEquals(this.city, other.city) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.line1, other.line1) && + java.util.Objects.deepEquals(this.line2, other.line2) && + java.util.Objects.deepEquals(this.postalCode, other.postalCode) && + java.util.Objects.deepEquals(this.region, other.region) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + city, + country, + line1, + line2, + postalCode, + region, + type); + } + + @Override + public String toString() { + return Utils.toString(CommerceAddress.class, + "city", city, + "country", country, + "line1", line1, + "line2", line2, + "postalCode", postalCode, + "region", region, + "type", type); + } + + public final static class Builder { + + private Optional city = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional line1 = Optional.empty(); + + private Optional line2 = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional region = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The third line of the address, or city + */ + public Builder city(String city) { + Utils.checkNotNull(city, "city"); + this.city = Optional.ofNullable(city); + return this; + } + + /** + * The third line of the address, or city + */ + public Builder city(Optional city) { + Utils.checkNotNull(city, "city"); + this.city = city; + return this; + } + + /** + * The country for the address + */ + public Builder country(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + /** + * The country for the address + */ + public Builder country(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + + /** + * The first line of the address + */ + public Builder line1(String line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = Optional.ofNullable(line1); + return this; + } + + /** + * The first line of the address + */ + public Builder line1(Optional line1) { + Utils.checkNotNull(line1, "line1"); + this.line1 = line1; + return this; + } + + /** + * The second line of the address + */ + public Builder line2(String line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = Optional.ofNullable(line2); + return this; + } + + /** + * The second line of the address + */ + public Builder line2(Optional line2) { + Utils.checkNotNull(line2, "line2"); + this.line2 = line2; + return this; + } + + /** + * The postal (or zip) code for the address + */ + public Builder postalCode(String postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + /** + * The postal (or zip) code for the address + */ + public Builder postalCode(Optional postalCode) { + Utils.checkNotNull(postalCode, "postalCode"); + this.postalCode = postalCode; + return this; + } + + /** + * The fourth line of the address, or region + */ + public Builder region(String region) { + Utils.checkNotNull(region, "region"); + this.region = Optional.ofNullable(region); + return this; + } + + /** + * The fourth line of the address, or region + */ + public Builder region(Optional region) { + Utils.checkNotNull(region, "region"); + this.region = region; + return this; + } + + /** + * The type of the address + */ + public Builder type(CommerceAddressType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the address + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public CommerceAddress build() { + return new CommerceAddress( + city, + country, + line1, + line2, + postalCode, + region, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddressType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddressType.java new file mode 100644 index 00000000..43a176ba --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceAddressType.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * CommerceAddressType - The type of the address + */ +public enum CommerceAddressType { + BILLING("Billing"), + DELIVERY("Delivery"), + ORDER("Order"), + INVENTORY("Inventory"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private CommerceAddressType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCompanyInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCompanyInfo.java new file mode 100644 index 00000000..9be90c34 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCompanyInfo.java @@ -0,0 +1,939 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceCompanyInfo - In the Codat system, company profile includes standard commercial details about + * a linked company, such as their address, phone number, and company registration. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=companyInfo) for this data type. + * + */ + +public class CommerceCompanyInfo { + + /** + * The available and current cash balances for the company's accounts + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountBalances") + private Optional> accountBalances; + + /** + * Addresses associated with the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private Optional> addresses; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("baseCurrency") + private Optional baseCurrency; + + /** + * Identifier or reference for the company in the commerce platform + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("commercePlatformRef") + private Optional commercePlatformRef; + + /** + * The full legal name of the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyLegalName") + private Optional companyLegalName; + + /** + * The name of the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private Optional companyName; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Phone numbers associated with the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phoneNumbers") + private Optional> phoneNumbers; + + /** + * The registration number of the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("registrationNumber") + private Optional registrationNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceUrls") + private Optional> sourceUrls; + + /** + * Weblinks associated with the company + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("webLinks") + private Optional> webLinks; + + public CommerceCompanyInfo( + @JsonProperty("accountBalances") Optional> accountBalances, + @JsonProperty("addresses") Optional> addresses, + @JsonProperty("baseCurrency") Optional baseCurrency, + @JsonProperty("commercePlatformRef") Optional commercePlatformRef, + @JsonProperty("companyLegalName") Optional companyLegalName, + @JsonProperty("companyName") Optional companyName, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("phoneNumbers") Optional> phoneNumbers, + @JsonProperty("registrationNumber") Optional registrationNumber, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("sourceUrls") Optional> sourceUrls, + @JsonProperty("webLinks") Optional> webLinks) { + Utils.checkNotNull(accountBalances, "accountBalances"); + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(baseCurrency, "baseCurrency"); + Utils.checkNotNull(commercePlatformRef, "commercePlatformRef"); + Utils.checkNotNull(companyLegalName, "companyLegalName"); + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + Utils.checkNotNull(registrationNumber, "registrationNumber"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(sourceUrls, "sourceUrls"); + Utils.checkNotNull(webLinks, "webLinks"); + this.accountBalances = accountBalances; + this.addresses = addresses; + this.baseCurrency = baseCurrency; + this.commercePlatformRef = commercePlatformRef; + this.companyLegalName = companyLegalName; + this.companyName = companyName; + this.createdDate = createdDate; + this.modifiedDate = modifiedDate; + this.phoneNumbers = phoneNumbers; + this.registrationNumber = registrationNumber; + this.sourceModifiedDate = sourceModifiedDate; + this.sourceUrls = sourceUrls; + this.webLinks = webLinks; + } + + /** + * The available and current cash balances for the company's accounts + */ + public Optional> accountBalances() { + return accountBalances; + } + + /** + * Addresses associated with the company + */ + public Optional> addresses() { + return addresses; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional baseCurrency() { + return baseCurrency; + } + + /** + * Identifier or reference for the company in the commerce platform + */ + public Optional commercePlatformRef() { + return commercePlatformRef; + } + + /** + * The full legal name of the company + */ + public Optional companyLegalName() { + return companyLegalName; + } + + /** + * The name of the company + */ + public Optional companyName() { + return companyName; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Phone numbers associated with the company + */ + public Optional> phoneNumbers() { + return phoneNumbers; + } + + /** + * The registration number of the company + */ + public Optional registrationNumber() { + return registrationNumber; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + public Optional> sourceUrls() { + return sourceUrls; + } + + /** + * Weblinks associated with the company + */ + public Optional> webLinks() { + return webLinks; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The available and current cash balances for the company's accounts + */ + public CommerceCompanyInfo withAccountBalances(java.util.List accountBalances) { + Utils.checkNotNull(accountBalances, "accountBalances"); + this.accountBalances = Optional.ofNullable(accountBalances); + return this; + } + + /** + * The available and current cash balances for the company's accounts + */ + public CommerceCompanyInfo withAccountBalances(Optional> accountBalances) { + Utils.checkNotNull(accountBalances, "accountBalances"); + this.accountBalances = accountBalances; + return this; + } + + /** + * Addresses associated with the company + */ + public CommerceCompanyInfo withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses associated with the company + */ + public CommerceCompanyInfo withAddresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommerceCompanyInfo withBaseCurrency(String baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = Optional.ofNullable(baseCurrency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommerceCompanyInfo withBaseCurrency(Optional baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = baseCurrency; + return this; + } + + /** + * Identifier or reference for the company in the commerce platform + */ + public CommerceCompanyInfo withCommercePlatformRef(String commercePlatformRef) { + Utils.checkNotNull(commercePlatformRef, "commercePlatformRef"); + this.commercePlatformRef = Optional.ofNullable(commercePlatformRef); + return this; + } + + /** + * Identifier or reference for the company in the commerce platform + */ + public CommerceCompanyInfo withCommercePlatformRef(Optional commercePlatformRef) { + Utils.checkNotNull(commercePlatformRef, "commercePlatformRef"); + this.commercePlatformRef = commercePlatformRef; + return this; + } + + /** + * The full legal name of the company + */ + public CommerceCompanyInfo withCompanyLegalName(String companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = Optional.ofNullable(companyLegalName); + return this; + } + + /** + * The full legal name of the company + */ + public CommerceCompanyInfo withCompanyLegalName(Optional companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = companyLegalName; + return this; + } + + /** + * The name of the company + */ + public CommerceCompanyInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * The name of the company + */ + public CommerceCompanyInfo withCompanyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 CommerceCompanyInfo withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommerceCompanyInfo withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + public CommerceCompanyInfo withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceCompanyInfo withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone numbers associated with the company + */ + public CommerceCompanyInfo withPhoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + /** + * Phone numbers associated with the company + */ + public CommerceCompanyInfo withPhoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * The registration number of the company + */ + public CommerceCompanyInfo withRegistrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = Optional.ofNullable(registrationNumber); + return this; + } + + /** + * The registration number of the company + */ + public CommerceCompanyInfo withRegistrationNumber(Optional registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public CommerceCompanyInfo withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceCompanyInfo withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + public CommerceCompanyInfo withSourceUrls(java.util.Map sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = Optional.ofNullable(sourceUrls); + return this; + } + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + public CommerceCompanyInfo withSourceUrls(Optional> sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = sourceUrls; + return this; + } + + /** + * Weblinks associated with the company + */ + public CommerceCompanyInfo withWebLinks(java.util.List webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = Optional.ofNullable(webLinks); + return this; + } + + /** + * Weblinks associated with the company + */ + public CommerceCompanyInfo withWebLinks(Optional> webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = webLinks; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceCompanyInfo other = (CommerceCompanyInfo) o; + return + java.util.Objects.deepEquals(this.accountBalances, other.accountBalances) && + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.baseCurrency, other.baseCurrency) && + java.util.Objects.deepEquals(this.commercePlatformRef, other.commercePlatformRef) && + java.util.Objects.deepEquals(this.companyLegalName, other.companyLegalName) && + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.phoneNumbers, other.phoneNumbers) && + java.util.Objects.deepEquals(this.registrationNumber, other.registrationNumber) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.sourceUrls, other.sourceUrls) && + java.util.Objects.deepEquals(this.webLinks, other.webLinks); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountBalances, + addresses, + baseCurrency, + commercePlatformRef, + companyLegalName, + companyName, + createdDate, + modifiedDate, + phoneNumbers, + registrationNumber, + sourceModifiedDate, + sourceUrls, + webLinks); + } + + @Override + public String toString() { + return Utils.toString(CommerceCompanyInfo.class, + "accountBalances", accountBalances, + "addresses", addresses, + "baseCurrency", baseCurrency, + "commercePlatformRef", commercePlatformRef, + "companyLegalName", companyLegalName, + "companyName", companyName, + "createdDate", createdDate, + "modifiedDate", modifiedDate, + "phoneNumbers", phoneNumbers, + "registrationNumber", registrationNumber, + "sourceModifiedDate", sourceModifiedDate, + "sourceUrls", sourceUrls, + "webLinks", webLinks); + } + + public final static class Builder { + + private Optional> accountBalances = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional baseCurrency = Optional.empty(); + + private Optional commercePlatformRef = Optional.empty(); + + private Optional companyLegalName = Optional.empty(); + + private Optional companyName = Optional.empty(); + + private Optional createdDate = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional registrationNumber = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional> sourceUrls = Optional.empty(); + + private Optional> webLinks = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The available and current cash balances for the company's accounts + */ + public Builder accountBalances(java.util.List accountBalances) { + Utils.checkNotNull(accountBalances, "accountBalances"); + this.accountBalances = Optional.ofNullable(accountBalances); + return this; + } + + /** + * The available and current cash balances for the company's accounts + */ + public Builder accountBalances(Optional> accountBalances) { + Utils.checkNotNull(accountBalances, "accountBalances"); + this.accountBalances = accountBalances; + return this; + } + + /** + * Addresses associated with the company + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses associated with the company + */ + public Builder addresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder baseCurrency(String baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = Optional.ofNullable(baseCurrency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder baseCurrency(Optional baseCurrency) { + Utils.checkNotNull(baseCurrency, "baseCurrency"); + this.baseCurrency = baseCurrency; + return this; + } + + /** + * Identifier or reference for the company in the commerce platform + */ + public Builder commercePlatformRef(String commercePlatformRef) { + Utils.checkNotNull(commercePlatformRef, "commercePlatformRef"); + this.commercePlatformRef = Optional.ofNullable(commercePlatformRef); + return this; + } + + /** + * Identifier or reference for the company in the commerce platform + */ + public Builder commercePlatformRef(Optional commercePlatformRef) { + Utils.checkNotNull(commercePlatformRef, "commercePlatformRef"); + this.commercePlatformRef = commercePlatformRef; + return this; + } + + /** + * The full legal name of the company + */ + public Builder companyLegalName(String companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = Optional.ofNullable(companyLegalName); + return this; + } + + /** + * The full legal name of the company + */ + public Builder companyLegalName(Optional companyLegalName) { + Utils.checkNotNull(companyLegalName, "companyLegalName"); + this.companyLegalName = companyLegalName; + return this; + } + + /** + * The name of the company + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * The name of the company + */ + public Builder companyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Phone numbers associated with the company + */ + public Builder phoneNumbers(java.util.List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + /** + * Phone numbers associated with the company + */ + public Builder phoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * The registration number of the company + */ + public Builder registrationNumber(String registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = Optional.ofNullable(registrationNumber); + return this; + } + + /** + * The registration number of the company + */ + public Builder registrationNumber(Optional registrationNumber) { + Utils.checkNotNull(registrationNumber, "registrationNumber"); + this.registrationNumber = registrationNumber; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + public Builder sourceUrls(java.util.Map sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = Optional.ofNullable(sourceUrls); + return this; + } + + /** + * URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system + */ + public Builder sourceUrls(Optional> sourceUrls) { + Utils.checkNotNull(sourceUrls, "sourceUrls"); + this.sourceUrls = sourceUrls; + return this; + } + + /** + * Weblinks associated with the company + */ + public Builder webLinks(java.util.List webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = Optional.ofNullable(webLinks); + return this; + } + + /** + * Weblinks associated with the company + */ + public Builder webLinks(Optional> webLinks) { + Utils.checkNotNull(webLinks, "webLinks"); + this.webLinks = webLinks; + return this; + } + + public CommerceCompanyInfo build() { + return new CommerceCompanyInfo( + accountBalances, + addresses, + baseCurrency, + commercePlatformRef, + companyLegalName, + companyName, + createdDate, + modifiedDate, + phoneNumbers, + registrationNumber, + sourceModifiedDate, + sourceUrls, + webLinks); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomer.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomer.java new file mode 100644 index 00000000..58bc0963 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomer.java @@ -0,0 +1,688 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * CommerceCustomer - When a customer places an order with the connected commerce store their details are added to the Customers dataset. You can use the data from the Customers endpoints to calculate key metrics, such as customer churn. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-customers) for this data type. + */ + +public class CommerceCustomer { + + /** + * Addresses of the customer + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private Optional> addresses; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * Name of the customer + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerName") + private Optional customerName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("defaultCurrency") + private Optional defaultCurrency; + + /** + * Email address of the customer + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emailAddress") + private Optional emailAddress; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Any additional information about the customer + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private Optional note; + + /** + * A phone number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone") + private JsonNullable phone; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + public CommerceCustomer( + @JsonProperty("addresses") Optional> addresses, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("customerName") Optional customerName, + @JsonProperty("defaultCurrency") Optional defaultCurrency, + @JsonProperty("emailAddress") Optional emailAddress, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("note") Optional note, + @JsonProperty("phone") JsonNullable phone, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate) { + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(customerName, "customerName"); + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + Utils.checkNotNull(emailAddress, "emailAddress"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(phone, "phone"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.addresses = addresses; + this.createdDate = createdDate; + this.customerName = customerName; + this.defaultCurrency = defaultCurrency; + this.emailAddress = emailAddress; + this.id = id; + this.modifiedDate = modifiedDate; + this.note = note; + this.phone = phone; + this.sourceModifiedDate = sourceModifiedDate; + } + + /** + * Addresses of the customer + */ + public Optional> addresses() { + return addresses; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * Name of the customer + */ + public Optional customerName() { + return customerName; + } + + public Optional defaultCurrency() { + return defaultCurrency; + } + + /** + * Email address of the customer + */ + public Optional emailAddress() { + return emailAddress; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Any additional information about the customer + */ + public Optional note() { + return note; + } + + /** + * A phone number. + */ + public JsonNullable phone() { + return phone; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Addresses of the customer + */ + public CommerceCustomer withAddresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses of the customer + */ + public CommerceCustomer withAddresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + 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 CommerceCustomer withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommerceCustomer withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * Name of the customer + */ + public CommerceCustomer withCustomerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = Optional.ofNullable(customerName); + return this; + } + + /** + * Name of the customer + */ + public CommerceCustomer withCustomerName(Optional customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + public CommerceCustomer withDefaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = Optional.ofNullable(defaultCurrency); + return this; + } + + public CommerceCustomer withDefaultCurrency(Optional defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address of the customer + */ + public CommerceCustomer withEmailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Email address of the customer + */ + public CommerceCustomer withEmailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceCustomer withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommerceCustomer withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceCustomer withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the customer + */ + public CommerceCustomer withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = Optional.ofNullable(note); + return this; + } + + /** + * Any additional information about the customer + */ + public CommerceCustomer withNote(Optional note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * A phone number. + */ + public CommerceCustomer withPhone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * A phone number. + */ + public CommerceCustomer withPhone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + public CommerceCustomer withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceCustomer withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceCustomer other = (CommerceCustomer) o; + return + java.util.Objects.deepEquals(this.addresses, other.addresses) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.customerName, other.customerName) && + java.util.Objects.deepEquals(this.defaultCurrency, other.defaultCurrency) && + java.util.Objects.deepEquals(this.emailAddress, other.emailAddress) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.phone, other.phone) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + addresses, + createdDate, + customerName, + defaultCurrency, + emailAddress, + id, + modifiedDate, + note, + phone, + sourceModifiedDate); + } + + @Override + public String toString() { + return Utils.toString(CommerceCustomer.class, + "addresses", addresses, + "createdDate", createdDate, + "customerName", customerName, + "defaultCurrency", defaultCurrency, + "emailAddress", emailAddress, + "id", id, + "modifiedDate", modifiedDate, + "note", note, + "phone", phone, + "sourceModifiedDate", sourceModifiedDate); + } + + public final static class Builder { + + private Optional> addresses = Optional.empty(); + + private Optional createdDate = Optional.empty(); + + private Optional customerName = Optional.empty(); + + private Optional defaultCurrency = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional note = Optional.empty(); + + private JsonNullable phone = JsonNullable.undefined(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Addresses of the customer + */ + public Builder addresses(java.util.List addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses of the customer + */ + public Builder addresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * Name of the customer + */ + public Builder customerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = Optional.ofNullable(customerName); + return this; + } + + /** + * Name of the customer + */ + public Builder customerName(Optional customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + public Builder defaultCurrency(String defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = Optional.ofNullable(defaultCurrency); + return this; + } + + public Builder defaultCurrency(Optional defaultCurrency) { + Utils.checkNotNull(defaultCurrency, "defaultCurrency"); + this.defaultCurrency = defaultCurrency; + return this; + } + + /** + * Email address of the customer + */ + public Builder emailAddress(String emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + * Email address of the customer + */ + public Builder emailAddress(Optional emailAddress) { + Utils.checkNotNull(emailAddress, "emailAddress"); + this.emailAddress = emailAddress; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Any additional information about the customer + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = Optional.ofNullable(note); + return this; + } + + /** + * Any additional information about the customer + */ + public Builder note(Optional note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * A phone number. + */ + public Builder phone(String phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * A phone number. + */ + public Builder phone(JsonNullable phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + public CommerceCustomer build() { + return new CommerceCustomer( + addresses, + createdDate, + customerName, + defaultCurrency, + emailAddress, + id, + modifiedDate, + note, + phone, + sourceModifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomerRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomerRef.java new file mode 100644 index 00000000..ed9c1092 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomerRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceCustomerRef - Reference to the customer that placed the order. + */ + +public class CommerceCustomerRef { + + /** + * The unique identitifer of the customer being referenced + */ + @JsonProperty("id") + private String id; + + /** + * Name of the customer being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public CommerceCustomerRef( + @JsonProperty("id") String id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identitifer of the customer being referenced + */ + public String id() { + return id; + } + + /** + * Name of the customer being referenced. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identitifer of the customer being referenced + */ + public CommerceCustomerRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the customer being referenced. + */ + public CommerceCustomerRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the customer being referenced. + */ + public CommerceCustomerRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceCustomerRef other = (CommerceCustomerRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(CommerceCustomerRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identitifer of the customer being referenced + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the customer being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the customer being referenced. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public CommerceCustomerRef build() { + return new CommerceCustomerRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomers.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomers.java new file mode 100644 index 00000000..9235a5dd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceCustomers.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceCustomers { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceCustomers( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceCustomers withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceCustomers withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceCustomers withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceCustomers withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceCustomers withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceCustomers withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceCustomers other = (CommerceCustomers) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceCustomers.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceCustomers build() { + return new CommerceCustomers( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDispute.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDispute.java new file mode 100644 index 00000000..c830c2cb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDispute.java @@ -0,0 +1,823 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceDispute - A customer may file a payment dispute with their bank or other card issuer when they're unsatisfied with their purchase or believe they have been charged incorrectly. For example: + * - They didn't receive an order. + * - The product they received was different to the commerce store's description. + * - They've been the victim of online fraud. + * + * You can use data from the Disputes endpoints to calculate key metrics, such as the number of chargebacks. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-disputes) for this data type. + */ + +public class CommerceDispute { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * Link to the source event(s) which triggered this transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("disputedTransactions") + private Optional> disputedTransactions; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Reason for the dispute + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reason") + private Optional reason; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current status of the dispute + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Total transaction amount that is under dispute. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public CommerceDispute( + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("currency") String currency, + @JsonProperty("disputedTransactions") Optional> disputedTransactions, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("reason") Optional reason, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(disputedTransactions, "disputedTransactions"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(reason, "reason"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.createdDate = createdDate; + this.currency = currency; + this.disputedTransactions = disputedTransactions; + this.dueDate = dueDate; + this.id = id; + this.modifiedDate = modifiedDate; + this.reason = reason; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.totalAmount = totalAmount; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * Link to the source event(s) which triggered this transaction. + */ + public Optional> disputedTransactions() { + return disputedTransactions; + } + + /** + * 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 Optional dueDate() { + return dueDate; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Reason for the dispute + */ + public Optional reason() { + return reason; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current status of the dispute + */ + public Optional status() { + return status; + } + + /** + * Total transaction amount that is under dispute. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 CommerceDispute withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommerceDispute withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommerceDispute withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Link to the source event(s) which triggered this transaction. + */ + public CommerceDispute withDisputedTransactions(java.util.List disputedTransactions) { + Utils.checkNotNull(disputedTransactions, "disputedTransactions"); + this.disputedTransactions = Optional.ofNullable(disputedTransactions); + return this; + } + + /** + * Link to the source event(s) which triggered this transaction. + */ + public CommerceDispute withDisputedTransactions(Optional> disputedTransactions) { + Utils.checkNotNull(disputedTransactions, "disputedTransactions"); + this.disputedTransactions = disputedTransactions; + 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 CommerceDispute withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 CommerceDispute withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceDispute withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommerceDispute withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceDispute withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Reason for the dispute + */ + public CommerceDispute withReason(String reason) { + Utils.checkNotNull(reason, "reason"); + this.reason = Optional.ofNullable(reason); + return this; + } + + /** + * Reason for the dispute + */ + public CommerceDispute withReason(Optional reason) { + Utils.checkNotNull(reason, "reason"); + this.reason = reason; + return this; + } + + public CommerceDispute withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceDispute withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current status of the dispute + */ + public CommerceDispute withStatus(DisputeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current status of the dispute + */ + public CommerceDispute withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total transaction amount that is under dispute. + */ + public CommerceDispute withTotalAmount(java.lang.Object totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total transaction amount that is under dispute. + */ + public CommerceDispute withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceDispute other = (CommerceDispute) o; + return + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.disputedTransactions, other.disputedTransactions) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.reason, other.reason) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + createdDate, + currency, + disputedTransactions, + dueDate, + id, + modifiedDate, + reason, + sourceModifiedDate, + status, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(CommerceDispute.class, + "createdDate", createdDate, + "currency", currency, + "disputedTransactions", disputedTransactions, + "dueDate", dueDate, + "id", id, + "modifiedDate", modifiedDate, + "reason", reason, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional createdDate = Optional.empty(); + + private String currency; + + private Optional> disputedTransactions = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional reason = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Link to the source event(s) which triggered this transaction. + */ + public Builder disputedTransactions(java.util.List disputedTransactions) { + Utils.checkNotNull(disputedTransactions, "disputedTransactions"); + this.disputedTransactions = Optional.ofNullable(disputedTransactions); + return this; + } + + /** + * Link to the source event(s) which triggered this transaction. + */ + public Builder disputedTransactions(Optional> disputedTransactions) { + Utils.checkNotNull(disputedTransactions, "disputedTransactions"); + this.disputedTransactions = disputedTransactions; + 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 dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Reason for the dispute + */ + public Builder reason(String reason) { + Utils.checkNotNull(reason, "reason"); + this.reason = Optional.ofNullable(reason); + return this; + } + + /** + * Reason for the dispute + */ + public Builder reason(Optional reason) { + Utils.checkNotNull(reason, "reason"); + this.reason = reason; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current status of the dispute + */ + public Builder status(DisputeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current status of the dispute + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Total transaction amount that is under dispute. + */ + public Builder totalAmount(java.lang.Object totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total transaction amount that is under dispute. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public CommerceDispute build() { + return new CommerceDispute( + createdDate, + currency, + disputedTransactions, + dueDate, + id, + modifiedDate, + reason, + sourceModifiedDate, + status, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDisputes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDisputes.java new file mode 100644 index 00000000..1db399a9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceDisputes.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceDisputes { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceDisputes( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceDisputes withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceDisputes withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceDisputes withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceDisputes withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceDisputes withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceDisputes withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceDisputes other = (CommerceDisputes) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceDisputes.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceDisputes build() { + return new CommerceDisputes( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocation.java new file mode 100644 index 00000000..594c606d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocation.java @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceLocation - The Location datatype holds information on the geographic location at which stocks of products may be held, as referenced in the Products data type. + * + * A Location also holds information on geographic locations where orders were placed, as referenced in the Orders data type. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-locations) for this data type. + */ + +public class CommerceLocation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("address") + private Optional address; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of this location + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + public CommerceLocation( + @JsonProperty("address") Optional address, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") Optional name, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate) { + Utils.checkNotNull(address, "address"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.address = address; + this.id = id; + this.modifiedDate = modifiedDate; + this.name = name; + this.sourceModifiedDate = sourceModifiedDate; + } + + public Optional address() { + return address; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of this location + */ + public Optional name() { + return name; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceLocation withAddress(CommerceAddress address) { + Utils.checkNotNull(address, "address"); + this.address = Optional.ofNullable(address); + return this; + } + + public CommerceLocation withAddress(Optional address) { + Utils.checkNotNull(address, "address"); + this.address = address; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceLocation withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommerceLocation withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceLocation withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of this location + */ + public CommerceLocation withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of this location + */ + public CommerceLocation withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public CommerceLocation withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceLocation withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceLocation other = (CommerceLocation) o; + return + java.util.Objects.deepEquals(this.address, other.address) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + address, + id, + modifiedDate, + name, + sourceModifiedDate); + } + + @Override + public String toString() { + return Utils.toString(CommerceLocation.class, + "address", address, + "id", id, + "modifiedDate", modifiedDate, + "name", name, + "sourceModifiedDate", sourceModifiedDate); + } + + public final static class Builder { + + private Optional address = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder address(CommerceAddress address) { + Utils.checkNotNull(address, "address"); + this.address = Optional.ofNullable(address); + return this; + } + + public Builder address(Optional address) { + Utils.checkNotNull(address, "address"); + this.address = address; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of this location + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of this location + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + public CommerceLocation build() { + return new CommerceLocation( + address, + id, + modifiedDate, + name, + sourceModifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocations.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocations.java new file mode 100644 index 00000000..dbd8e0f6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceLocations.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceLocations { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceLocations( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceLocations withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceLocations withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceLocations withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceLocations withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceLocations withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceLocations withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceLocations other = (CommerceLocations) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceLocations.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceLocations build() { + return new CommerceLocations( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrder.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrder.java new file mode 100644 index 00000000..728e07b4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrder.java @@ -0,0 +1,1309 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceOrder - Orders contain the transaction details for all products sold by the company, and include details of any payments, service charges, or refunds related to each order. You can use data from the Orders endpoints to calculate key metrics, such as gross sales values and monthly recurring revenue (MRR). + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-orders) for this data type. + * + */ + +public class CommerceOrder { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("closedDate") + private Optional closedDate; + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private Optional country; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Reference to the customer that placed the order. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + /** + * Reference to the geographic location where the order was placed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("locationRef") + private Optional locationRef; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("orderLineItems") + private Optional> orderLineItems; + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("orderNumber") + private Optional orderNumber; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("payments") + private Optional> payments; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("serviceCharges") + private Optional> serviceCharges; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalDiscount") + private Optional totalDiscount; + + /** + * Extra amount added to the order. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalGratuity") + private Optional totalGratuity; + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalRefund") + private Optional totalRefund; + + /** + * Total amount of tax applied to the order. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalTaxAmount") + private Optional totalTaxAmount; + + public CommerceOrder( + @JsonProperty("closedDate") Optional closedDate, + @JsonProperty("country") Optional country, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("currency") Optional currency, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("id") String id, + @JsonProperty("locationRef") Optional locationRef, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("orderLineItems") Optional> orderLineItems, + @JsonProperty("orderNumber") Optional orderNumber, + @JsonProperty("payments") Optional> payments, + @JsonProperty("serviceCharges") Optional> serviceCharges, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") Optional totalAmount, + @JsonProperty("totalDiscount") Optional totalDiscount, + @JsonProperty("totalGratuity") Optional totalGratuity, + @JsonProperty("totalRefund") Optional totalRefund, + @JsonProperty("totalTaxAmount") Optional totalTaxAmount) { + Utils.checkNotNull(closedDate, "closedDate"); + Utils.checkNotNull(country, "country"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(locationRef, "locationRef"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(orderLineItems, "orderLineItems"); + Utils.checkNotNull(orderNumber, "orderNumber"); + Utils.checkNotNull(payments, "payments"); + Utils.checkNotNull(serviceCharges, "serviceCharges"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(totalDiscount, "totalDiscount"); + Utils.checkNotNull(totalGratuity, "totalGratuity"); + Utils.checkNotNull(totalRefund, "totalRefund"); + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.closedDate = closedDate; + this.country = country; + this.createdDate = createdDate; + this.currency = currency; + this.customerRef = customerRef; + this.id = id; + this.locationRef = locationRef; + this.modifiedDate = modifiedDate; + this.orderLineItems = orderLineItems; + this.orderNumber = orderNumber; + this.payments = payments; + this.serviceCharges = serviceCharges; + this.sourceModifiedDate = sourceModifiedDate; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + this.totalDiscount = totalDiscount; + this.totalGratuity = totalGratuity; + this.totalRefund = totalRefund; + this.totalTaxAmount = totalTaxAmount; + } + + /** + * 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 Optional closedDate() { + return closedDate; + } + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + public Optional country() { + return country; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + public Optional currency() { + return currency; + } + + /** + * Reference to the customer that placed the order. + */ + public Optional customerRef() { + return customerRef; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Optional locationRef() { + return locationRef; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + public Optional> orderLineItems() { + return orderLineItems; + } + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + public Optional orderNumber() { + return orderNumber; + } + + public Optional> payments() { + return payments; + } + + public Optional> serviceCharges() { + return serviceCharges; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + public Optional totalAmount() { + return totalAmount; + } + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + public Optional totalDiscount() { + return totalDiscount; + } + + /** + * Extra amount added to the order. + */ + public Optional totalGratuity() { + return totalGratuity; + } + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + public Optional totalRefund() { + return totalRefund; + } + + /** + * Total amount of tax applied to the order. + */ + public Optional totalTaxAmount() { + return totalTaxAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 CommerceOrder withClosedDate(String closedDate) { + Utils.checkNotNull(closedDate, "closedDate"); + this.closedDate = Optional.ofNullable(closedDate); + 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 CommerceOrder withClosedDate(Optional closedDate) { + Utils.checkNotNull(closedDate, "closedDate"); + this.closedDate = closedDate; + return this; + } + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + public CommerceOrder withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + public CommerceOrder withCountry(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + 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 CommerceOrder withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommerceOrder withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + public CommerceOrder withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + public CommerceOrder withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Reference to the customer that placed the order. + */ + public CommerceOrder withCustomerRef(CommerceCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + /** + * Reference to the customer that placed the order. + */ + public CommerceOrder withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceOrder withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public CommerceOrder withLocationRef(LocationRef locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = Optional.ofNullable(locationRef); + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public CommerceOrder withLocationRef(Optional locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = locationRef; + return this; + } + + public CommerceOrder withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceOrder withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public CommerceOrder withOrderLineItems(java.util.List orderLineItems) { + Utils.checkNotNull(orderLineItems, "orderLineItems"); + this.orderLineItems = Optional.ofNullable(orderLineItems); + return this; + } + + public CommerceOrder withOrderLineItems(Optional> orderLineItems) { + Utils.checkNotNull(orderLineItems, "orderLineItems"); + this.orderLineItems = orderLineItems; + return this; + } + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + public CommerceOrder withOrderNumber(String orderNumber) { + Utils.checkNotNull(orderNumber, "orderNumber"); + this.orderNumber = Optional.ofNullable(orderNumber); + return this; + } + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + public CommerceOrder withOrderNumber(Optional orderNumber) { + Utils.checkNotNull(orderNumber, "orderNumber"); + this.orderNumber = orderNumber; + return this; + } + + public CommerceOrder withPayments(java.util.List payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = Optional.ofNullable(payments); + return this; + } + + public CommerceOrder withPayments(Optional> payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = payments; + return this; + } + + public CommerceOrder withServiceCharges(java.util.List serviceCharges) { + Utils.checkNotNull(serviceCharges, "serviceCharges"); + this.serviceCharges = Optional.ofNullable(serviceCharges); + return this; + } + + public CommerceOrder withServiceCharges(Optional> serviceCharges) { + Utils.checkNotNull(serviceCharges, "serviceCharges"); + this.serviceCharges = serviceCharges; + return this; + } + + public CommerceOrder withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceOrder withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceOrder withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceOrder withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + public CommerceOrder withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + public CommerceOrder withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + public CommerceOrder withTotalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = Optional.ofNullable(totalDiscount); + return this; + } + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + public CommerceOrder withTotalDiscount(Optional totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Extra amount added to the order. + */ + public CommerceOrder withTotalGratuity(double totalGratuity) { + Utils.checkNotNull(totalGratuity, "totalGratuity"); + this.totalGratuity = Optional.ofNullable(totalGratuity); + return this; + } + + /** + * Extra amount added to the order. + */ + public CommerceOrder withTotalGratuity(Optional totalGratuity) { + Utils.checkNotNull(totalGratuity, "totalGratuity"); + this.totalGratuity = totalGratuity; + return this; + } + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + public CommerceOrder withTotalRefund(double totalRefund) { + Utils.checkNotNull(totalRefund, "totalRefund"); + this.totalRefund = Optional.ofNullable(totalRefund); + return this; + } + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + public CommerceOrder withTotalRefund(Optional totalRefund) { + Utils.checkNotNull(totalRefund, "totalRefund"); + this.totalRefund = totalRefund; + return this; + } + + /** + * Total amount of tax applied to the order. + */ + public CommerceOrder withTotalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + /** + * Total amount of tax applied to the order. + */ + public CommerceOrder withTotalTaxAmount(Optional totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceOrder other = (CommerceOrder) o; + return + java.util.Objects.deepEquals(this.closedDate, other.closedDate) && + java.util.Objects.deepEquals(this.country, other.country) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.locationRef, other.locationRef) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.orderLineItems, other.orderLineItems) && + java.util.Objects.deepEquals(this.orderNumber, other.orderNumber) && + java.util.Objects.deepEquals(this.payments, other.payments) && + java.util.Objects.deepEquals(this.serviceCharges, other.serviceCharges) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.totalDiscount, other.totalDiscount) && + java.util.Objects.deepEquals(this.totalGratuity, other.totalGratuity) && + java.util.Objects.deepEquals(this.totalRefund, other.totalRefund) && + java.util.Objects.deepEquals(this.totalTaxAmount, other.totalTaxAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + closedDate, + country, + createdDate, + currency, + customerRef, + id, + locationRef, + modifiedDate, + orderLineItems, + orderNumber, + payments, + serviceCharges, + sourceModifiedDate, + supplementalData, + totalAmount, + totalDiscount, + totalGratuity, + totalRefund, + totalTaxAmount); + } + + @Override + public String toString() { + return Utils.toString(CommerceOrder.class, + "closedDate", closedDate, + "country", country, + "createdDate", createdDate, + "currency", currency, + "customerRef", customerRef, + "id", id, + "locationRef", locationRef, + "modifiedDate", modifiedDate, + "orderLineItems", orderLineItems, + "orderNumber", orderNumber, + "payments", payments, + "serviceCharges", serviceCharges, + "sourceModifiedDate", sourceModifiedDate, + "supplementalData", supplementalData, + "totalAmount", totalAmount, + "totalDiscount", totalDiscount, + "totalGratuity", totalGratuity, + "totalRefund", totalRefund, + "totalTaxAmount", totalTaxAmount); + } + + public final static class Builder { + + private Optional closedDate = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional createdDate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional customerRef = Optional.empty(); + + private String id; + + private Optional locationRef = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional> orderLineItems = Optional.empty(); + + private Optional orderNumber = Optional.empty(); + + private Optional> payments = Optional.empty(); + + private Optional> serviceCharges = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional totalDiscount = Optional.empty(); + + private Optional totalGratuity = Optional.empty(); + + private Optional totalRefund = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 closedDate(String closedDate) { + Utils.checkNotNull(closedDate, "closedDate"); + this.closedDate = Optional.ofNullable(closedDate); + 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 closedDate(Optional closedDate) { + Utils.checkNotNull(closedDate, "closedDate"); + this.closedDate = closedDate; + return this; + } + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + public Builder country(String country) { + Utils.checkNotNull(country, "country"); + this.country = Optional.ofNullable(country); + return this; + } + + /** + * The Codat country property is returned as it was provided in the underlying platform by the company without any formatting on our part. + * + * Depending on the platform the value of this property will either be an <a href="https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes" target="_blank">ISO 3166</a> code (2-alpha or 3-alpha) or free-form text returned as a string name in our model. + * + * For POST operations against platforms that demand a specific format for the country code, we have documented accepted values in the [options](https://docs.codat.io/lending-api#/operations/get-companies-companyId-connections-connectionId-push) endpoint. + */ + public Builder country(Optional country) { + Utils.checkNotNull(country, "country"); + this.country = country; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Reference to the customer that placed the order. + */ + public Builder customerRef(CommerceCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + /** + * Reference to the customer that placed the order. + */ + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Builder locationRef(LocationRef locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = Optional.ofNullable(locationRef); + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Builder locationRef(Optional locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = locationRef; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + public Builder orderLineItems(java.util.List orderLineItems) { + Utils.checkNotNull(orderLineItems, "orderLineItems"); + this.orderLineItems = Optional.ofNullable(orderLineItems); + return this; + } + + public Builder orderLineItems(Optional> orderLineItems) { + Utils.checkNotNull(orderLineItems, "orderLineItems"); + this.orderLineItems = orderLineItems; + return this; + } + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + public Builder orderNumber(String orderNumber) { + Utils.checkNotNull(orderNumber, "orderNumber"); + this.orderNumber = Optional.ofNullable(orderNumber); + return this; + } + + /** + * Friendly reference for the order in the commerce or point of sale platform. + */ + public Builder orderNumber(Optional orderNumber) { + Utils.checkNotNull(orderNumber, "orderNumber"); + this.orderNumber = orderNumber; + return this; + } + + public Builder payments(java.util.List payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = Optional.ofNullable(payments); + return this; + } + + public Builder payments(Optional> payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = payments; + return this; + } + + public Builder serviceCharges(java.util.List serviceCharges) { + Utils.checkNotNull(serviceCharges, "serviceCharges"); + this.serviceCharges = Optional.ofNullable(serviceCharges); + return this; + } + + public Builder serviceCharges(Optional> serviceCharges) { + Utils.checkNotNull(serviceCharges, "serviceCharges"); + this.serviceCharges = serviceCharges; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + public Builder totalDiscount(double totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = Optional.ofNullable(totalDiscount); + return this; + } + + /** + * Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). + */ + public Builder totalDiscount(Optional totalDiscount) { + Utils.checkNotNull(totalDiscount, "totalDiscount"); + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Extra amount added to the order. + */ + public Builder totalGratuity(double totalGratuity) { + Utils.checkNotNull(totalGratuity, "totalGratuity"); + this.totalGratuity = Optional.ofNullable(totalGratuity); + return this; + } + + /** + * Extra amount added to the order. + */ + public Builder totalGratuity(Optional totalGratuity) { + Utils.checkNotNull(totalGratuity, "totalGratuity"); + this.totalGratuity = totalGratuity; + return this; + } + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + public Builder totalRefund(double totalRefund) { + Utils.checkNotNull(totalRefund, "totalRefund"); + this.totalRefund = Optional.ofNullable(totalRefund); + return this; + } + + /** + * Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. + */ + public Builder totalRefund(Optional totalRefund) { + Utils.checkNotNull(totalRefund, "totalRefund"); + this.totalRefund = totalRefund; + return this; + } + + /** + * Total amount of tax applied to the order. + */ + public Builder totalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + /** + * Total amount of tax applied to the order. + */ + public Builder totalTaxAmount(Optional totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + public CommerceOrder build() { + return new CommerceOrder( + closedDate, + country, + createdDate, + currency, + customerRef, + id, + locationRef, + modifiedDate, + orderLineItems, + orderNumber, + payments, + serviceCharges, + sourceModifiedDate, + supplementalData, + totalAmount, + totalDiscount, + totalGratuity, + totalRefund, + totalTaxAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrders.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrders.java new file mode 100644 index 00000000..ef3496f8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceOrders.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceOrders { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceOrders( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceOrders withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceOrders withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceOrders withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceOrders withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceOrders withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceOrders withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceOrders other = (CommerceOrders) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceOrders.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceOrders build() { + return new CommerceOrders( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayment.java new file mode 100644 index 00000000..90b7b74e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayment.java @@ -0,0 +1,924 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommercePayment - Payments contain details of all payments made by customers to a company, including: amounts, currency used, payment method, payment provider, and payment status. + * + * Refunds are recorded as separate, negative payments. Note that a refund can only occur in relation to a payment that has been completed (i.e. has a status of `Paid`). When a customer cancels an order _before_ a payment has been completed, the payment shows as `Cancelled`. + * + * You can use data from the Payments endpoints to calculate key metrics, such as gross sales and monthly recurring revenue (MRR). + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-payments) for this data type. + */ + +public class CommercePayment { + + /** + * Payment Amount (including gratuity) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentMethodRef") + private Optional paymentMethodRef; + + /** + * Service provider of the payment, if applicable. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentProvider") + private Optional paymentProvider; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + public CommercePayment( + @JsonProperty("amount") Optional amount, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("currency") Optional currency, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("paymentMethodRef") Optional paymentMethodRef, + @JsonProperty("paymentProvider") Optional paymentProvider, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("supplementalData") Optional supplementalData) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + Utils.checkNotNull(paymentProvider, "paymentProvider"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(supplementalData, "supplementalData"); + this.amount = amount; + this.createdDate = createdDate; + this.currency = currency; + this.dueDate = dueDate; + this.id = id; + this.modifiedDate = modifiedDate; + this.paymentMethodRef = paymentMethodRef; + this.paymentProvider = paymentProvider; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.supplementalData = supplementalData; + } + + /** + * Payment Amount (including gratuity) + */ + public Optional amount() { + return amount; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * 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 Optional dueDate() { + return dueDate; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Optional paymentMethodRef() { + return paymentMethodRef; + } + + /** + * Service provider of the payment, if applicable. + */ + public Optional paymentProvider() { + return paymentProvider; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the payment. + */ + public Optional status() { + return status; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Payment Amount (including gratuity) + */ + public CommercePayment withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Payment Amount (including gratuity) + */ + public CommercePayment withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 CommercePayment withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommercePayment withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommercePayment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommercePayment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 CommercePayment withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 CommercePayment withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommercePayment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommercePayment withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommercePayment withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public CommercePayment withPaymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public CommercePayment withPaymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public CommercePayment withPaymentProvider(String paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = Optional.ofNullable(paymentProvider); + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public CommercePayment withPaymentProvider(Optional paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = paymentProvider; + return this; + } + + public CommercePayment withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommercePayment withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the payment. + */ + public CommercePayment withStatus(PaymentStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the payment. + */ + public CommercePayment withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommercePayment withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommercePayment withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommercePayment other = (CommercePayment) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.paymentMethodRef, other.paymentMethodRef) && + java.util.Objects.deepEquals(this.paymentProvider, other.paymentProvider) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + createdDate, + currency, + dueDate, + id, + modifiedDate, + paymentMethodRef, + paymentProvider, + sourceModifiedDate, + status, + supplementalData); + } + + @Override + public String toString() { + return Utils.toString(CommercePayment.class, + "amount", amount, + "createdDate", createdDate, + "currency", currency, + "dueDate", dueDate, + "id", id, + "modifiedDate", modifiedDate, + "paymentMethodRef", paymentMethodRef, + "paymentProvider", paymentProvider, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "supplementalData", supplementalData); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional createdDate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional paymentMethodRef = Optional.empty(); + + private Optional paymentProvider = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Payment Amount (including gratuity) + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Payment Amount (including gratuity) + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(PaymentMethodRef paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = Optional.ofNullable(paymentMethodRef); + return this; + } + + /** + * The payment method the record is linked to in the accounting or commerce platform. + */ + public Builder paymentMethodRef(Optional paymentMethodRef) { + Utils.checkNotNull(paymentMethodRef, "paymentMethodRef"); + this.paymentMethodRef = paymentMethodRef; + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public Builder paymentProvider(String paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = Optional.ofNullable(paymentProvider); + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public Builder paymentProvider(Optional paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = paymentProvider; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the payment. + */ + public Builder status(PaymentStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the payment. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public CommercePayment build() { + return new CommercePayment( + amount, + createdDate, + currency, + dueDate, + id, + modifiedDate, + paymentMethodRef, + paymentProvider, + sourceModifiedDate, + status, + supplementalData); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethod.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethod.java new file mode 100644 index 00000000..2287a556 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethod.java @@ -0,0 +1,302 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommercePaymentMethod - A Payment Method represents the payment method(s) used to make payments. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-paymentMethods) for this data type. + */ + +public class CommercePaymentMethod { + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * The name of the PaymentMethod + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the Payment Method. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + public CommercePaymentMethod( + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") Optional name, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + this.id = id; + this.modifiedDate = modifiedDate; + this.name = name; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * The name of the PaymentMethod + */ + public Optional name() { + return name; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the Payment Method. + */ + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A unique, persistent identifier for this record + */ + public CommercePaymentMethod withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommercePaymentMethod withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommercePaymentMethod withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the PaymentMethod + */ + public CommercePaymentMethod withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The name of the PaymentMethod + */ + public CommercePaymentMethod withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public CommercePaymentMethod withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommercePaymentMethod withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the Payment Method. + */ + public CommercePaymentMethod withStatus(CommercePaymentMethodStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the Payment Method. + */ + public CommercePaymentMethod withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommercePaymentMethod other = (CommercePaymentMethod) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + modifiedDate, + name, + sourceModifiedDate, + status); + } + + @Override + public String toString() { + return Utils.toString(CommercePaymentMethod.class, + "id", id, + "modifiedDate", modifiedDate, + "name", name, + "sourceModifiedDate", sourceModifiedDate, + "status", status); + } + + public final static class Builder { + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the PaymentMethod + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The name of the PaymentMethod + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the Payment Method. + */ + public Builder status(CommercePaymentMethodStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the Payment Method. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public CommercePaymentMethod build() { + return new CommercePaymentMethod( + id, + modifiedDate, + name, + sourceModifiedDate, + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethodStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethodStatus.java new file mode 100644 index 00000000..dbf40bc9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethodStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * CommercePaymentMethodStatus - Status of the Payment Method. + */ +public enum CommercePaymentMethodStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"); + + @JsonValue + private final String value; + + private CommercePaymentMethodStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethods.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethods.java new file mode 100644 index 00000000..e4b8b878 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePaymentMethods.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommercePaymentMethods { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommercePaymentMethods( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommercePaymentMethods withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommercePaymentMethods withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommercePaymentMethods withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommercePaymentMethods withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommercePaymentMethods withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommercePaymentMethods withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommercePaymentMethods other = (CommercePaymentMethods) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommercePaymentMethods.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommercePaymentMethods build() { + return new CommercePaymentMethods( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayments.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayments.java new file mode 100644 index 00000000..321a59ec --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommercePayments.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommercePayments { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommercePayments( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommercePayments withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommercePayments withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommercePayments withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommercePayments withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommercePayments withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommercePayments withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommercePayments other = (CommercePayments) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommercePayments.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommercePayments build() { + return new CommercePayments( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProduct.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProduct.java new file mode 100644 index 00000000..33663a7e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProduct.java @@ -0,0 +1,463 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceProduct - A Product is an item in the company's inventory, and includes information about the price and quantity of all products, and variants thereof, available for sale. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-products) for this data type. + * + */ + +public class CommerceProduct { + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("categorization") + private Optional categorization; + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isGiftCard") + private Optional isGiftCard; + + /** + * Name of the product in the commerce or POS system + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("variants") + private Optional> variants; + + public CommerceProduct( + @JsonProperty("categorization") Optional categorization, + @JsonProperty("description") Optional description, + @JsonProperty("id") String id, + @JsonProperty("isGiftCard") Optional isGiftCard, + @JsonProperty("name") Optional name, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("variants") Optional> variants) { + Utils.checkNotNull(categorization, "categorization"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(isGiftCard, "isGiftCard"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(variants, "variants"); + this.categorization = categorization; + this.description = description; + this.id = id; + this.isGiftCard = isGiftCard; + this.name = name; + this.supplementalData = supplementalData; + this.variants = variants; + } + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + public Optional categorization() { + return categorization; + } + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + public Optional description() { + return description; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + public Optional isGiftCard() { + return isGiftCard; + } + + /** + * Name of the product in the commerce or POS system + */ + public Optional name() { + return name; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + public Optional> variants() { + return variants; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + public CommerceProduct withCategorization(String categorization) { + Utils.checkNotNull(categorization, "categorization"); + this.categorization = Optional.ofNullable(categorization); + return this; + } + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + public CommerceProduct withCategorization(Optional categorization) { + Utils.checkNotNull(categorization, "categorization"); + this.categorization = categorization; + return this; + } + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + public CommerceProduct withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + public CommerceProduct withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceProduct withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + public CommerceProduct withIsGiftCard(boolean isGiftCard) { + Utils.checkNotNull(isGiftCard, "isGiftCard"); + this.isGiftCard = Optional.ofNullable(isGiftCard); + return this; + } + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + public CommerceProduct withIsGiftCard(Optional isGiftCard) { + Utils.checkNotNull(isGiftCard, "isGiftCard"); + this.isGiftCard = isGiftCard; + return this; + } + + /** + * Name of the product in the commerce or POS system + */ + public CommerceProduct withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product in the commerce or POS system + */ + public CommerceProduct withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceProduct withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceProduct withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public CommerceProduct withVariants(java.util.List variants) { + Utils.checkNotNull(variants, "variants"); + this.variants = Optional.ofNullable(variants); + return this; + } + + public CommerceProduct withVariants(Optional> variants) { + Utils.checkNotNull(variants, "variants"); + this.variants = variants; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceProduct other = (CommerceProduct) o; + return + java.util.Objects.deepEquals(this.categorization, other.categorization) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.isGiftCard, other.isGiftCard) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.variants, other.variants); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + categorization, + description, + id, + isGiftCard, + name, + supplementalData, + variants); + } + + @Override + public String toString() { + return Utils.toString(CommerceProduct.class, + "categorization", categorization, + "description", description, + "id", id, + "isGiftCard", isGiftCard, + "name", name, + "supplementalData", supplementalData, + "variants", variants); + } + + public final static class Builder { + + private Optional categorization = Optional.empty(); + + private Optional description = Optional.empty(); + + private String id; + + private Optional isGiftCard = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional> variants = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + public Builder categorization(String categorization) { + Utils.checkNotNull(categorization, "categorization"); + this.categorization = Optional.ofNullable(categorization); + return this; + } + + /** + * Retail category that the product is assigned to e.g. `Hardware`. + */ + public Builder categorization(Optional categorization) { + Utils.checkNotNull(categorization, "categorization"); + this.categorization = categorization; + return this; + } + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description of the product recorded in the commerce or point of sale platform. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + public Builder isGiftCard(boolean isGiftCard) { + Utils.checkNotNull(isGiftCard, "isGiftCard"); + this.isGiftCard = Optional.ofNullable(isGiftCard); + return this; + } + + /** + * Whether the product represents a gift card or voucher that + * can be redeemed in the commerce or POS platform. + * + */ + public Builder isGiftCard(Optional isGiftCard) { + Utils.checkNotNull(isGiftCard, "isGiftCard"); + this.isGiftCard = isGiftCard; + return this; + } + + /** + * Name of the product in the commerce or POS system + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product in the commerce or POS system + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + public Builder variants(java.util.List variants) { + Utils.checkNotNull(variants, "variants"); + this.variants = Optional.ofNullable(variants); + return this; + } + + public Builder variants(Optional> variants) { + Utils.checkNotNull(variants, "variants"); + this.variants = variants; + return this; + } + + public CommerceProduct build() { + return new CommerceProduct( + categorization, + description, + id, + isGiftCard, + name, + supplementalData, + variants); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategories.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategories.java new file mode 100644 index 00000000..2f3d2449 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategories.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceProductCategories { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceProductCategories( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceProductCategories withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceProductCategories withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceProductCategories withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceProductCategories withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceProductCategories withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceProductCategories withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceProductCategories other = (CommerceProductCategories) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceProductCategories.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceProductCategories build() { + return new CommerceProductCategories( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategory.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategory.java new file mode 100644 index 00000000..a9f053e4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProductCategory.java @@ -0,0 +1,380 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceProductCategory - Product categories are used to classify a group of products together, either by type (e.g. "Furniture"), or sometimes by tax profile. + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-productCategories) for this data type. + */ + +public class CommerceProductCategory { + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ancestorRefs") + private Optional> ancestorRefs; + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hasChildren") + private Optional hasChildren; + + /** + * The unique identifier of the product category + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * The name of the product category + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + public CommerceProductCategory( + @JsonProperty("ancestorRefs") Optional> ancestorRefs, + @JsonProperty("hasChildren") Optional hasChildren, + @JsonProperty("id") Optional id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") Optional name, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate) { + Utils.checkNotNull(ancestorRefs, "ancestorRefs"); + Utils.checkNotNull(hasChildren, "hasChildren"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.ancestorRefs = ancestorRefs; + this.hasChildren = hasChildren; + this.id = id; + this.modifiedDate = modifiedDate; + this.name = name; + this.sourceModifiedDate = sourceModifiedDate; + } + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + public Optional> ancestorRefs() { + return ancestorRefs; + } + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + public Optional hasChildren() { + return hasChildren; + } + + /** + * The unique identifier of the product category + */ + public Optional id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * The name of the product category + */ + public Optional name() { + return name; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + public CommerceProductCategory withAncestorRefs(java.util.List ancestorRefs) { + Utils.checkNotNull(ancestorRefs, "ancestorRefs"); + this.ancestorRefs = Optional.ofNullable(ancestorRefs); + return this; + } + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + public CommerceProductCategory withAncestorRefs(Optional> ancestorRefs) { + Utils.checkNotNull(ancestorRefs, "ancestorRefs"); + this.ancestorRefs = ancestorRefs; + return this; + } + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + public CommerceProductCategory withHasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + public CommerceProductCategory withHasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * The unique identifier of the product category + */ + public CommerceProductCategory withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The unique identifier of the product category + */ + public CommerceProductCategory withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommerceProductCategory withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceProductCategory withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the product category + */ + public CommerceProductCategory withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The name of the product category + */ + public CommerceProductCategory withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public CommerceProductCategory withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceProductCategory withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceProductCategory other = (CommerceProductCategory) o; + return + java.util.Objects.deepEquals(this.ancestorRefs, other.ancestorRefs) && + java.util.Objects.deepEquals(this.hasChildren, other.hasChildren) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + ancestorRefs, + hasChildren, + id, + modifiedDate, + name, + sourceModifiedDate); + } + + @Override + public String toString() { + return Utils.toString(CommerceProductCategory.class, + "ancestorRefs", ancestorRefs, + "hasChildren", hasChildren, + "id", id, + "modifiedDate", modifiedDate, + "name", name, + "sourceModifiedDate", sourceModifiedDate); + } + + public final static class Builder { + + private Optional> ancestorRefs = Optional.empty(); + + private Optional hasChildren = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + public Builder ancestorRefs(java.util.List ancestorRefs) { + Utils.checkNotNull(ancestorRefs, "ancestorRefs"); + this.ancestorRefs = Optional.ofNullable(ancestorRefs); + return this; + } + + /** + * A collection of parent product categories implicitly ordered with the immediate parent last in the list. + */ + public Builder ancestorRefs(Optional> ancestorRefs) { + Utils.checkNotNull(ancestorRefs, "ancestorRefs"); + this.ancestorRefs = ancestorRefs; + return this; + } + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + public Builder hasChildren(boolean hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = Optional.ofNullable(hasChildren); + return this; + } + + /** + * A boolean indicating whether there are other product categories beneath this one in the hierarchy. + */ + public Builder hasChildren(Optional hasChildren) { + Utils.checkNotNull(hasChildren, "hasChildren"); + this.hasChildren = hasChildren; + return this; + } + + /** + * The unique identifier of the product category + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The unique identifier of the product category + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The name of the product category + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * The name of the product category + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + public CommerceProductCategory build() { + return new CommerceProductCategory( + ancestorRefs, + hasChildren, + id, + modifiedDate, + name, + sourceModifiedDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProducts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProducts.java new file mode 100644 index 00000000..0f35d3ed --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceProducts.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceProducts { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceProducts( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceProducts withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceProducts withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceProducts withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceProducts withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceProducts withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceProducts withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceProducts other = (CommerceProducts) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceProducts.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceProducts build() { + return new CommerceProducts( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceRecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceRecordRef.java new file mode 100644 index 00000000..421e2260 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceRecordRef.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class CommerceRecordRef { + + /** + * The unique identitifer of the record being referenced + */ + @JsonProperty("id") + private String id; + + /** + * The type of record being referenced. + */ + @JsonProperty("type") + private String type; + + public CommerceRecordRef( + @JsonProperty("id") String id, + @JsonProperty("type") String type) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.id = id; + this.type = type; + } + + /** + * The unique identitifer of the record being referenced + */ + public String id() { + return id; + } + + /** + * The type of record being referenced. + */ + public String type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identitifer of the record being referenced + */ + public CommerceRecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of record being referenced. + */ + public CommerceRecordRef withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceRecordRef other = (CommerceRecordRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + type); + } + + @Override + public String toString() { + return Utils.toString(CommerceRecordRef.class, + "id", id, + "type", type); + } + + public final static class Builder { + + private String id; + + private String type; + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identitifer of the record being referenced + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of record being referenced. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public CommerceRecordRef build() { + return new CommerceRecordRef( + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReport.java new file mode 100644 index 00000000..042056fa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReport.java @@ -0,0 +1,305 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceReport - ## Structure + * + * Assess reports follow a consistent structure. Reports contain four sections of information: + * + * ### 1. Report definition + * + * Information such as: + * + * 1. The report info (e.g. enhanced_profit_and_loss). + * 2. The display name of the report (e.g. Enhanced Profit and Loss). + * + * ### 2. Dimension info + * + * Information about the dimension contained in the reports such as: + * + * 1. The type of dimension (e.g. datetime, recordRef). + * 2. The display name of the dimension (e.g. Period, Category type, Category sub type). + * 3. The details about each item within the dimension (e.g. displayName:"Jan 2022", start:"...", end:"...", id:"...", name:"..."). + * + * ### 3. Measure info + * + * Information about the measures contained in the report such as: + * + * 1. The display name of the measure (e.g. value of account, percentage change). + * 2. The type of the measure (e.g. currency, percentage). + * 3. The unit of the measure (e.g. %, GBP). + * + * ### 4. The data for the report + * + * When the *includeDisplayName* parameter is set to *true*, it shows the *dimensionDisplayName* and *itemDisplayName* to make the data human-readable. The default setting for *includeDisplayName* is *false*. + * + * + * ## Displaying the report + * + * Reports can be rendered as follows (ordering is implicit rather than explicit): + * + * ![A table showing an example of how a report can be rendered](https://files.readme.io/1fa20ca-Report1.png) + * + * # Data model + * + * ## Dimensions + */ + +public class CommerceReport { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dimensions") + private Optional> dimensions; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("measures") + private Optional> measures; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportData") + private Optional> reportData; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional> reportInfo; + + public CommerceReport( + @JsonProperty("dimensions") Optional> dimensions, + @JsonProperty("errors") Optional> errors, + @JsonProperty("measures") Optional> measures, + @JsonProperty("reportData") Optional> reportData, + @JsonProperty("reportInfo") Optional> reportInfo) { + Utils.checkNotNull(dimensions, "dimensions"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(measures, "measures"); + Utils.checkNotNull(reportData, "reportData"); + Utils.checkNotNull(reportInfo, "reportInfo"); + this.dimensions = dimensions; + this.errors = errors; + this.measures = measures; + this.reportData = reportData; + this.reportInfo = reportInfo; + } + + public Optional> dimensions() { + return dimensions; + } + + public Optional> errors() { + return errors; + } + + public Optional> measures() { + return measures; + } + + public Optional> reportData() { + return reportData; + } + + public Optional> reportInfo() { + return reportInfo; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceReport withDimensions(java.util.List dimensions) { + Utils.checkNotNull(dimensions, "dimensions"); + this.dimensions = Optional.ofNullable(dimensions); + return this; + } + + public CommerceReport withDimensions(Optional> dimensions) { + Utils.checkNotNull(dimensions, "dimensions"); + this.dimensions = dimensions; + return this; + } + + public CommerceReport withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public CommerceReport withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public CommerceReport withMeasures(java.util.List measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = Optional.ofNullable(measures); + return this; + } + + public CommerceReport withMeasures(Optional> measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = measures; + return this; + } + + public CommerceReport withReportData(java.util.List reportData) { + Utils.checkNotNull(reportData, "reportData"); + this.reportData = Optional.ofNullable(reportData); + return this; + } + + public CommerceReport withReportData(Optional> reportData) { + Utils.checkNotNull(reportData, "reportData"); + this.reportData = reportData; + return this; + } + + public CommerceReport withReportInfo(java.util.Map reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public CommerceReport withReportInfo(Optional> reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReport other = (CommerceReport) o; + return + java.util.Objects.deepEquals(this.dimensions, other.dimensions) && + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.measures, other.measures) && + java.util.Objects.deepEquals(this.reportData, other.reportData) && + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dimensions, + errors, + measures, + reportData, + reportInfo); + } + + @Override + public String toString() { + return Utils.toString(CommerceReport.class, + "dimensions", dimensions, + "errors", errors, + "measures", measures, + "reportData", reportData, + "reportInfo", reportInfo); + } + + public final static class Builder { + + private Optional> dimensions = Optional.empty(); + + private Optional> errors = Optional.empty(); + + private Optional> measures = Optional.empty(); + + private Optional> reportData = Optional.empty(); + + private Optional> reportInfo = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder dimensions(java.util.List dimensions) { + Utils.checkNotNull(dimensions, "dimensions"); + this.dimensions = Optional.ofNullable(dimensions); + return this; + } + + public Builder dimensions(Optional> dimensions) { + Utils.checkNotNull(dimensions, "dimensions"); + this.dimensions = dimensions; + return this; + } + + public Builder errors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public Builder measures(java.util.List measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = Optional.ofNullable(measures); + return this; + } + + public Builder measures(Optional> measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = measures; + return this; + } + + public Builder reportData(java.util.List reportData) { + Utils.checkNotNull(reportData, "reportData"); + this.reportData = Optional.ofNullable(reportData); + return this; + } + + public Builder reportData(Optional> reportData) { + Utils.checkNotNull(reportData, "reportData"); + this.reportData = reportData; + return this; + } + + public Builder reportInfo(java.util.Map reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public Builder reportInfo(Optional> reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + public CommerceReport build() { + return new CommerceReport( + dimensions, + errors, + measures, + reportData, + reportInfo); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportComponent.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportComponent.java new file mode 100644 index 00000000..0dd1a3cf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportComponent.java @@ -0,0 +1,375 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceReportComponent { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("components") + private Optional> components; + + /** + * The component's dimension. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dimension") + private Optional dimension; + + /** + * The component's display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dimensionDisplayName") + private Optional dimensionDisplayName; + + /** + * The component's item number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("item") + private Optional item; + + /** + * The component's item display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemDisplayName") + private Optional itemDisplayName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("measures") + private Optional> measures; + + public CommerceReportComponent( + @JsonProperty("components") Optional> components, + @JsonProperty("dimension") Optional dimension, + @JsonProperty("dimensionDisplayName") Optional dimensionDisplayName, + @JsonProperty("item") Optional item, + @JsonProperty("itemDisplayName") Optional itemDisplayName, + @JsonProperty("measures") Optional> measures) { + Utils.checkNotNull(components, "components"); + Utils.checkNotNull(dimension, "dimension"); + Utils.checkNotNull(dimensionDisplayName, "dimensionDisplayName"); + Utils.checkNotNull(item, "item"); + Utils.checkNotNull(itemDisplayName, "itemDisplayName"); + Utils.checkNotNull(measures, "measures"); + this.components = components; + this.dimension = dimension; + this.dimensionDisplayName = dimensionDisplayName; + this.item = item; + this.itemDisplayName = itemDisplayName; + this.measures = measures; + } + + public Optional> components() { + return components; + } + + /** + * The component's dimension. + */ + public Optional dimension() { + return dimension; + } + + /** + * The component's display name. + */ + public Optional dimensionDisplayName() { + return dimensionDisplayName; + } + + /** + * The component's item number. + */ + public Optional item() { + return item; + } + + /** + * The component's item display name. + */ + public Optional itemDisplayName() { + return itemDisplayName; + } + + public Optional> measures() { + return measures; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceReportComponent withComponents(java.util.List components) { + Utils.checkNotNull(components, "components"); + this.components = Optional.ofNullable(components); + return this; + } + + public CommerceReportComponent withComponents(Optional> components) { + Utils.checkNotNull(components, "components"); + this.components = components; + return this; + } + + /** + * The component's dimension. + */ + public CommerceReportComponent withDimension(long dimension) { + Utils.checkNotNull(dimension, "dimension"); + this.dimension = Optional.ofNullable(dimension); + return this; + } + + /** + * The component's dimension. + */ + public CommerceReportComponent withDimension(Optional dimension) { + Utils.checkNotNull(dimension, "dimension"); + this.dimension = dimension; + return this; + } + + /** + * The component's display name. + */ + public CommerceReportComponent withDimensionDisplayName(String dimensionDisplayName) { + Utils.checkNotNull(dimensionDisplayName, "dimensionDisplayName"); + this.dimensionDisplayName = Optional.ofNullable(dimensionDisplayName); + return this; + } + + /** + * The component's display name. + */ + public CommerceReportComponent withDimensionDisplayName(Optional dimensionDisplayName) { + Utils.checkNotNull(dimensionDisplayName, "dimensionDisplayName"); + this.dimensionDisplayName = dimensionDisplayName; + return this; + } + + /** + * The component's item number. + */ + public CommerceReportComponent withItem(long item) { + Utils.checkNotNull(item, "item"); + this.item = Optional.ofNullable(item); + return this; + } + + /** + * The component's item number. + */ + public CommerceReportComponent withItem(Optional item) { + Utils.checkNotNull(item, "item"); + this.item = item; + return this; + } + + /** + * The component's item display name. + */ + public CommerceReportComponent withItemDisplayName(String itemDisplayName) { + Utils.checkNotNull(itemDisplayName, "itemDisplayName"); + this.itemDisplayName = Optional.ofNullable(itemDisplayName); + return this; + } + + /** + * The component's item display name. + */ + public CommerceReportComponent withItemDisplayName(Optional itemDisplayName) { + Utils.checkNotNull(itemDisplayName, "itemDisplayName"); + this.itemDisplayName = itemDisplayName; + return this; + } + + public CommerceReportComponent withMeasures(java.util.List measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = Optional.ofNullable(measures); + return this; + } + + public CommerceReportComponent withMeasures(Optional> measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = measures; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReportComponent other = (CommerceReportComponent) o; + return + java.util.Objects.deepEquals(this.components, other.components) && + java.util.Objects.deepEquals(this.dimension, other.dimension) && + java.util.Objects.deepEquals(this.dimensionDisplayName, other.dimensionDisplayName) && + java.util.Objects.deepEquals(this.item, other.item) && + java.util.Objects.deepEquals(this.itemDisplayName, other.itemDisplayName) && + java.util.Objects.deepEquals(this.measures, other.measures); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + components, + dimension, + dimensionDisplayName, + item, + itemDisplayName, + measures); + } + + @Override + public String toString() { + return Utils.toString(CommerceReportComponent.class, + "components", components, + "dimension", dimension, + "dimensionDisplayName", dimensionDisplayName, + "item", item, + "itemDisplayName", itemDisplayName, + "measures", measures); + } + + public final static class Builder { + + private Optional> components = Optional.empty(); + + private Optional dimension = Optional.empty(); + + private Optional dimensionDisplayName = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional itemDisplayName = Optional.empty(); + + private Optional> measures = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder components(java.util.List components) { + Utils.checkNotNull(components, "components"); + this.components = Optional.ofNullable(components); + return this; + } + + public Builder components(Optional> components) { + Utils.checkNotNull(components, "components"); + this.components = components; + return this; + } + + /** + * The component's dimension. + */ + public Builder dimension(long dimension) { + Utils.checkNotNull(dimension, "dimension"); + this.dimension = Optional.ofNullable(dimension); + return this; + } + + /** + * The component's dimension. + */ + public Builder dimension(Optional dimension) { + Utils.checkNotNull(dimension, "dimension"); + this.dimension = dimension; + return this; + } + + /** + * The component's display name. + */ + public Builder dimensionDisplayName(String dimensionDisplayName) { + Utils.checkNotNull(dimensionDisplayName, "dimensionDisplayName"); + this.dimensionDisplayName = Optional.ofNullable(dimensionDisplayName); + return this; + } + + /** + * The component's display name. + */ + public Builder dimensionDisplayName(Optional dimensionDisplayName) { + Utils.checkNotNull(dimensionDisplayName, "dimensionDisplayName"); + this.dimensionDisplayName = dimensionDisplayName; + return this; + } + + /** + * The component's item number. + */ + public Builder item(long item) { + Utils.checkNotNull(item, "item"); + this.item = Optional.ofNullable(item); + return this; + } + + /** + * The component's item number. + */ + public Builder item(Optional item) { + Utils.checkNotNull(item, "item"); + this.item = item; + return this; + } + + /** + * The component's item display name. + */ + public Builder itemDisplayName(String itemDisplayName) { + Utils.checkNotNull(itemDisplayName, "itemDisplayName"); + this.itemDisplayName = Optional.ofNullable(itemDisplayName); + return this; + } + + /** + * The component's item display name. + */ + public Builder itemDisplayName(Optional itemDisplayName) { + Utils.checkNotNull(itemDisplayName, "itemDisplayName"); + this.itemDisplayName = itemDisplayName; + return this; + } + + public Builder measures(java.util.List measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = Optional.ofNullable(measures); + return this; + } + + public Builder measures(Optional> measures) { + Utils.checkNotNull(measures, "measures"); + this.measures = measures; + return this; + } + + public CommerceReportComponent build() { + return new CommerceReportComponent( + components, + dimension, + dimensionDisplayName, + item, + itemDisplayName, + measures); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimension.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimension.java new file mode 100644 index 00000000..019acfea --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimension.java @@ -0,0 +1,275 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceReportDimension { + + /** + * The dimension's display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("displayName") + private Optional displayName; + + /** + * The dimension's index. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("items") + private Optional> items; + + /** + * The dimension's type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public CommerceReportDimension( + @JsonProperty("displayName") Optional displayName, + @JsonProperty("index") Optional index, + @JsonProperty("items") Optional> items, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(items, "items"); + Utils.checkNotNull(type, "type"); + this.displayName = displayName; + this.index = index; + this.items = items; + this.type = type; + } + + /** + * The dimension's display name. + */ + public Optional displayName() { + return displayName; + } + + /** + * The dimension's index. + */ + public Optional index() { + return index; + } + + public Optional> items() { + return items; + } + + /** + * The dimension's type. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The dimension's display name. + */ + public CommerceReportDimension withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The dimension's display name. + */ + public CommerceReportDimension withDisplayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The dimension's index. + */ + public CommerceReportDimension withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The dimension's index. + */ + public CommerceReportDimension withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public CommerceReportDimension withItems(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = Optional.ofNullable(items); + return this; + } + + public CommerceReportDimension withItems(Optional> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * The dimension's type. + */ + public CommerceReportDimension withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The dimension's type. + */ + public CommerceReportDimension withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReportDimension other = (CommerceReportDimension) o; + return + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.index, other.index) && + java.util.Objects.deepEquals(this.items, other.items) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + displayName, + index, + items, + type); + } + + @Override + public String toString() { + return Utils.toString(CommerceReportDimension.class, + "displayName", displayName, + "index", index, + "items", items, + "type", type); + } + + public final static class Builder { + + private Optional displayName = Optional.empty(); + + private Optional index = Optional.empty(); + + private Optional> items = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The dimension's display name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The dimension's display name. + */ + public Builder displayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The dimension's index. + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The dimension's index. + */ + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public Builder items(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = Optional.ofNullable(items); + return this; + } + + public Builder items(Optional> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * The dimension's type. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The dimension's type. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public CommerceReportDimension build() { + return new CommerceReportDimension( + displayName, + index, + items, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimensionItems.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimensionItems.java new file mode 100644 index 00000000..418f0884 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportDimensionItems.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceReportDimensionItems { + + /** + * The dimension's items index. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + public CommerceReportDimensionItems( + @JsonProperty("index") Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + } + + /** + * The dimension's items index. + */ + public Optional index() { + return index; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The dimension's items index. + */ + public CommerceReportDimensionItems withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The dimension's items index. + */ + public CommerceReportDimensionItems withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReportDimensionItems other = (CommerceReportDimensionItems) o; + return + java.util.Objects.deepEquals(this.index, other.index); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + index); + } + + @Override + public String toString() { + return Utils.toString(CommerceReportDimensionItems.class, + "index", index); + } + + public final static class Builder { + + private Optional index = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The dimension's items index. + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The dimension's items index. + */ + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + public CommerceReportDimensionItems build() { + return new CommerceReportDimensionItems( + index); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportError.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportError.java new file mode 100644 index 00000000..51938dc4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportError.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceReportError { + + /** + * Additional details on the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("details") + private Optional>> details; + + /** + * Message returned by error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private Optional message; + + /** + * The type of error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public CommerceReportError( + @JsonProperty("details") Optional>> details, + @JsonProperty("message") Optional message, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(details, "details"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(type, "type"); + this.details = details; + this.message = message; + this.type = type; + } + + /** + * Additional details on the error. + */ + public Optional>> details() { + return details; + } + + /** + * Message returned by error. + */ + public Optional message() { + return message; + } + + /** + * The type of error. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Additional details on the error. + */ + public CommerceReportError withDetails(java.util.Map> details) { + Utils.checkNotNull(details, "details"); + this.details = Optional.ofNullable(details); + return this; + } + + /** + * Additional details on the error. + */ + public CommerceReportError withDetails(Optional>> details) { + Utils.checkNotNull(details, "details"); + this.details = details; + return this; + } + + /** + * Message returned by error. + */ + public CommerceReportError withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * Message returned by error. + */ + public CommerceReportError withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * The type of error. + */ + public CommerceReportError withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of error. + */ + public CommerceReportError withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReportError other = (CommerceReportError) o; + return + java.util.Objects.deepEquals(this.details, other.details) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + details, + message, + type); + } + + @Override + public String toString() { + return Utils.toString(CommerceReportError.class, + "details", details, + "message", message, + "type", type); + } + + public final static class Builder { + + private Optional>> details = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Additional details on the error. + */ + public Builder details(java.util.Map> details) { + Utils.checkNotNull(details, "details"); + this.details = Optional.ofNullable(details); + return this; + } + + /** + * Additional details on the error. + */ + public Builder details(Optional>> details) { + Utils.checkNotNull(details, "details"); + this.details = details; + return this; + } + + /** + * Message returned by error. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + /** + * Message returned by error. + */ + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * The type of error. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of error. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public CommerceReportError build() { + return new CommerceReportError( + details, + message, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportMeasure.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportMeasure.java new file mode 100644 index 00000000..0f3506d9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceReportMeasure.java @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceReportMeasure { + + /** + * The measure's display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("displayName") + private Optional displayName; + + /** + * The measure's index. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + /** + * The measure's type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The measure's units e.g. percentage (%). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("units") + private Optional units; + + public CommerceReportMeasure( + @JsonProperty("displayName") Optional displayName, + @JsonProperty("index") Optional index, + @JsonProperty("type") Optional type, + @JsonProperty("units") Optional units) { + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(units, "units"); + this.displayName = displayName; + this.index = index; + this.type = type; + this.units = units; + } + + /** + * The measure's display name. + */ + public Optional displayName() { + return displayName; + } + + /** + * The measure's index. + */ + public Optional index() { + return index; + } + + /** + * The measure's type. + */ + public Optional type() { + return type; + } + + /** + * The measure's units e.g. percentage (%). + */ + public Optional units() { + return units; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The measure's display name. + */ + public CommerceReportMeasure withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The measure's display name. + */ + public CommerceReportMeasure withDisplayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The measure's index. + */ + public CommerceReportMeasure withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The measure's index. + */ + public CommerceReportMeasure withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The measure's type. + */ + public CommerceReportMeasure withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The measure's type. + */ + public CommerceReportMeasure withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The measure's units e.g. percentage (%). + */ + public CommerceReportMeasure withUnits(String units) { + Utils.checkNotNull(units, "units"); + this.units = Optional.ofNullable(units); + return this; + } + + /** + * The measure's units e.g. percentage (%). + */ + public CommerceReportMeasure withUnits(Optional units) { + Utils.checkNotNull(units, "units"); + this.units = units; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceReportMeasure other = (CommerceReportMeasure) o; + return + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.index, other.index) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.units, other.units); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + displayName, + index, + type, + units); + } + + @Override + public String toString() { + return Utils.toString(CommerceReportMeasure.class, + "displayName", displayName, + "index", index, + "type", type, + "units", units); + } + + public final static class Builder { + + private Optional displayName = Optional.empty(); + + private Optional index = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional units = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The measure's display name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The measure's display name. + */ + public Builder displayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The measure's index. + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The measure's index. + */ + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The measure's type. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The measure's type. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The measure's units e.g. percentage (%). + */ + public Builder units(String units) { + Utils.checkNotNull(units, "units"); + this.units = Optional.ofNullable(units); + return this; + } + + /** + * The measure's units e.g. percentage (%). + */ + public Builder units(Optional units) { + Utils.checkNotNull(units, "units"); + this.units = units; + return this; + } + + public CommerceReportMeasure build() { + return new CommerceReportMeasure( + displayName, + index, + type, + units); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransaction.java new file mode 100644 index 00000000..b57c4939 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransaction.java @@ -0,0 +1,975 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * CommerceTransaction - Details of all financial transactions recorded in the commerce or point of sale system are added to the Transactions data type. For example, payments, service charges, and fees. + * + * You can use data from the Transactions endpoints to calculate key metrics, such as: + * - Transaction volumes + * - Average transaction volume + * - Average transaction value + * - Returns + * - Payouts + * + * Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-transactions) for this data type. + */ + +public class CommerceTransaction { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceCreatedDate") + private Optional sourceCreatedDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Non-standardised transaction type data from the commerce platform + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subType") + private Optional subType; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * The total transaction amount + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + /** + * Link to the source event which triggered this transaction + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactionSourceRef") + private Optional transactionSourceRef; + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public CommerceTransaction( + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("currency") Optional currency, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("sourceCreatedDate") Optional sourceCreatedDate, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("subType") Optional subType, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("totalAmount") Optional totalAmount, + @JsonProperty("transactionSourceRef") Optional transactionSourceRef, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(sourceCreatedDate, "sourceCreatedDate"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(subType, "subType"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(transactionSourceRef, "transactionSourceRef"); + Utils.checkNotNull(type, "type"); + this.createdDate = createdDate; + this.currency = currency; + this.id = id; + this.modifiedDate = modifiedDate; + this.sourceCreatedDate = sourceCreatedDate; + this.sourceModifiedDate = sourceModifiedDate; + this.subType = subType; + this.supplementalData = supplementalData; + this.totalAmount = totalAmount; + this.transactionSourceRef = transactionSourceRef; + this.type = type; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * 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 Optional sourceCreatedDate() { + return sourceCreatedDate; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Non-standardised transaction type data from the commerce platform + */ + public Optional subType() { + return subType; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * The total transaction amount + */ + public Optional totalAmount() { + return totalAmount; + } + + /** + * Link to the source event which triggered this transaction + */ + public Optional transactionSourceRef() { + return transactionSourceRef; + } + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 CommerceTransaction withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 CommerceTransaction withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommerceTransaction withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public CommerceTransaction withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public CommerceTransaction withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CommerceTransaction withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public CommerceTransaction withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 CommerceTransaction withSourceCreatedDate(String sourceCreatedDate) { + Utils.checkNotNull(sourceCreatedDate, "sourceCreatedDate"); + this.sourceCreatedDate = Optional.ofNullable(sourceCreatedDate); + 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 CommerceTransaction withSourceCreatedDate(Optional sourceCreatedDate) { + Utils.checkNotNull(sourceCreatedDate, "sourceCreatedDate"); + this.sourceCreatedDate = sourceCreatedDate; + return this; + } + + public CommerceTransaction withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public CommerceTransaction withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Non-standardised transaction type data from the commerce platform + */ + public CommerceTransaction withSubType(String subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = Optional.ofNullable(subType); + return this; + } + + /** + * Non-standardised transaction type data from the commerce platform + */ + public CommerceTransaction withSubType(Optional subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = subType; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceTransaction withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public CommerceTransaction withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total transaction amount + */ + public CommerceTransaction withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * The total transaction amount + */ + public CommerceTransaction withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Link to the source event which triggered this transaction + */ + public CommerceTransaction withTransactionSourceRef(TransactionSourceRef transactionSourceRef) { + Utils.checkNotNull(transactionSourceRef, "transactionSourceRef"); + this.transactionSourceRef = Optional.ofNullable(transactionSourceRef); + return this; + } + + /** + * Link to the source event which triggered this transaction + */ + public CommerceTransaction withTransactionSourceRef(Optional transactionSourceRef) { + Utils.checkNotNull(transactionSourceRef, "transactionSourceRef"); + this.transactionSourceRef = transactionSourceRef; + return this; + } + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + public CommerceTransaction withType(TransactionType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + public CommerceTransaction withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceTransaction other = (CommerceTransaction) o; + return + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.sourceCreatedDate, other.sourceCreatedDate) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.subType, other.subType) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.transactionSourceRef, other.transactionSourceRef) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + createdDate, + currency, + id, + modifiedDate, + sourceCreatedDate, + sourceModifiedDate, + subType, + supplementalData, + totalAmount, + transactionSourceRef, + type); + } + + @Override + public String toString() { + return Utils.toString(CommerceTransaction.class, + "createdDate", createdDate, + "currency", currency, + "id", id, + "modifiedDate", modifiedDate, + "sourceCreatedDate", sourceCreatedDate, + "sourceModifiedDate", sourceModifiedDate, + "subType", subType, + "supplementalData", supplementalData, + "totalAmount", totalAmount, + "transactionSourceRef", transactionSourceRef, + "type", type); + } + + public final static class Builder { + + private Optional createdDate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional sourceCreatedDate = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional subType = Optional.empty(); + + private Optional supplementalData = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional transactionSourceRef = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 sourceCreatedDate(String sourceCreatedDate) { + Utils.checkNotNull(sourceCreatedDate, "sourceCreatedDate"); + this.sourceCreatedDate = Optional.ofNullable(sourceCreatedDate); + 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 sourceCreatedDate(Optional sourceCreatedDate) { + Utils.checkNotNull(sourceCreatedDate, "sourceCreatedDate"); + this.sourceCreatedDate = sourceCreatedDate; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Non-standardised transaction type data from the commerce platform + */ + public Builder subType(String subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = Optional.ofNullable(subType); + return this; + } + + /** + * Non-standardised transaction type data from the commerce platform + */ + public Builder subType(Optional subType) { + Utils.checkNotNull(subType, "subType"); + this.subType = subType; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total transaction amount + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * The total transaction amount + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Link to the source event which triggered this transaction + */ + public Builder transactionSourceRef(TransactionSourceRef transactionSourceRef) { + Utils.checkNotNull(transactionSourceRef, "transactionSourceRef"); + this.transactionSourceRef = Optional.ofNullable(transactionSourceRef); + return this; + } + + /** + * Link to the source event which triggered this transaction + */ + public Builder transactionSourceRef(Optional transactionSourceRef) { + Utils.checkNotNull(transactionSourceRef, "transactionSourceRef"); + this.transactionSourceRef = transactionSourceRef; + return this; + } + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + public Builder type(TransactionType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public CommerceTransaction build() { + return new CommerceTransaction( + createdDate, + currency, + id, + modifiedDate, + sourceCreatedDate, + sourceModifiedDate, + subType, + supplementalData, + totalAmount, + transactionSourceRef, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransactions.java new file mode 100644 index 00000000..eed3cf9f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CommerceTransactions.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CommerceTransactions { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public CommerceTransactions( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public CommerceTransactions withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public CommerceTransactions withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public CommerceTransactions withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public CommerceTransactions withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public CommerceTransactions withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public CommerceTransactions withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommerceTransactions other = (CommerceTransactions) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(CommerceTransactions.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public CommerceTransactions build() { + return new CommerceTransactions( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Companies.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Companies.java new file mode 100644 index 00000000..f12fc506 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Companies.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Companies { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public Companies( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public Companies withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Companies withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Companies withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Companies withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Companies withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Companies withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Companies other = (Companies) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(Companies.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public Companies build() { + return new Companies( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Company.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Company.java new file mode 100644 index 00000000..efb3fe90 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Company.java @@ -0,0 +1,808 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * Company - In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + * + * Typically each company is one of your customers. + * + * When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + */ + +public class Company { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created") + private Optional created; + + /** + * Name of user that created the company in Codat. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdByUserName") + private Optional createdByUserName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnections") + private Optional> dataConnections; + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * An array of groups the company has been assigned to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("groups") + private Optional> groups; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("id") + private String id; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastSync") + private Optional lastSync; + + /** + * The name of the company + */ + @JsonProperty("name") + private String name; + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("platform") + @Deprecated + private Optional platform; + + /** + * 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. + */ + @JsonProperty("redirect") + private String redirect; + + public Company( + @JsonProperty("created") Optional created, + @JsonProperty("createdByUserName") Optional createdByUserName, + @JsonProperty("dataConnections") Optional> dataConnections, + @JsonProperty("description") Optional description, + @JsonProperty("groups") Optional> groups, + @JsonProperty("id") String id, + @JsonProperty("lastSync") Optional lastSync, + @JsonProperty("name") String name, + @JsonProperty("platform") Optional platform, + @JsonProperty("redirect") String redirect) { + Utils.checkNotNull(created, "created"); + Utils.checkNotNull(createdByUserName, "createdByUserName"); + Utils.checkNotNull(dataConnections, "dataConnections"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(groups, "groups"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lastSync, "lastSync"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(platform, "platform"); + Utils.checkNotNull(redirect, "redirect"); + this.created = created; + this.createdByUserName = createdByUserName; + this.dataConnections = dataConnections; + this.description = description; + this.groups = groups; + this.id = id; + this.lastSync = lastSync; + this.name = name; + this.platform = platform; + this.redirect = redirect; + } + + /** + * 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 Optional created() { + return created; + } + + /** + * Name of user that created the company in Codat. + */ + public Optional createdByUserName() { + return createdByUserName; + } + + public Optional> dataConnections() { + return dataConnections; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Optional description() { + return description; + } + + /** + * An array of groups the company has been assigned to. + */ + public Optional> groups() { + return groups; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String id() { + return id; + } + + /** + * 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 Optional lastSync() { + return lastSync; + } + + /** + * The name of the company + */ + public String name() { + return name; + } + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Optional platform() { + return platform; + } + + /** + * 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. + */ + public String redirect() { + return redirect; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 Company withCreated(String created) { + Utils.checkNotNull(created, "created"); + this.created = Optional.ofNullable(created); + 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 Company withCreated(Optional created) { + Utils.checkNotNull(created, "created"); + this.created = created; + return this; + } + + /** + * Name of user that created the company in Codat. + */ + public Company withCreatedByUserName(String createdByUserName) { + Utils.checkNotNull(createdByUserName, "createdByUserName"); + this.createdByUserName = Optional.ofNullable(createdByUserName); + return this; + } + + /** + * Name of user that created the company in Codat. + */ + public Company withCreatedByUserName(Optional createdByUserName) { + Utils.checkNotNull(createdByUserName, "createdByUserName"); + this.createdByUserName = createdByUserName; + return this; + } + + public Company withDataConnections(java.util.List dataConnections) { + Utils.checkNotNull(dataConnections, "dataConnections"); + this.dataConnections = Optional.ofNullable(dataConnections); + return this; + } + + public Company withDataConnections(Optional> dataConnections) { + Utils.checkNotNull(dataConnections, "dataConnections"); + this.dataConnections = dataConnections; + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Company withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Company withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * An array of groups the company has been assigned to. + */ + public Company withGroups(java.util.List groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = Optional.ofNullable(groups); + return this; + } + + /** + * An array of groups the company has been assigned to. + */ + public Company withGroups(Optional> groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = groups; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Company withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 Company withLastSync(String lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = Optional.ofNullable(lastSync); + 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 Company withLastSync(Optional lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = lastSync; + return this; + } + + /** + * The name of the company + */ + public Company withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Company withPlatform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); + return this; + } + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Company withPlatform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; + return this; + } + + /** + * 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. + */ + public Company withRedirect(String redirect) { + Utils.checkNotNull(redirect, "redirect"); + this.redirect = redirect; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Company other = (Company) o; + return + java.util.Objects.deepEquals(this.created, other.created) && + java.util.Objects.deepEquals(this.createdByUserName, other.createdByUserName) && + java.util.Objects.deepEquals(this.dataConnections, other.dataConnections) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.groups, other.groups) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lastSync, other.lastSync) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.platform, other.platform) && + java.util.Objects.deepEquals(this.redirect, other.redirect); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + created, + createdByUserName, + dataConnections, + description, + groups, + id, + lastSync, + name, + platform, + redirect); + } + + @Override + public String toString() { + return Utils.toString(Company.class, + "created", created, + "createdByUserName", createdByUserName, + "dataConnections", dataConnections, + "description", description, + "groups", groups, + "id", id, + "lastSync", lastSync, + "name", name, + "platform", platform, + "redirect", redirect); + } + + public final static class Builder { + + private Optional created = Optional.empty(); + + private Optional createdByUserName = Optional.empty(); + + private Optional> dataConnections = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> groups = Optional.empty(); + + private String id; + + private Optional lastSync = Optional.empty(); + + private String name; + + @Deprecated + private Optional platform = Optional.empty(); + + private String redirect; + + private Builder() { + // force use of static builder() method + } + + /** + * 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 created(String created) { + Utils.checkNotNull(created, "created"); + this.created = Optional.ofNullable(created); + 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 created(Optional created) { + Utils.checkNotNull(created, "created"); + this.created = created; + return this; + } + + /** + * Name of user that created the company in Codat. + */ + public Builder createdByUserName(String createdByUserName) { + Utils.checkNotNull(createdByUserName, "createdByUserName"); + this.createdByUserName = Optional.ofNullable(createdByUserName); + return this; + } + + /** + * Name of user that created the company in Codat. + */ + public Builder createdByUserName(Optional createdByUserName) { + Utils.checkNotNull(createdByUserName, "createdByUserName"); + this.createdByUserName = createdByUserName; + return this; + } + + public Builder dataConnections(java.util.List dataConnections) { + Utils.checkNotNull(dataConnections, "dataConnections"); + this.dataConnections = Optional.ofNullable(dataConnections); + return this; + } + + public Builder dataConnections(Optional> dataConnections) { + Utils.checkNotNull(dataConnections, "dataConnections"); + this.dataConnections = dataConnections; + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * An array of groups the company has been assigned to. + */ + public Builder groups(java.util.List groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = Optional.ofNullable(groups); + return this; + } + + /** + * An array of groups the company has been assigned to. + */ + public Builder groups(Optional> groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = groups; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + 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 lastSync(String lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = Optional.ofNullable(lastSync); + 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 lastSync(Optional lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = lastSync; + return this; + } + + /** + * The name of the company + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder platform(String platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = Optional.ofNullable(platform); + return this; + } + + /** + * `platformKeys` name used when creating the company. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder platform(Optional platform) { + Utils.checkNotNull(platform, "platform"); + this.platform = platform; + return this; + } + + /** + * 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. + */ + public Builder redirect(String redirect) { + Utils.checkNotNull(redirect, "redirect"); + this.redirect = redirect; + return this; + } + + public Company build() { + return new Company( + created, + createdByUserName, + dataConnections, + description, + groups, + id, + lastSync, + name, + platform, + redirect); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CompanyRequestBody.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CompanyRequestBody.java new file mode 100644 index 00000000..dda6eb8e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CompanyRequestBody.java @@ -0,0 +1,215 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CompanyRequestBody { + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * Reference to the groups that the company is assigned to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("groups") + private Optional> groups; + + /** + * Name of company being connected. + */ + @JsonProperty("name") + private String name; + + public CompanyRequestBody( + @JsonProperty("description") Optional description, + @JsonProperty("groups") Optional> groups, + @JsonProperty("name") String name) { + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(groups, "groups"); + Utils.checkNotNull(name, "name"); + this.description = description; + this.groups = groups; + this.name = name; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Optional description() { + return description; + } + + /** + * Reference to the groups that the company is assigned to. + */ + public Optional> groups() { + return groups; + } + + /** + * Name of company being connected. + */ + public String name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public CompanyRequestBody withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public CompanyRequestBody withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Reference to the groups that the company is assigned to. + */ + public CompanyRequestBody withGroups(java.util.List groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = Optional.ofNullable(groups); + return this; + } + + /** + * Reference to the groups that the company is assigned to. + */ + public CompanyRequestBody withGroups(Optional> groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = groups; + return this; + } + + /** + * Name of company being connected. + */ + public CompanyRequestBody withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompanyRequestBody other = (CompanyRequestBody) o; + return + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.groups, other.groups) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + description, + groups, + name); + } + + @Override + public String toString() { + return Utils.toString(CompanyRequestBody.class, + "description", description, + "groups", groups, + "name", name); + } + + public final static class Builder { + + private Optional description = Optional.empty(); + + private Optional> groups = Optional.empty(); + + private String name; + + private Builder() { + // force use of static builder() method + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Reference to the groups that the company is assigned to. + */ + public Builder groups(java.util.List groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = Optional.ofNullable(groups); + return this; + } + + /** + * Reference to the groups that the company is assigned to. + */ + public Builder groups(Optional> groups) { + Utils.checkNotNull(groups, "groups"); + this.groups = groups; + return this; + } + + /** + * Name of company being connected. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public CompanyRequestBody build() { + return new CompanyRequestBody( + description, + groups, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Connection.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Connection.java new file mode 100644 index 00000000..e039351e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Connection.java @@ -0,0 +1,791 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * Connection - A connection represents a [company's](https://docs.codat.io/lending-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + * + * A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + * + * - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + * - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + * - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + * Any combination of accounting, banking, and commerce data connections is allowed. + * + * Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + */ + +public class Connection { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("additionalProperties") + private Optional additionalProperties; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("connectionInfo") + private Optional> connectionInfo; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("created") + private String created; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnectionErrors") + private Optional> dataConnectionErrors; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("id") + private String id; + + /** + * A Codat ID representing the integration. + */ + @JsonProperty("integrationId") + private String integrationId; + + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + */ + @JsonProperty("integrationKey") + private String integrationKey; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastSync") + private Optional lastSync; + + /** + * The link URL your customers can use to authorize access to their business application. + */ + @JsonProperty("linkUrl") + private String linkUrl; + + /** + * Name of integration connected to company. + */ + @JsonProperty("platformName") + private String platformName; + + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + */ + @JsonProperty("sourceId") + private String sourceId; + + /** + * The type of platform of the connection. + */ + @JsonProperty("sourceType") + private SourceType sourceType; + + /** + * The current authorization status of the data connection. + */ + @JsonProperty("status") + private DataConnectionStatus status; + + public Connection( + @JsonProperty("additionalProperties") Optional additionalProperties, + @JsonProperty("connectionInfo") Optional> connectionInfo, + @JsonProperty("created") String created, + @JsonProperty("dataConnectionErrors") Optional> dataConnectionErrors, + @JsonProperty("id") String id, + @JsonProperty("integrationId") String integrationId, + @JsonProperty("integrationKey") String integrationKey, + @JsonProperty("lastSync") Optional lastSync, + @JsonProperty("linkUrl") String linkUrl, + @JsonProperty("platformName") String platformName, + @JsonProperty("sourceId") String sourceId, + @JsonProperty("sourceType") SourceType sourceType, + @JsonProperty("status") DataConnectionStatus status) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + Utils.checkNotNull(connectionInfo, "connectionInfo"); + Utils.checkNotNull(created, "created"); + Utils.checkNotNull(dataConnectionErrors, "dataConnectionErrors"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(integrationId, "integrationId"); + Utils.checkNotNull(integrationKey, "integrationKey"); + Utils.checkNotNull(lastSync, "lastSync"); + Utils.checkNotNull(linkUrl, "linkUrl"); + Utils.checkNotNull(platformName, "platformName"); + Utils.checkNotNull(sourceId, "sourceId"); + Utils.checkNotNull(sourceType, "sourceType"); + Utils.checkNotNull(status, "status"); + this.additionalProperties = additionalProperties; + this.connectionInfo = connectionInfo; + this.created = created; + this.dataConnectionErrors = dataConnectionErrors; + this.id = id; + this.integrationId = integrationId; + this.integrationKey = integrationKey; + this.lastSync = lastSync; + this.linkUrl = linkUrl; + this.platformName = platformName; + this.sourceId = sourceId; + this.sourceType = sourceType; + this.status = status; + } + + public Optional additionalProperties() { + return additionalProperties; + } + + public Optional> connectionInfo() { + return connectionInfo; + } + + /** + * 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 String created() { + return created; + } + + public Optional> dataConnectionErrors() { + return dataConnectionErrors; + } + + /** + * Unique identifier for a company's data connection. + */ + public String id() { + return id; + } + + /** + * A Codat ID representing the integration. + */ + public String integrationId() { + return integrationId; + } + + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + */ + public String integrationKey() { + return integrationKey; + } + + /** + * 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 Optional lastSync() { + return lastSync; + } + + /** + * The link URL your customers can use to authorize access to their business application. + */ + public String linkUrl() { + return linkUrl; + } + + /** + * Name of integration connected to company. + */ + public String platformName() { + return platformName; + } + + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + */ + public String sourceId() { + return sourceId; + } + + /** + * The type of platform of the connection. + */ + public SourceType sourceType() { + return sourceType; + } + + /** + * The current authorization status of the data connection. + */ + public DataConnectionStatus status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + public Connection withAdditionalProperties(java.lang.Object additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = Optional.ofNullable(additionalProperties); + return this; + } + + public Connection withAdditionalProperties(Optional additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = additionalProperties; + return this; + } + + public Connection withConnectionInfo(java.util.Map connectionInfo) { + Utils.checkNotNull(connectionInfo, "connectionInfo"); + this.connectionInfo = Optional.ofNullable(connectionInfo); + return this; + } + + public Connection withConnectionInfo(Optional> connectionInfo) { + Utils.checkNotNull(connectionInfo, "connectionInfo"); + this.connectionInfo = connectionInfo; + 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 Connection withCreated(String created) { + Utils.checkNotNull(created, "created"); + this.created = created; + return this; + } + + public Connection withDataConnectionErrors(java.util.List dataConnectionErrors) { + Utils.checkNotNull(dataConnectionErrors, "dataConnectionErrors"); + this.dataConnectionErrors = Optional.ofNullable(dataConnectionErrors); + return this; + } + + public Connection withDataConnectionErrors(Optional> dataConnectionErrors) { + Utils.checkNotNull(dataConnectionErrors, "dataConnectionErrors"); + this.dataConnectionErrors = dataConnectionErrors; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Connection withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * A Codat ID representing the integration. + */ + public Connection withIntegrationId(String integrationId) { + Utils.checkNotNull(integrationId, "integrationId"); + this.integrationId = integrationId; + return this; + } + + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + */ + public Connection withIntegrationKey(String integrationKey) { + Utils.checkNotNull(integrationKey, "integrationKey"); + this.integrationKey = integrationKey; + 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 Connection withLastSync(String lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = Optional.ofNullable(lastSync); + 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 Connection withLastSync(Optional lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = lastSync; + return this; + } + + /** + * The link URL your customers can use to authorize access to their business application. + */ + public Connection withLinkUrl(String linkUrl) { + Utils.checkNotNull(linkUrl, "linkUrl"); + this.linkUrl = linkUrl; + return this; + } + + /** + * Name of integration connected to company. + */ + public Connection withPlatformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + */ + public Connection withSourceId(String sourceId) { + Utils.checkNotNull(sourceId, "sourceId"); + this.sourceId = sourceId; + return this; + } + + /** + * The type of platform of the connection. + */ + public Connection withSourceType(SourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + /** + * The current authorization status of the data connection. + */ + public Connection withStatus(DataConnectionStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Connection other = (Connection) o; + return + java.util.Objects.deepEquals(this.additionalProperties, other.additionalProperties) && + java.util.Objects.deepEquals(this.connectionInfo, other.connectionInfo) && + java.util.Objects.deepEquals(this.created, other.created) && + java.util.Objects.deepEquals(this.dataConnectionErrors, other.dataConnectionErrors) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.integrationId, other.integrationId) && + java.util.Objects.deepEquals(this.integrationKey, other.integrationKey) && + java.util.Objects.deepEquals(this.lastSync, other.lastSync) && + java.util.Objects.deepEquals(this.linkUrl, other.linkUrl) && + java.util.Objects.deepEquals(this.platformName, other.platformName) && + java.util.Objects.deepEquals(this.sourceId, other.sourceId) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + additionalProperties, + connectionInfo, + created, + dataConnectionErrors, + id, + integrationId, + integrationKey, + lastSync, + linkUrl, + platformName, + sourceId, + sourceType, + status); + } + + @Override + public String toString() { + return Utils.toString(Connection.class, + "additionalProperties", additionalProperties, + "connectionInfo", connectionInfo, + "created", created, + "dataConnectionErrors", dataConnectionErrors, + "id", id, + "integrationId", integrationId, + "integrationKey", integrationKey, + "lastSync", lastSync, + "linkUrl", linkUrl, + "platformName", platformName, + "sourceId", sourceId, + "sourceType", sourceType, + "status", status); + } + + public final static class Builder { + + private Optional additionalProperties = Optional.empty(); + + private Optional> connectionInfo = Optional.empty(); + + private String created; + + private Optional> dataConnectionErrors = Optional.empty(); + + private String id; + + private String integrationId; + + private String integrationKey; + + private Optional lastSync = Optional.empty(); + + private String linkUrl; + + private String platformName; + + private String sourceId; + + private SourceType sourceType; + + private DataConnectionStatus status; + + private Builder() { + // force use of static builder() method + } + + public Builder additionalProperties(java.lang.Object additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = Optional.ofNullable(additionalProperties); + return this; + } + + public Builder additionalProperties(Optional additionalProperties) { + Utils.checkNotNull(additionalProperties, "additionalProperties"); + this.additionalProperties = additionalProperties; + return this; + } + + public Builder connectionInfo(java.util.Map connectionInfo) { + Utils.checkNotNull(connectionInfo, "connectionInfo"); + this.connectionInfo = Optional.ofNullable(connectionInfo); + return this; + } + + public Builder connectionInfo(Optional> connectionInfo) { + Utils.checkNotNull(connectionInfo, "connectionInfo"); + this.connectionInfo = connectionInfo; + 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 created(String created) { + Utils.checkNotNull(created, "created"); + this.created = created; + return this; + } + + public Builder dataConnectionErrors(java.util.List dataConnectionErrors) { + Utils.checkNotNull(dataConnectionErrors, "dataConnectionErrors"); + this.dataConnectionErrors = Optional.ofNullable(dataConnectionErrors); + return this; + } + + public Builder dataConnectionErrors(Optional> dataConnectionErrors) { + Utils.checkNotNull(dataConnectionErrors, "dataConnectionErrors"); + this.dataConnectionErrors = dataConnectionErrors; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * A Codat ID representing the integration. + */ + public Builder integrationId(String integrationId) { + Utils.checkNotNull(integrationId, "integrationId"); + this.integrationId = integrationId; + return this; + } + + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + */ + public Builder integrationKey(String integrationKey) { + Utils.checkNotNull(integrationKey, "integrationKey"); + this.integrationKey = integrationKey; + 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 lastSync(String lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = Optional.ofNullable(lastSync); + 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 lastSync(Optional lastSync) { + Utils.checkNotNull(lastSync, "lastSync"); + this.lastSync = lastSync; + return this; + } + + /** + * The link URL your customers can use to authorize access to their business application. + */ + public Builder linkUrl(String linkUrl) { + Utils.checkNotNull(linkUrl, "linkUrl"); + this.linkUrl = linkUrl; + return this; + } + + /** + * Name of integration connected to company. + */ + public Builder platformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + */ + public Builder sourceId(String sourceId) { + Utils.checkNotNull(sourceId, "sourceId"); + this.sourceId = sourceId; + return this; + } + + /** + * The type of platform of the connection. + */ + public Builder sourceType(SourceType sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + /** + * The current authorization status of the data connection. + */ + public Builder status(DataConnectionStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Connection build() { + return new Connection( + additionalProperties, + connectionInfo, + created, + dataConnectionErrors, + id, + integrationId, + integrationKey, + lastSync, + linkUrl, + platformName, + sourceId, + sourceType, + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Connections.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Connections.java new file mode 100644 index 00000000..55ba8d56 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Connections.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Connections { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public Connections( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public Connections withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Connections withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Connections withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Connections withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Connections withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Connections withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Connections other = (Connections) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(Connections.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public Connections build() { + return new Connections( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Contact.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Contact.java new file mode 100644 index 00000000..849b5180 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Contact.java @@ -0,0 +1,483 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class Contact { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("address") + private Optional address; + + /** + * Email of a contact for a customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("email") + private JsonNullable email; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of a contact for a customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * An array of Phone numbers. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone") + private JsonNullable> phone; + + /** + * Status of customer. + */ + @JsonProperty("status") + private CustomerStatus status; + + public Contact( + @JsonProperty("address") Optional address, + @JsonProperty("email") JsonNullable email, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") JsonNullable name, + @JsonProperty("phone") JsonNullable> phone, + @JsonProperty("status") CustomerStatus status) { + Utils.checkNotNull(address, "address"); + Utils.checkNotNull(email, "email"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(phone, "phone"); + Utils.checkNotNull(status, "status"); + this.address = address; + this.email = email; + this.modifiedDate = modifiedDate; + this.name = name; + this.phone = phone; + this.status = status; + } + + public Optional address() { + return address; + } + + /** + * Email of a contact for a customer. + */ + public JsonNullable email() { + return email; + } + + /** + * 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 Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of a contact for a customer. + */ + public JsonNullable name() { + return name; + } + + /** + * An array of Phone numbers. + */ + public JsonNullable> phone() { + return phone; + } + + /** + * Status of customer. + */ + public CustomerStatus status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + public Contact withAddress(AccountingAddress address) { + Utils.checkNotNull(address, "address"); + this.address = Optional.ofNullable(address); + return this; + } + + public Contact withAddress(Optional address) { + Utils.checkNotNull(address, "address"); + this.address = address; + return this; + } + + /** + * Email of a contact for a customer. + */ + public Contact withEmail(String email) { + Utils.checkNotNull(email, "email"); + this.email = JsonNullable.of(email); + return this; + } + + /** + * Email of a contact for a customer. + */ + public Contact withEmail(JsonNullable email) { + Utils.checkNotNull(email, "email"); + this.email = email; + 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 Contact withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + 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 Contact withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of a contact for a customer. + */ + public Contact withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of a contact for a customer. + */ + public Contact withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * An array of Phone numbers. + */ + public Contact withPhone(java.util.List phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * An array of Phone numbers. + */ + public Contact withPhone(JsonNullable> phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Status of customer. + */ + public Contact withStatus(CustomerStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Contact other = (Contact) o; + return + java.util.Objects.deepEquals(this.address, other.address) && + java.util.Objects.deepEquals(this.email, other.email) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.phone, other.phone) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + address, + email, + modifiedDate, + name, + phone, + status); + } + + @Override + public String toString() { + return Utils.toString(Contact.class, + "address", address, + "email", email, + "modifiedDate", modifiedDate, + "name", name, + "phone", phone, + "status", status); + } + + public final static class Builder { + + private Optional address = Optional.empty(); + + private JsonNullable email = JsonNullable.undefined(); + + private Optional modifiedDate = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private JsonNullable> phone = JsonNullable.undefined(); + + private CustomerStatus status; + + private Builder() { + // force use of static builder() method + } + + public Builder address(AccountingAddress address) { + Utils.checkNotNull(address, "address"); + this.address = Optional.ofNullable(address); + return this; + } + + public Builder address(Optional address) { + Utils.checkNotNull(address, "address"); + this.address = address; + return this; + } + + /** + * Email of a contact for a customer. + */ + public Builder email(String email) { + Utils.checkNotNull(email, "email"); + this.email = JsonNullable.of(email); + return this; + } + + /** + * Email of a contact for a customer. + */ + public Builder email(JsonNullable email) { + Utils.checkNotNull(email, "email"); + this.email = email; + 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 modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + 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 modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of a contact for a customer. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of a contact for a customer. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * An array of Phone numbers. + */ + public Builder phone(java.util.List phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = JsonNullable.of(phone); + return this; + } + + /** + * An array of Phone numbers. + */ + public Builder phone(JsonNullable> phone) { + Utils.checkNotNull(phone, "phone"); + this.phone = phone; + return this; + } + + /** + * Status of customer. + */ + public Builder status(CustomerStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public Contact build() { + return new Contact( + address, + email, + modifiedDate, + name, + phone, + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRef.java new file mode 100644 index 00000000..f7c3bd51 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ContactRef - A customer or supplier associated with the direct cost. + */ + +public class ContactRef { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private JsonNullable dataType; + + /** + * Unique identifier for a customer or supplier. + */ + @JsonProperty("id") + private String id; + + public ContactRef( + @JsonProperty("dataType") JsonNullable dataType, + @JsonProperty("id") String id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public JsonNullable dataType() { + return dataType; + } + + /** + * Unique identifier for a customer or supplier. + */ + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public ContactRef withDataType(ContactRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public ContactRef withDataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public ContactRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContactRef other = (ContactRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(ContactRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private JsonNullable dataType = JsonNullable.undefined(); + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(ContactRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public ContactRef build() { + return new ContactRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRefDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRefDataType.java new file mode 100644 index 00000000..1dd670fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactRefDataType.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ContactRefDataType - Allowed name of the 'dataType'. + */ +public enum ContactRefDataType { + CUSTOMERS("customers"), + SUPPLIERS("suppliers"); + + @JsonValue + private final String value; + + private ContactRefDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ContactReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactReference.java new file mode 100644 index 00000000..f8fb03ab --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ContactReference.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ContactReference - A customer or supplier associated with the direct cost. + */ + +public class ContactReference { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private JsonNullable dataType; + + /** + * Unique identifier for a customer or supplier. + */ + @JsonProperty("id") + private String id; + + public ContactReference( + @JsonProperty("dataType") JsonNullable dataType, + @JsonProperty("id") String id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public JsonNullable dataType() { + return dataType; + } + + /** + * Unique identifier for a customer or supplier. + */ + public String id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public ContactReference withDataType(DirectCostPrototypeDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public ContactReference withDataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public ContactReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContactReference other = (ContactReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(ContactReference.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private JsonNullable dataType = JsonNullable.undefined(); + + private String id; + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(DirectCostPrototypeDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = JsonNullable.of(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(JsonNullable dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a customer or supplier. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public ContactReference build() { + return new ContactReference( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CreateBankAccountTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CreateBankAccountTransaction.java new file mode 100644 index 00000000..8bd6eb9b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CreateBankAccountTransaction.java @@ -0,0 +1,460 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class CreateBankAccountTransaction { + + /** + * The amount transacted in the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * The remaining balance in the account with ID `accountId`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private Optional balance; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * Description of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * Identifier for the bank account transaction, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public CreateBankAccountTransaction( + @JsonProperty("amount") Optional amount, + @JsonProperty("balance") Optional balance, + @JsonProperty("date") Optional date, + @JsonProperty("description") Optional description, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + this.amount = amount; + this.balance = balance; + this.date = date; + this.description = description; + this.id = id; + } + + /** + * The amount transacted in the bank transaction. + */ + public Optional amount() { + return amount; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Optional balance() { + return balance; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * Description of the bank transaction. + */ + public Optional description() { + return description; + } + + /** + * Identifier for the bank account transaction, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The amount transacted in the bank transaction. + */ + public CreateBankAccountTransaction withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public CreateBankAccountTransaction withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public CreateBankAccountTransaction withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public CreateBankAccountTransaction withBalance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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 CreateBankAccountTransaction 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 CreateBankAccountTransaction withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * Description of the bank transaction. + */ + public CreateBankAccountTransaction withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description of the bank transaction. + */ + public CreateBankAccountTransaction withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Identifier for the bank account transaction, unique for the company in the accounting platform. + */ + public CreateBankAccountTransaction 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 platform. + */ + public CreateBankAccountTransaction withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateBankAccountTransaction other = (CreateBankAccountTransaction) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + balance, + date, + description, + id); + } + + @Override + public String toString() { + return Utils.toString(CreateBankAccountTransaction.class, + "amount", amount, + "balance", balance, + "date", date, + "description", description, + "id", id); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The amount transacted in the bank transaction. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transacted in the bank transaction. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The remaining balance in the account with ID `accountId`. + */ + public Builder balance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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(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; + } + + /** + * Description of the bank transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Description of the bank transaction. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Identifier for the bank account transaction, unique for the company in the accounting platform. + */ + 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 platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public CreateBankAccountTransaction build() { + return new CreateBankAccountTransaction( + amount, + balance, + date, + description, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteLineItem.java new file mode 100644 index 00000000..35200d21 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteLineItem.java @@ -0,0 +1,913 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class CreditNoteLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Value of any discounts applied. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Percentage rate of any discount applied to the line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * The credit note is a direct income if `True`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isDirectIncome") + private Optional isDirectIncome; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * Number of units of the goods or service for which credit has been issued. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Amount of tax associated with the line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * Total amount of the line item, including discounts and tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + @Deprecated + private JsonNullable> trackingCategoryRefs; + + /** + * Unit price of the goods or service. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + public CreditNoteLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("isDirectIncome") Optional isDirectIncome, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("tracking") Optional tracking, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(tracking, "tracking"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.isDirectIncome = isDirectIncome; + this.itemRef = itemRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.tracking = tracking; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + public JsonNullable description() { + return description; + } + + /** + * Value of any discounts applied. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * The credit note is a direct income if `True`. + */ + public Optional isDirectIncome() { + return isDirectIncome; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * Number of units of the goods or service for which credit has been issued. + */ + public double quantity() { + return quantity; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Amount of tax associated with the line item. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Optional tracking() { + return tracking; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * Unit price of the goods or service. + */ + public double unitAmount() { + return unitAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public CreditNoteLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public CreditNoteLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + public CreditNoteLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + public CreditNoteLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Value of any discounts applied. + */ + public CreditNoteLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Value of any discounts applied. + */ + public CreditNoteLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public CreditNoteLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public CreditNoteLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The credit note is a direct income if `True`. + */ + public CreditNoteLineItem withIsDirectIncome(boolean isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = Optional.ofNullable(isDirectIncome); + return this; + } + + /** + * The credit note is a direct income if `True`. + */ + public CreditNoteLineItem withIsDirectIncome(Optional isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = isDirectIncome; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public CreditNoteLineItem withItemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public CreditNoteLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of the goods or service for which credit has been issued. + */ + public CreditNoteLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public CreditNoteLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public CreditNoteLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public CreditNoteLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public CreditNoteLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public CreditNoteLineItem withTaxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public CreditNoteLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public CreditNoteLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public CreditNoteLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public CreditNoteLineItem withTracking(AccountsReceivableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public CreditNoteLineItem withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public CreditNoteLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public CreditNoteLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Unit price of the goods or service. + */ + public CreditNoteLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreditNoteLineItem other = (CreditNoteLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.isDirectIncome, other.isDirectIncome) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectIncome, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + + @Override + public String toString() { + return Utils.toString(CreditNoteLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "isDirectIncome", isDirectIncome, + "itemRef", itemRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "tracking", tracking, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional isDirectIncome = Optional.empty(); + + private Optional itemRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private Optional tracking = Optional.empty(); + + @Deprecated + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of each line item. For example, the goods or service for which credit has been issued. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Value of any discounts applied. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Value of any discounts applied. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate of any discount applied to the line item. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The credit note is a direct income if `True`. + */ + public Builder isDirectIncome(boolean isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = Optional.ofNullable(isDirectIncome); + return this; + } + + /** + * The credit note is a direct income if `True`. + */ + public Builder isDirectIncome(Optional isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = isDirectIncome; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of the goods or service for which credit has been issued. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of credit associated with the line item, including discounts but excluding tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax associated with the line item. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(AccountsReceivableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Unit price of the goods or service. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + public CreditNoteLineItem build() { + return new CreditNoteLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectIncome, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteStatus.java new file mode 100644 index 00000000..34386224 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CreditNoteStatus.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * CreditNoteStatus - Current state of the credit note. + */ +public enum CreditNoteStatus { + UNKNOWN("Unknown"), + DRAFT("Draft"), + SUBMITTED("Submitted"), + PAID("Paid"), + VOID_("Void"), + PARTIALLY_PAID("PartiallyPaid"); + + @JsonValue + private final String value; + + private CreditNoteStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/CustomerStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/CustomerStatus.java new file mode 100644 index 00000000..886e695a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/CustomerStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * CustomerStatus - Status of customer. + */ +public enum CustomerStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"); + + @JsonValue + private final String value; + + private CustomerStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionError.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionError.java new file mode 100644 index 00000000..d2ce2814 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionError.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataConnectionError { + + /** + * A brief message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private Optional errorMessage; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("erroredOnUtc") + private Optional erroredOnUtc; + + /** + * The HTTP status code returned by the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusCode") + private Optional statusCode; + + /** + * A non-numeric status code/text. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusText") + private Optional statusText; + + public DataConnectionError( + @JsonProperty("errorMessage") Optional errorMessage, + @JsonProperty("erroredOnUtc") Optional erroredOnUtc, + @JsonProperty("statusCode") Optional statusCode, + @JsonProperty("statusText") Optional statusText) { + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(erroredOnUtc, "erroredOnUtc"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(statusText, "statusText"); + this.errorMessage = errorMessage; + this.erroredOnUtc = erroredOnUtc; + this.statusCode = statusCode; + this.statusText = statusText; + } + + /** + * A brief message about the error. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * 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 Optional erroredOnUtc() { + return erroredOnUtc; + } + + /** + * The HTTP status code returned by the error. + */ + public Optional statusCode() { + return statusCode; + } + + /** + * A non-numeric status code/text. + */ + public Optional statusText() { + return statusText; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A brief message about the error. + */ + public DataConnectionError withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * A brief message about the error. + */ + public DataConnectionError withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 DataConnectionError withErroredOnUtc(String erroredOnUtc) { + Utils.checkNotNull(erroredOnUtc, "erroredOnUtc"); + this.erroredOnUtc = Optional.ofNullable(erroredOnUtc); + 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 DataConnectionError withErroredOnUtc(Optional erroredOnUtc) { + Utils.checkNotNull(erroredOnUtc, "erroredOnUtc"); + this.erroredOnUtc = erroredOnUtc; + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public DataConnectionError withStatusCode(String statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public DataConnectionError withStatusCode(Optional statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * A non-numeric status code/text. + */ + public DataConnectionError withStatusText(String statusText) { + Utils.checkNotNull(statusText, "statusText"); + this.statusText = Optional.ofNullable(statusText); + return this; + } + + /** + * A non-numeric status code/text. + */ + public DataConnectionError withStatusText(Optional statusText) { + Utils.checkNotNull(statusText, "statusText"); + this.statusText = statusText; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataConnectionError other = (DataConnectionError) o; + return + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.erroredOnUtc, other.erroredOnUtc) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.statusText, other.statusText); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errorMessage, + erroredOnUtc, + statusCode, + statusText); + } + + @Override + public String toString() { + return Utils.toString(DataConnectionError.class, + "errorMessage", errorMessage, + "erroredOnUtc", erroredOnUtc, + "statusCode", statusCode, + "statusText", statusText); + } + + public final static class Builder { + + private Optional errorMessage = Optional.empty(); + + private Optional erroredOnUtc = Optional.empty(); + + private Optional statusCode = Optional.empty(); + + private Optional statusText = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A brief message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * A brief message about the error. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + 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 erroredOnUtc(String erroredOnUtc) { + Utils.checkNotNull(erroredOnUtc, "erroredOnUtc"); + this.erroredOnUtc = Optional.ofNullable(erroredOnUtc); + 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 erroredOnUtc(Optional erroredOnUtc) { + Utils.checkNotNull(erroredOnUtc, "erroredOnUtc"); + this.erroredOnUtc = erroredOnUtc; + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public Builder statusCode(String statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public Builder statusCode(Optional statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * A non-numeric status code/text. + */ + public Builder statusText(String statusText) { + Utils.checkNotNull(statusText, "statusText"); + this.statusText = Optional.ofNullable(statusText); + return this; + } + + /** + * A non-numeric status code/text. + */ + public Builder statusText(Optional statusText) { + Utils.checkNotNull(statusText, "statusText"); + this.statusText = statusText; + return this; + } + + public DataConnectionError build() { + return new DataConnectionError( + errorMessage, + erroredOnUtc, + statusCode, + statusText); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionStatus.java new file mode 100644 index 00000000..08f12c68 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataConnectionStatus.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * DataConnectionStatus - The current authorization status of the data connection. + */ +public enum DataConnectionStatus { + PENDING_AUTH("PendingAuth"), + LINKED("Linked"), + UNLINKED("Unlinked"), + DEAUTHORIZED("Deauthorized"); + + @JsonValue + private final String value; + + private DataConnectionStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityAmounts.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityAmounts.java new file mode 100644 index 00000000..b6a64e38 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityAmounts.java @@ -0,0 +1,273 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * DataIntegrityAmounts - Only returned for transactions. For accounts, there is nothing returned. + */ + +public class DataIntegrityAmounts { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Highest value of transaction set. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("max") + private Optional max; + + /** + * Lowest value of transaction set. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("min") + private Optional min; + + public DataIntegrityAmounts( + @JsonProperty("currency") Optional currency, + @JsonProperty("max") Optional max, + @JsonProperty("min") Optional min) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(max, "max"); + Utils.checkNotNull(min, "min"); + this.currency = currency; + this.max = max; + this.min = min; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Highest value of transaction set. + */ + public Optional max() { + return max; + } + + /** + * Lowest value of transaction set. + */ + public Optional min() { + return min; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityAmounts withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityAmounts withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Highest value of transaction set. + */ + public DataIntegrityAmounts withMax(double max) { + Utils.checkNotNull(max, "max"); + this.max = Optional.ofNullable(max); + return this; + } + + /** + * Highest value of transaction set. + */ + public DataIntegrityAmounts withMax(Optional max) { + Utils.checkNotNull(max, "max"); + this.max = max; + return this; + } + + /** + * Lowest value of transaction set. + */ + public DataIntegrityAmounts withMin(double min) { + Utils.checkNotNull(min, "min"); + this.min = Optional.ofNullable(min); + return this; + } + + /** + * Lowest value of transaction set. + */ + public DataIntegrityAmounts withMin(Optional min) { + Utils.checkNotNull(min, "min"); + this.min = min; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityAmounts other = (DataIntegrityAmounts) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.max, other.max) && + java.util.Objects.deepEquals(this.min, other.min); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + max, + min); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityAmounts.class, + "currency", currency, + "max", max, + "min", min); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private Optional max = Optional.empty(); + + private Optional min = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Highest value of transaction set. + */ + public Builder max(double max) { + Utils.checkNotNull(max, "max"); + this.max = Optional.ofNullable(max); + return this; + } + + /** + * Highest value of transaction set. + */ + public Builder max(Optional max) { + Utils.checkNotNull(max, "max"); + this.max = max; + return this; + } + + /** + * Lowest value of transaction set. + */ + public Builder min(double min) { + Utils.checkNotNull(min, "min"); + this.min = Optional.ofNullable(min); + return this; + } + + /** + * Lowest value of transaction set. + */ + public Builder min(Optional min) { + Utils.checkNotNull(min, "min"); + this.min = min; + return this; + } + + public DataIntegrityAmounts build() { + return new DataIntegrityAmounts( + currency, + max, + min); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByAmount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByAmount.java new file mode 100644 index 00000000..83c7e600 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByAmount.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityByAmount { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("matchPercentage") + private Optional matchPercentage; + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("matched") + private Optional matched; + + /** + * The total of unmatched and matched. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total") + private Optional total; + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unmatched") + private Optional unmatched; + + public DataIntegrityByAmount( + @JsonProperty("currency") Optional currency, + @JsonProperty("matchPercentage") Optional matchPercentage, + @JsonProperty("matched") Optional matched, + @JsonProperty("total") Optional total, + @JsonProperty("unmatched") Optional unmatched) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(matchPercentage, "matchPercentage"); + Utils.checkNotNull(matched, "matched"); + Utils.checkNotNull(total, "total"); + Utils.checkNotNull(unmatched, "unmatched"); + this.currency = currency; + this.matchPercentage = matchPercentage; + this.matched = matched; + this.total = total; + this.unmatched = unmatched; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + public Optional matchPercentage() { + return matchPercentage; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + public Optional matched() { + return matched; + } + + /** + * The total of unmatched and matched. + */ + public Optional total() { + return total; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + public Optional unmatched() { + return unmatched; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityByAmount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityByAmount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + public DataIntegrityByAmount withMatchPercentage(double matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = Optional.ofNullable(matchPercentage); + return this; + } + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + public DataIntegrityByAmount withMatchPercentage(Optional matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = matchPercentage; + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + public DataIntegrityByAmount withMatched(double matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = Optional.ofNullable(matched); + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + public DataIntegrityByAmount withMatched(Optional matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = matched; + return this; + } + + /** + * The total of unmatched and matched. + */ + public DataIntegrityByAmount withTotal(double total) { + Utils.checkNotNull(total, "total"); + this.total = Optional.ofNullable(total); + return this; + } + + /** + * The total of unmatched and matched. + */ + public DataIntegrityByAmount withTotal(Optional total) { + Utils.checkNotNull(total, "total"); + this.total = total; + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + public DataIntegrityByAmount withUnmatched(double unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = Optional.ofNullable(unmatched); + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + public DataIntegrityByAmount withUnmatched(Optional unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = unmatched; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityByAmount other = (DataIntegrityByAmount) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.matchPercentage, other.matchPercentage) && + java.util.Objects.deepEquals(this.matched, other.matched) && + java.util.Objects.deepEquals(this.total, other.total) && + java.util.Objects.deepEquals(this.unmatched, other.unmatched); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + matchPercentage, + matched, + total, + unmatched); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityByAmount.class, + "currency", currency, + "matchPercentage", matchPercentage, + "matched", matched, + "total", total, + "unmatched", unmatched); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private Optional matchPercentage = Optional.empty(); + + private Optional matched = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional unmatched = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + public Builder matchPercentage(double matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = Optional.ofNullable(matchPercentage); + return this; + } + + /** + * The percentage of the absolute value of transactions of the type specified in the route which have a match. + */ + public Builder matchPercentage(Optional matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = matchPercentage; + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + public Builder matched(double matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = Optional.ofNullable(matched); + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which have a match. + */ + public Builder matched(Optional matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = matched; + return this; + } + + /** + * The total of unmatched and matched. + */ + public Builder total(double total) { + Utils.checkNotNull(total, "total"); + this.total = Optional.ofNullable(total); + return this; + } + + /** + * The total of unmatched and matched. + */ + public Builder total(Optional total) { + Utils.checkNotNull(total, "total"); + this.total = total; + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + public Builder unmatched(double unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = Optional.ofNullable(unmatched); + return this; + } + + /** + * The sum of the absolute value of transactions of the type specified in the route which don't have a match. + */ + public Builder unmatched(Optional unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = unmatched; + return this; + } + + public DataIntegrityByAmount build() { + return new DataIntegrityByAmount( + currency, + matchPercentage, + matched, + total, + unmatched); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByCount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByCount.java new file mode 100644 index 00000000..df0795d9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityByCount.java @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityByCount { + + /** + * The percentage of records of the type specified in the route which have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("matchPercentage") + private Optional matchPercentage; + + /** + * The number of records of the type specified in the route which do have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("matched") + private Optional matched; + + /** + * The total of unmatched and matched. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total") + private Optional total; + + /** + * The number of records of the type specified in the route which don't have a match. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unmatched") + private Optional unmatched; + + public DataIntegrityByCount( + @JsonProperty("matchPercentage") Optional matchPercentage, + @JsonProperty("matched") Optional matched, + @JsonProperty("total") Optional total, + @JsonProperty("unmatched") Optional unmatched) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + Utils.checkNotNull(matched, "matched"); + Utils.checkNotNull(total, "total"); + Utils.checkNotNull(unmatched, "unmatched"); + this.matchPercentage = matchPercentage; + this.matched = matched; + this.total = total; + this.unmatched = unmatched; + } + + /** + * The percentage of records of the type specified in the route which have a match. + */ + public Optional matchPercentage() { + return matchPercentage; + } + + /** + * The number of records of the type specified in the route which do have a match. + */ + public Optional matched() { + return matched; + } + + /** + * The total of unmatched and matched. + */ + public Optional total() { + return total; + } + + /** + * The number of records of the type specified in the route which don't have a match. + */ + public Optional unmatched() { + return unmatched; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The percentage of records of the type specified in the route which have a match. + */ + public DataIntegrityByCount withMatchPercentage(double matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = Optional.ofNullable(matchPercentage); + return this; + } + + /** + * The percentage of records of the type specified in the route which have a match. + */ + public DataIntegrityByCount withMatchPercentage(Optional matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = matchPercentage; + return this; + } + + /** + * The number of records of the type specified in the route which do have a match. + */ + public DataIntegrityByCount withMatched(double matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = Optional.ofNullable(matched); + return this; + } + + /** + * The number of records of the type specified in the route which do have a match. + */ + public DataIntegrityByCount withMatched(Optional matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = matched; + return this; + } + + /** + * The total of unmatched and matched. + */ + public DataIntegrityByCount withTotal(double total) { + Utils.checkNotNull(total, "total"); + this.total = Optional.ofNullable(total); + return this; + } + + /** + * The total of unmatched and matched. + */ + public DataIntegrityByCount withTotal(Optional total) { + Utils.checkNotNull(total, "total"); + this.total = total; + return this; + } + + /** + * The number of records of the type specified in the route which don't have a match. + */ + public DataIntegrityByCount withUnmatched(double unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = Optional.ofNullable(unmatched); + return this; + } + + /** + * The number of records of the type specified in the route which don't have a match. + */ + public DataIntegrityByCount withUnmatched(Optional unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = unmatched; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityByCount other = (DataIntegrityByCount) o; + return + java.util.Objects.deepEquals(this.matchPercentage, other.matchPercentage) && + java.util.Objects.deepEquals(this.matched, other.matched) && + java.util.Objects.deepEquals(this.total, other.total) && + java.util.Objects.deepEquals(this.unmatched, other.unmatched); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + matchPercentage, + matched, + total, + unmatched); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityByCount.class, + "matchPercentage", matchPercentage, + "matched", matched, + "total", total, + "unmatched", unmatched); + } + + public final static class Builder { + + private Optional matchPercentage = Optional.empty(); + + private Optional matched = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional unmatched = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The percentage of records of the type specified in the route which have a match. + */ + public Builder matchPercentage(double matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = Optional.ofNullable(matchPercentage); + return this; + } + + /** + * The percentage of records of the type specified in the route which have a match. + */ + public Builder matchPercentage(Optional matchPercentage) { + Utils.checkNotNull(matchPercentage, "matchPercentage"); + this.matchPercentage = matchPercentage; + return this; + } + + /** + * The number of records of the type specified in the route which do have a match. + */ + public Builder matched(double matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = Optional.ofNullable(matched); + return this; + } + + /** + * The number of records of the type specified in the route which do have a match. + */ + public Builder matched(Optional matched) { + Utils.checkNotNull(matched, "matched"); + this.matched = matched; + return this; + } + + /** + * The total of unmatched and matched. + */ + public Builder total(double total) { + Utils.checkNotNull(total, "total"); + this.total = Optional.ofNullable(total); + return this; + } + + /** + * The total of unmatched and matched. + */ + public Builder total(Optional total) { + Utils.checkNotNull(total, "total"); + this.total = total; + return this; + } + + /** + * The number of records of the type specified in the route which don't have a match. + */ + public Builder unmatched(double unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = Optional.ofNullable(unmatched); + return this; + } + + /** + * The number of records of the type specified in the route which don't have a match. + */ + public Builder unmatched(Optional unmatched) { + Utils.checkNotNull(unmatched, "unmatched"); + this.unmatched = unmatched; + return this; + } + + public DataIntegrityByCount build() { + return new DataIntegrityByCount( + matchPercentage, + matched, + total, + unmatched); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityConnectionId.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityConnectionId.java new file mode 100644 index 00000000..546754a9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityConnectionId.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityConnectionId { + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("source") + private Optional> source; + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("target") + private Optional> target; + + public DataIntegrityConnectionId( + @JsonProperty("source") Optional> source, + @JsonProperty("target") Optional> target) { + Utils.checkNotNull(source, "source"); + Utils.checkNotNull(target, "target"); + this.source = source; + this.target = target; + } + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + public Optional> source() { + return source; + } + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + public Optional> target() { + return target; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + public DataIntegrityConnectionId withSource(java.util.List source) { + Utils.checkNotNull(source, "source"); + this.source = Optional.ofNullable(source); + return this; + } + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + public DataIntegrityConnectionId withSource(Optional> source) { + Utils.checkNotNull(source, "source"); + this.source = source; + return this; + } + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + public DataIntegrityConnectionId withTarget(java.util.List target) { + Utils.checkNotNull(target, "target"); + this.target = Optional.ofNullable(target); + return this; + } + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + public DataIntegrityConnectionId withTarget(Optional> target) { + Utils.checkNotNull(target, "target"); + this.target = target; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityConnectionId other = (DataIntegrityConnectionId) o; + return + java.util.Objects.deepEquals(this.source, other.source) && + java.util.Objects.deepEquals(this.target, other.target); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + source, + target); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityConnectionId.class, + "source", source, + "target", target); + } + + public final static class Builder { + + private Optional> source = Optional.empty(); + + private Optional> target = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + public Builder source(java.util.List source) { + Utils.checkNotNull(source, "source"); + this.source = Optional.ofNullable(source); + return this; + } + + /** + * An array of strings. The connection IDs for the type specified in the url. + */ + public Builder source(Optional> source) { + Utils.checkNotNull(source, "source"); + this.source = source; + return this; + } + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + public Builder target(java.util.List target) { + Utils.checkNotNull(target, "target"); + this.target = Optional.ofNullable(target); + return this; + } + + /** + * An array of strings. The connection IDs for the type being matched to. + */ + public Builder target(Optional> target) { + Utils.checkNotNull(target, "target"); + this.target = target; + return this; + } + + public DataIntegrityConnectionId build() { + return new DataIntegrityConnectionId( + source, + target); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDataType.java new file mode 100644 index 00000000..16fe9b84 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDataType.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +public enum DataIntegrityDataType { + BANKING_ACCOUNTS("banking-accounts"), + BANKING_TRANSACTIONS("banking-transactions"), + BANK_ACCOUNTS("bankAccounts"), + ACCOUNT_TRANSACTIONS("accountTransactions"); + + @JsonValue + private final String value; + + private DataIntegrityDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDates.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDates.java new file mode 100644 index 00000000..7908941b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDates.java @@ -0,0 +1,728 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * DataIntegrityDates - Only returned for transactions. For accounts, there is nothing returned. + */ + +public class DataIntegrityDates { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("maxDate") + private Optional maxDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("maxOverlappingDate") + private Optional maxOverlappingDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("minDate") + private Optional minDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("minOverlappingDate") + private Optional minOverlappingDate; + + public DataIntegrityDates( + @JsonProperty("maxDate") Optional maxDate, + @JsonProperty("maxOverlappingDate") Optional maxOverlappingDate, + @JsonProperty("minDate") Optional minDate, + @JsonProperty("minOverlappingDate") Optional minOverlappingDate) { + Utils.checkNotNull(maxDate, "maxDate"); + Utils.checkNotNull(maxOverlappingDate, "maxOverlappingDate"); + Utils.checkNotNull(minDate, "minDate"); + Utils.checkNotNull(minOverlappingDate, "minOverlappingDate"); + this.maxDate = maxDate; + this.maxOverlappingDate = maxOverlappingDate; + this.minDate = minDate; + this.minOverlappingDate = minOverlappingDate; + } + + /** + * 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 Optional maxDate() { + return maxDate; + } + + /** + * 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 Optional maxOverlappingDate() { + return maxOverlappingDate; + } + + /** + * 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 Optional minDate() { + return minDate; + } + + /** + * 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 Optional minOverlappingDate() { + return minOverlappingDate; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 DataIntegrityDates withMaxDate(String maxDate) { + Utils.checkNotNull(maxDate, "maxDate"); + this.maxDate = Optional.ofNullable(maxDate); + 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 DataIntegrityDates withMaxDate(Optional maxDate) { + Utils.checkNotNull(maxDate, "maxDate"); + this.maxDate = maxDate; + 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 DataIntegrityDates withMaxOverlappingDate(String maxOverlappingDate) { + Utils.checkNotNull(maxOverlappingDate, "maxOverlappingDate"); + this.maxOverlappingDate = Optional.ofNullable(maxOverlappingDate); + 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 DataIntegrityDates withMaxOverlappingDate(Optional maxOverlappingDate) { + Utils.checkNotNull(maxOverlappingDate, "maxOverlappingDate"); + this.maxOverlappingDate = maxOverlappingDate; + 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 DataIntegrityDates withMinDate(String minDate) { + Utils.checkNotNull(minDate, "minDate"); + this.minDate = Optional.ofNullable(minDate); + 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 DataIntegrityDates withMinDate(Optional minDate) { + Utils.checkNotNull(minDate, "minDate"); + this.minDate = minDate; + 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 DataIntegrityDates withMinOverlappingDate(String minOverlappingDate) { + Utils.checkNotNull(minOverlappingDate, "minOverlappingDate"); + this.minOverlappingDate = Optional.ofNullable(minOverlappingDate); + 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 DataIntegrityDates withMinOverlappingDate(Optional minOverlappingDate) { + Utils.checkNotNull(minOverlappingDate, "minOverlappingDate"); + this.minOverlappingDate = minOverlappingDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityDates other = (DataIntegrityDates) o; + return + java.util.Objects.deepEquals(this.maxDate, other.maxDate) && + java.util.Objects.deepEquals(this.maxOverlappingDate, other.maxOverlappingDate) && + java.util.Objects.deepEquals(this.minDate, other.minDate) && + java.util.Objects.deepEquals(this.minOverlappingDate, other.minOverlappingDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + maxDate, + maxOverlappingDate, + minDate, + minOverlappingDate); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityDates.class, + "maxDate", maxDate, + "maxOverlappingDate", maxOverlappingDate, + "minDate", minDate, + "minOverlappingDate", minOverlappingDate); + } + + public final static class Builder { + + private Optional maxDate = Optional.empty(); + + private Optional maxOverlappingDate = Optional.empty(); + + private Optional minDate = Optional.empty(); + + private Optional minOverlappingDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 maxDate(String maxDate) { + Utils.checkNotNull(maxDate, "maxDate"); + this.maxDate = Optional.ofNullable(maxDate); + 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 maxDate(Optional maxDate) { + Utils.checkNotNull(maxDate, "maxDate"); + this.maxDate = maxDate; + 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 maxOverlappingDate(String maxOverlappingDate) { + Utils.checkNotNull(maxOverlappingDate, "maxOverlappingDate"); + this.maxOverlappingDate = Optional.ofNullable(maxOverlappingDate); + 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 maxOverlappingDate(Optional maxOverlappingDate) { + Utils.checkNotNull(maxOverlappingDate, "maxOverlappingDate"); + this.maxOverlappingDate = maxOverlappingDate; + 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 minDate(String minDate) { + Utils.checkNotNull(minDate, "minDate"); + this.minDate = Optional.ofNullable(minDate); + 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 minDate(Optional minDate) { + Utils.checkNotNull(minDate, "minDate"); + this.minDate = minDate; + 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 minOverlappingDate(String minOverlappingDate) { + Utils.checkNotNull(minOverlappingDate, "minOverlappingDate"); + this.minOverlappingDate = Optional.ofNullable(minOverlappingDate); + 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 minOverlappingDate(Optional minOverlappingDate) { + Utils.checkNotNull(minOverlappingDate, "minOverlappingDate"); + this.minOverlappingDate = minOverlappingDate; + return this; + } + + public DataIntegrityDates build() { + return new DataIntegrityDates( + maxDate, + maxOverlappingDate, + minDate, + minOverlappingDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetail.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetail.java new file mode 100644 index 00000000..b13e4524 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetail.java @@ -0,0 +1,655 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityDetail { + + /** + * The transaction value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("connectionId") + private Optional connectionId; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * The transaction description. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * ID GUID of the transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("matches") + private Optional> matches; + + /** + * The data type of the record. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public DataIntegrityDetail( + @JsonProperty("amount") Optional amount, + @JsonProperty("connectionId") Optional connectionId, + @JsonProperty("currency") Optional currency, + @JsonProperty("date") Optional date, + @JsonProperty("description") Optional description, + @JsonProperty("id") Optional id, + @JsonProperty("matches") Optional> matches, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(matches, "matches"); + Utils.checkNotNull(type, "type"); + this.amount = amount; + this.connectionId = connectionId; + this.currency = currency; + this.date = date; + this.description = description; + this.id = id; + this.matches = matches; + this.type = type; + } + + /** + * The transaction value. + */ + public Optional amount() { + return amount; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Optional connectionId() { + return connectionId; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * The transaction description. + */ + public Optional description() { + return description; + } + + /** + * ID GUID of the transaction. + */ + public Optional id() { + return id; + } + + public Optional> matches() { + return matches; + } + + /** + * The data type of the record. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The transaction value. + */ + public DataIntegrityDetail withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The transaction value. + */ + public DataIntegrityDetail withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public DataIntegrityDetail withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public DataIntegrityDetail withConnectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityDetail withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityDetail withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 DataIntegrityDetail 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 DataIntegrityDetail withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * The transaction description. + */ + public DataIntegrityDetail withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The transaction description. + */ + public DataIntegrityDetail withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * ID GUID of the transaction. + */ + public DataIntegrityDetail withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID GUID of the transaction. + */ + public DataIntegrityDetail withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public DataIntegrityDetail withMatches(java.util.List matches) { + Utils.checkNotNull(matches, "matches"); + this.matches = Optional.ofNullable(matches); + return this; + } + + public DataIntegrityDetail withMatches(Optional> matches) { + Utils.checkNotNull(matches, "matches"); + this.matches = matches; + return this; + } + + /** + * The data type of the record. + */ + public DataIntegrityDetail withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type of the record. + */ + public DataIntegrityDetail withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityDetail other = (DataIntegrityDetail) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.matches, other.matches) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + connectionId, + currency, + date, + description, + id, + matches, + type); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityDetail.class, + "amount", amount, + "connectionId", connectionId, + "currency", currency, + "date", date, + "description", description, + "id", id, + "matches", matches, + "type", type); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional> matches = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The transaction value. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The transaction value. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Builder connectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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(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; + } + + /** + * The transaction description. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The transaction description. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * ID GUID of the transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID GUID of the transaction. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder matches(java.util.List matches) { + Utils.checkNotNull(matches, "matches"); + this.matches = Optional.ofNullable(matches); + return this; + } + + public Builder matches(Optional> matches) { + Utils.checkNotNull(matches, "matches"); + this.matches = matches; + return this; + } + + /** + * The data type of the record. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type of the record. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public DataIntegrityDetail build() { + return new DataIntegrityDetail( + amount, + connectionId, + currency, + date, + description, + id, + matches, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetails.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetails.java new file mode 100644 index 00000000..198528e1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityDetails.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityDetails { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public DataIntegrityDetails( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public DataIntegrityDetails withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public DataIntegrityDetails withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public DataIntegrityDetails withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public DataIntegrityDetails withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public DataIntegrityDetails withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public DataIntegrityDetails withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityDetails other = (DataIntegrityDetails) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityDetails.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public DataIntegrityDetails build() { + return new DataIntegrityDetails( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityMatch.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityMatch.java new file mode 100644 index 00000000..9c916edd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityMatch.java @@ -0,0 +1,506 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityMatch { + + /** + * The transaction value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("connectionId") + private Optional connectionId; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * The date of the transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * The transaction description. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * ID GUID of the transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public DataIntegrityMatch( + @JsonProperty("amount") Optional amount, + @JsonProperty("connectionId") Optional connectionId, + @JsonProperty("currency") Optional currency, + @JsonProperty("date") Optional date, + @JsonProperty("description") Optional description, + @JsonProperty("id") Optional id, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.amount = amount; + this.connectionId = connectionId; + this.currency = currency; + this.date = date; + this.description = description; + this.id = id; + this.type = type; + } + + /** + * The transaction value. + */ + public Optional amount() { + return amount; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Optional connectionId() { + return connectionId; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * The date of the transaction. + */ + public Optional date() { + return date; + } + + /** + * The transaction description. + */ + public Optional description() { + return description; + } + + /** + * ID GUID of the transaction. + */ + public Optional id() { + return id; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The transaction value. + */ + public DataIntegrityMatch withAmount(String amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The transaction value. + */ + public DataIntegrityMatch withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public DataIntegrityMatch withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public DataIntegrityMatch withConnectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityMatch withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DataIntegrityMatch withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The date of the transaction. + */ + public DataIntegrityMatch withDate(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * The date of the transaction. + */ + public DataIntegrityMatch withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * The transaction description. + */ + public DataIntegrityMatch withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The transaction description. + */ + public DataIntegrityMatch withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * ID GUID of the transaction. + */ + public DataIntegrityMatch withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID GUID of the transaction. + */ + public DataIntegrityMatch withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegrityMatch withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegrityMatch withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityMatch other = (DataIntegrityMatch) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + connectionId, + currency, + date, + description, + id, + type); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityMatch.class, + "amount", amount, + "connectionId", connectionId, + "currency", currency, + "date", date, + "description", description, + "id", id, + "type", type); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional connectionId = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The transaction value. + */ + public Builder amount(String amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The transaction value. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = Optional.ofNullable(connectionId); + return this; + } + + /** + * ID GUID representing the connection of the accounting or banking platform. + */ + public Builder connectionId(Optional connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The date of the transaction. + */ + public Builder date(String date) { + Utils.checkNotNull(date, "date"); + this.date = Optional.ofNullable(date); + return this; + } + + /** + * The date of the transaction. + */ + public Builder date(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * The transaction description. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The transaction description. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * ID GUID of the transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID GUID of the transaction. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public DataIntegrityMatch build() { + return new DataIntegrityMatch( + amount, + connectionId, + currency, + date, + description, + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatus.java new file mode 100644 index 00000000..00de24f4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatus.java @@ -0,0 +1,316 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityStatus { + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amounts") + private Optional amounts; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("connectionIds") + private Optional connectionIds; + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dates") + private Optional dates; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusInfo") + private Optional statusInfo; + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public DataIntegrityStatus( + @JsonProperty("amounts") Optional amounts, + @JsonProperty("connectionIds") Optional connectionIds, + @JsonProperty("dates") Optional dates, + @JsonProperty("statusInfo") Optional statusInfo, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(amounts, "amounts"); + Utils.checkNotNull(connectionIds, "connectionIds"); + Utils.checkNotNull(dates, "dates"); + Utils.checkNotNull(statusInfo, "statusInfo"); + Utils.checkNotNull(type, "type"); + this.amounts = amounts; + this.connectionIds = connectionIds; + this.dates = dates; + this.statusInfo = statusInfo; + this.type = type; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Optional amounts() { + return amounts; + } + + public Optional connectionIds() { + return connectionIds; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Optional dates() { + return dates; + } + + public Optional statusInfo() { + return statusInfo; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public DataIntegrityStatus withAmounts(DataIntegrityAmounts amounts) { + Utils.checkNotNull(amounts, "amounts"); + this.amounts = Optional.ofNullable(amounts); + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public DataIntegrityStatus withAmounts(Optional amounts) { + Utils.checkNotNull(amounts, "amounts"); + this.amounts = amounts; + return this; + } + + public DataIntegrityStatus withConnectionIds(DataIntegrityConnectionId connectionIds) { + Utils.checkNotNull(connectionIds, "connectionIds"); + this.connectionIds = Optional.ofNullable(connectionIds); + return this; + } + + public DataIntegrityStatus withConnectionIds(Optional connectionIds) { + Utils.checkNotNull(connectionIds, "connectionIds"); + this.connectionIds = connectionIds; + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public DataIntegrityStatus withDates(DataIntegrityDates dates) { + Utils.checkNotNull(dates, "dates"); + this.dates = Optional.ofNullable(dates); + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public DataIntegrityStatus withDates(Optional dates) { + Utils.checkNotNull(dates, "dates"); + this.dates = dates; + return this; + } + + public DataIntegrityStatus withStatusInfo(DataIntegrityStatusInfo statusInfo) { + Utils.checkNotNull(statusInfo, "statusInfo"); + this.statusInfo = Optional.ofNullable(statusInfo); + return this; + } + + public DataIntegrityStatus withStatusInfo(Optional statusInfo) { + Utils.checkNotNull(statusInfo, "statusInfo"); + this.statusInfo = statusInfo; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegrityStatus withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegrityStatus withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityStatus other = (DataIntegrityStatus) o; + return + java.util.Objects.deepEquals(this.amounts, other.amounts) && + java.util.Objects.deepEquals(this.connectionIds, other.connectionIds) && + java.util.Objects.deepEquals(this.dates, other.dates) && + java.util.Objects.deepEquals(this.statusInfo, other.statusInfo) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amounts, + connectionIds, + dates, + statusInfo, + type); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityStatus.class, + "amounts", amounts, + "connectionIds", connectionIds, + "dates", dates, + "statusInfo", statusInfo, + "type", type); + } + + public final static class Builder { + + private Optional amounts = Optional.empty(); + + private Optional connectionIds = Optional.empty(); + + private Optional dates = Optional.empty(); + + private Optional statusInfo = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Builder amounts(DataIntegrityAmounts amounts) { + Utils.checkNotNull(amounts, "amounts"); + this.amounts = Optional.ofNullable(amounts); + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Builder amounts(Optional amounts) { + Utils.checkNotNull(amounts, "amounts"); + this.amounts = amounts; + return this; + } + + public Builder connectionIds(DataIntegrityConnectionId connectionIds) { + Utils.checkNotNull(connectionIds, "connectionIds"); + this.connectionIds = Optional.ofNullable(connectionIds); + return this; + } + + public Builder connectionIds(Optional connectionIds) { + Utils.checkNotNull(connectionIds, "connectionIds"); + this.connectionIds = connectionIds; + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Builder dates(DataIntegrityDates dates) { + Utils.checkNotNull(dates, "dates"); + this.dates = Optional.ofNullable(dates); + return this; + } + + /** + * Only returned for transactions. For accounts, there is nothing returned. + */ + public Builder dates(Optional dates) { + Utils.checkNotNull(dates, "dates"); + this.dates = dates; + return this; + } + + public Builder statusInfo(DataIntegrityStatusInfo statusInfo) { + Utils.checkNotNull(statusInfo, "statusInfo"); + this.statusInfo = Optional.ofNullable(statusInfo); + return this; + } + + public Builder statusInfo(Optional statusInfo) { + Utils.checkNotNull(statusInfo, "statusInfo"); + this.statusInfo = statusInfo; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public DataIntegrityStatus build() { + return new DataIntegrityStatus( + amounts, + connectionIds, + dates, + statusInfo, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatusInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatusInfo.java new file mode 100644 index 00000000..7d272de0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatusInfo.java @@ -0,0 +1,342 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityStatusInfo { + + /** + * The current status of the most recently run matching algorithm. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currentStatus") + private Optional currentStatus; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastMatched") + private Optional lastMatched; + + /** + * Detailed explanation supporting the status value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusMessage") + private Optional statusMessage; + + public DataIntegrityStatusInfo( + @JsonProperty("currentStatus") Optional currentStatus, + @JsonProperty("lastMatched") Optional lastMatched, + @JsonProperty("statusMessage") Optional statusMessage) { + Utils.checkNotNull(currentStatus, "currentStatus"); + Utils.checkNotNull(lastMatched, "lastMatched"); + Utils.checkNotNull(statusMessage, "statusMessage"); + this.currentStatus = currentStatus; + this.lastMatched = lastMatched; + this.statusMessage = statusMessage; + } + + /** + * The current status of the most recently run matching algorithm. + */ + public Optional currentStatus() { + return currentStatus; + } + + /** + * 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 Optional lastMatched() { + return lastMatched; + } + + /** + * Detailed explanation supporting the status value. + */ + public Optional statusMessage() { + return statusMessage; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The current status of the most recently run matching algorithm. + */ + public DataIntegrityStatusInfo withCurrentStatus(IntegrityStatus currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = Optional.ofNullable(currentStatus); + return this; + } + + /** + * The current status of the most recently run matching algorithm. + */ + public DataIntegrityStatusInfo withCurrentStatus(Optional currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = currentStatus; + 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 DataIntegrityStatusInfo withLastMatched(String lastMatched) { + Utils.checkNotNull(lastMatched, "lastMatched"); + this.lastMatched = Optional.ofNullable(lastMatched); + 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 DataIntegrityStatusInfo withLastMatched(Optional lastMatched) { + Utils.checkNotNull(lastMatched, "lastMatched"); + this.lastMatched = lastMatched; + return this; + } + + /** + * Detailed explanation supporting the status value. + */ + public DataIntegrityStatusInfo withStatusMessage(String statusMessage) { + Utils.checkNotNull(statusMessage, "statusMessage"); + this.statusMessage = Optional.ofNullable(statusMessage); + return this; + } + + /** + * Detailed explanation supporting the status value. + */ + public DataIntegrityStatusInfo withStatusMessage(Optional statusMessage) { + Utils.checkNotNull(statusMessage, "statusMessage"); + this.statusMessage = statusMessage; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityStatusInfo other = (DataIntegrityStatusInfo) o; + return + java.util.Objects.deepEquals(this.currentStatus, other.currentStatus) && + java.util.Objects.deepEquals(this.lastMatched, other.lastMatched) && + java.util.Objects.deepEquals(this.statusMessage, other.statusMessage); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currentStatus, + lastMatched, + statusMessage); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityStatusInfo.class, + "currentStatus", currentStatus, + "lastMatched", lastMatched, + "statusMessage", statusMessage); + } + + public final static class Builder { + + private Optional currentStatus = Optional.empty(); + + private Optional lastMatched = Optional.empty(); + + private Optional statusMessage = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The current status of the most recently run matching algorithm. + */ + public Builder currentStatus(IntegrityStatus currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = Optional.ofNullable(currentStatus); + return this; + } + + /** + * The current status of the most recently run matching algorithm. + */ + public Builder currentStatus(Optional currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = currentStatus; + 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 lastMatched(String lastMatched) { + Utils.checkNotNull(lastMatched, "lastMatched"); + this.lastMatched = Optional.ofNullable(lastMatched); + 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 lastMatched(Optional lastMatched) { + Utils.checkNotNull(lastMatched, "lastMatched"); + this.lastMatched = lastMatched; + return this; + } + + /** + * Detailed explanation supporting the status value. + */ + public Builder statusMessage(String statusMessage) { + Utils.checkNotNull(statusMessage, "statusMessage"); + this.statusMessage = Optional.ofNullable(statusMessage); + return this; + } + + /** + * Detailed explanation supporting the status value. + */ + public Builder statusMessage(Optional statusMessage) { + Utils.checkNotNull(statusMessage, "statusMessage"); + this.statusMessage = statusMessage; + return this; + } + + public DataIntegrityStatusInfo build() { + return new DataIntegrityStatusInfo( + currentStatus, + lastMatched, + statusMessage); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatuses.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatuses.java new file mode 100644 index 00000000..0fd53c0d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegrityStatuses.java @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegrityStatuses { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("metadata") + private Optional> metadata; + + public DataIntegrityStatuses( + @JsonProperty("metadata") Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + } + + public Optional> metadata() { + return metadata; + } + + public final static Builder builder() { + return new Builder(); + } + + public DataIntegrityStatuses withMetadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public DataIntegrityStatuses withMetadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegrityStatuses other = (DataIntegrityStatuses) o; + return + java.util.Objects.deepEquals(this.metadata, other.metadata); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + metadata); + } + + @Override + public String toString() { + return Utils.toString(DataIntegrityStatuses.class, + "metadata", metadata); + } + + public final static class Builder { + + private Optional> metadata = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder metadata(java.util.List metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Optional> metadata) { + Utils.checkNotNull(metadata, "metadata"); + this.metadata = metadata; + return this; + } + + public DataIntegrityStatuses build() { + return new DataIntegrityStatuses( + metadata); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummaries.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummaries.java new file mode 100644 index 00000000..7b117e53 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummaries.java @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegritySummaries { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("summaries") + private Optional> summaries; + + public DataIntegritySummaries( + @JsonProperty("summaries") Optional> summaries) { + Utils.checkNotNull(summaries, "summaries"); + this.summaries = summaries; + } + + public Optional> summaries() { + return summaries; + } + + public final static Builder builder() { + return new Builder(); + } + + public DataIntegritySummaries withSummaries(java.util.List summaries) { + Utils.checkNotNull(summaries, "summaries"); + this.summaries = Optional.ofNullable(summaries); + return this; + } + + public DataIntegritySummaries withSummaries(Optional> summaries) { + Utils.checkNotNull(summaries, "summaries"); + this.summaries = summaries; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegritySummaries other = (DataIntegritySummaries) o; + return + java.util.Objects.deepEquals(this.summaries, other.summaries); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + summaries); + } + + @Override + public String toString() { + return Utils.toString(DataIntegritySummaries.class, + "summaries", summaries); + } + + public final static class Builder { + + private Optional> summaries = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder summaries(java.util.List summaries) { + Utils.checkNotNull(summaries, "summaries"); + this.summaries = Optional.ofNullable(summaries); + return this; + } + + public Builder summaries(Optional> summaries) { + Utils.checkNotNull(summaries, "summaries"); + this.summaries = summaries; + return this; + } + + public DataIntegritySummaries build() { + return new DataIntegritySummaries( + summaries); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummary.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummary.java new file mode 100644 index 00000000..8dedf13a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataIntegritySummary.java @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataIntegritySummary { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("byAmount") + private Optional byAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("byCount") + private Optional byCount; + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public DataIntegritySummary( + @JsonProperty("byAmount") Optional byAmount, + @JsonProperty("byCount") Optional byCount, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(byAmount, "byAmount"); + Utils.checkNotNull(byCount, "byCount"); + Utils.checkNotNull(type, "type"); + this.byAmount = byAmount; + this.byCount = byCount; + this.type = type; + } + + public Optional byAmount() { + return byAmount; + } + + public Optional byCount() { + return byCount; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + public DataIntegritySummary withByAmount(DataIntegrityByAmount byAmount) { + Utils.checkNotNull(byAmount, "byAmount"); + this.byAmount = Optional.ofNullable(byAmount); + return this; + } + + public DataIntegritySummary withByAmount(Optional byAmount) { + Utils.checkNotNull(byAmount, "byAmount"); + this.byAmount = byAmount; + return this; + } + + public DataIntegritySummary withByCount(DataIntegrityByCount byCount) { + Utils.checkNotNull(byCount, "byCount"); + this.byCount = Optional.ofNullable(byCount); + return this; + } + + public DataIntegritySummary withByCount(Optional byCount) { + Utils.checkNotNull(byCount, "byCount"); + this.byCount = byCount; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegritySummary withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public DataIntegritySummary withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataIntegritySummary other = (DataIntegritySummary) o; + return + java.util.Objects.deepEquals(this.byAmount, other.byAmount) && + java.util.Objects.deepEquals(this.byCount, other.byCount) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + byAmount, + byCount, + type); + } + + @Override + public String toString() { + return Utils.toString(DataIntegritySummary.class, + "byAmount", byAmount, + "byCount", byCount, + "type", type); + } + + public final static class Builder { + + private Optional byAmount = Optional.empty(); + + private Optional byCount = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder byAmount(DataIntegrityByAmount byAmount) { + Utils.checkNotNull(byAmount, "byAmount"); + this.byAmount = Optional.ofNullable(byAmount); + return this; + } + + public Builder byAmount(Optional byAmount) { + Utils.checkNotNull(byAmount, "byAmount"); + this.byAmount = byAmount; + return this; + } + + public Builder byCount(DataIntegrityByCount byCount) { + Utils.checkNotNull(byCount, "byCount"); + this.byCount = Optional.ofNullable(byCount); + return this; + } + + public Builder byCount(Optional byCount) { + Utils.checkNotNull(byCount, "byCount"); + this.byCount = byCount; + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type which the data type in the URL has been matched against. For example, if you've matched accountTransactions and banking-transactions, and you call this endpoint with accountTransactions in the URL, this property would be banking-transactions. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public DataIntegritySummary build() { + return new DataIntegritySummary( + byAmount, + byCount, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataSource.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataSource.java new file mode 100644 index 00000000..61847194 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataSource.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class DataSource { + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accounts") + private Optional> accounts; + + public DataSource( + @JsonProperty("accounts") Optional> accounts) { + Utils.checkNotNull(accounts, "accounts"); + this.accounts = accounts; + } + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + public Optional> accounts() { + return accounts; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + public DataSource withAccounts(java.util.List accounts) { + Utils.checkNotNull(accounts, "accounts"); + this.accounts = Optional.ofNullable(accounts); + return this; + } + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + public DataSource withAccounts(Optional> accounts) { + Utils.checkNotNull(accounts, "accounts"); + this.accounts = accounts; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataSource other = (DataSource) o; + return + java.util.Objects.deepEquals(this.accounts, other.accounts); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accounts); + } + + @Override + public String toString() { + return Utils.toString(DataSource.class, + "accounts", accounts); + } + + public final static class Builder { + + private Optional> accounts = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + public Builder accounts(java.util.List accounts) { + Utils.checkNotNull(accounts, "accounts"); + this.accounts = Optional.ofNullable(accounts); + return this; + } + + /** + * An array containing bank account data for each connected banking data source that have the following data types enabled: `banking-accounts`, `banking-transactions`. + */ + public Builder accounts(Optional> accounts) { + Utils.checkNotNull(accounts, "accounts"); + this.accounts = accounts; + return this; + } + + public DataSource build() { + return new DataSource( + accounts); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataStatus.java new file mode 100644 index 00000000..4547b24f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataStatus.java @@ -0,0 +1,370 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * DataStatus - Describes the state of data in the Codat cache for a company and data type + */ + +public class DataStatus { + + /** + * The current status of the dataset in Codat's cache. + */ + @JsonProperty("currentStatus") + private String currentStatus; + + /** + * Available Data types + */ + @JsonProperty("dataType") + private DataTypes dataType; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("lastSuccessfulSync") + private String lastSuccessfulSync; + + /** + * Unique identifier for the most recent successful sync of data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("latestSuccessfulSyncId") + private Optional latestSuccessfulSyncId; + + /** + * Unique identifier for most recent sync of data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("latestSyncId") + private Optional latestSyncId; + + public DataStatus( + @JsonProperty("currentStatus") String currentStatus, + @JsonProperty("dataType") DataTypes dataType, + @JsonProperty("lastSuccessfulSync") String lastSuccessfulSync, + @JsonProperty("latestSuccessfulSyncId") Optional latestSuccessfulSyncId, + @JsonProperty("latestSyncId") Optional latestSyncId) { + Utils.checkNotNull(currentStatus, "currentStatus"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(lastSuccessfulSync, "lastSuccessfulSync"); + Utils.checkNotNull(latestSuccessfulSyncId, "latestSuccessfulSyncId"); + Utils.checkNotNull(latestSyncId, "latestSyncId"); + this.currentStatus = currentStatus; + this.dataType = dataType; + this.lastSuccessfulSync = lastSuccessfulSync; + this.latestSuccessfulSyncId = latestSuccessfulSyncId; + this.latestSyncId = latestSyncId; + } + + /** + * The current status of the dataset in Codat's cache. + */ + public String currentStatus() { + return currentStatus; + } + + /** + * Available Data types + */ + public DataTypes dataType() { + return dataType; + } + + /** + * 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 String lastSuccessfulSync() { + return lastSuccessfulSync; + } + + /** + * Unique identifier for the most recent successful sync of data type. + */ + public Optional latestSuccessfulSyncId() { + return latestSuccessfulSyncId; + } + + /** + * Unique identifier for most recent sync of data type. + */ + public Optional latestSyncId() { + return latestSyncId; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The current status of the dataset in Codat's cache. + */ + public DataStatus withCurrentStatus(String currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = currentStatus; + return this; + } + + /** + * Available Data types + */ + public DataStatus withDataType(DataTypes dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + 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 DataStatus withLastSuccessfulSync(String lastSuccessfulSync) { + Utils.checkNotNull(lastSuccessfulSync, "lastSuccessfulSync"); + this.lastSuccessfulSync = lastSuccessfulSync; + return this; + } + + /** + * Unique identifier for the most recent successful sync of data type. + */ + public DataStatus withLatestSuccessfulSyncId(String latestSuccessfulSyncId) { + Utils.checkNotNull(latestSuccessfulSyncId, "latestSuccessfulSyncId"); + this.latestSuccessfulSyncId = Optional.ofNullable(latestSuccessfulSyncId); + return this; + } + + /** + * Unique identifier for the most recent successful sync of data type. + */ + public DataStatus withLatestSuccessfulSyncId(Optional latestSuccessfulSyncId) { + Utils.checkNotNull(latestSuccessfulSyncId, "latestSuccessfulSyncId"); + this.latestSuccessfulSyncId = latestSuccessfulSyncId; + return this; + } + + /** + * Unique identifier for most recent sync of data type. + */ + public DataStatus withLatestSyncId(String latestSyncId) { + Utils.checkNotNull(latestSyncId, "latestSyncId"); + this.latestSyncId = Optional.ofNullable(latestSyncId); + return this; + } + + /** + * Unique identifier for most recent sync of data type. + */ + public DataStatus withLatestSyncId(Optional latestSyncId) { + Utils.checkNotNull(latestSyncId, "latestSyncId"); + this.latestSyncId = latestSyncId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataStatus other = (DataStatus) o; + return + java.util.Objects.deepEquals(this.currentStatus, other.currentStatus) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.lastSuccessfulSync, other.lastSuccessfulSync) && + java.util.Objects.deepEquals(this.latestSuccessfulSyncId, other.latestSuccessfulSyncId) && + java.util.Objects.deepEquals(this.latestSyncId, other.latestSyncId); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currentStatus, + dataType, + lastSuccessfulSync, + latestSuccessfulSyncId, + latestSyncId); + } + + @Override + public String toString() { + return Utils.toString(DataStatus.class, + "currentStatus", currentStatus, + "dataType", dataType, + "lastSuccessfulSync", lastSuccessfulSync, + "latestSuccessfulSyncId", latestSuccessfulSyncId, + "latestSyncId", latestSyncId); + } + + public final static class Builder { + + private String currentStatus; + + private DataTypes dataType; + + private String lastSuccessfulSync; + + private Optional latestSuccessfulSyncId = Optional.empty(); + + private Optional latestSyncId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The current status of the dataset in Codat's cache. + */ + public Builder currentStatus(String currentStatus) { + Utils.checkNotNull(currentStatus, "currentStatus"); + this.currentStatus = currentStatus; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataTypes dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + 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 lastSuccessfulSync(String lastSuccessfulSync) { + Utils.checkNotNull(lastSuccessfulSync, "lastSuccessfulSync"); + this.lastSuccessfulSync = lastSuccessfulSync; + return this; + } + + /** + * Unique identifier for the most recent successful sync of data type. + */ + public Builder latestSuccessfulSyncId(String latestSuccessfulSyncId) { + Utils.checkNotNull(latestSuccessfulSyncId, "latestSuccessfulSyncId"); + this.latestSuccessfulSyncId = Optional.ofNullable(latestSuccessfulSyncId); + return this; + } + + /** + * Unique identifier for the most recent successful sync of data type. + */ + public Builder latestSuccessfulSyncId(Optional latestSuccessfulSyncId) { + Utils.checkNotNull(latestSuccessfulSyncId, "latestSuccessfulSyncId"); + this.latestSuccessfulSyncId = latestSuccessfulSyncId; + return this; + } + + /** + * Unique identifier for most recent sync of data type. + */ + public Builder latestSyncId(String latestSyncId) { + Utils.checkNotNull(latestSyncId, "latestSyncId"); + this.latestSyncId = Optional.ofNullable(latestSyncId); + return this; + } + + /** + * Unique identifier for most recent sync of data type. + */ + public Builder latestSyncId(Optional latestSyncId) { + Utils.checkNotNull(latestSyncId, "latestSyncId"); + this.latestSyncId = latestSyncId; + return this; + } + + public DataStatus build() { + return new DataStatus( + currentStatus, + dataType, + lastSuccessfulSync, + latestSuccessfulSyncId, + latestSyncId); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataType.java new file mode 100644 index 00000000..48a384f8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataType.java @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * DataType - Available Data types + */ +public enum DataType { + ACCOUNT_TRANSACTIONS("accountTransactions"), + BALANCE_SHEET("balanceSheet"), + BANK_ACCOUNTS("bankAccounts"), + BANK_TRANSACTIONS("bankTransactions"), + BILL_CREDIT_NOTES("billCreditNotes"), + BILL_PAYMENTS("billPayments"), + BILLS("bills"), + CASH_FLOW_STATEMENT("cashFlowStatement"), + CHART_OF_ACCOUNTS("chartOfAccounts"), + COMPANY("company"), + CREDIT_NOTES("creditNotes"), + CUSTOMERS("customers"), + DIRECT_COSTS("directCosts"), + DIRECT_INCOMES("directIncomes"), + INVOICES("invoices"), + ITEM_RECEIPTS("itemReceipts"), + ITEMS("items"), + JOURNAL_ENTRIES("journalEntries"), + JOURNALS("journals"), + PAYMENT_METHODS("paymentMethods"), + PAYMENTS("payments"), + PROFIT_AND_LOSS("profitAndLoss"), + PURCHASE_ORDERS("purchaseOrders"), + SALES_ORDERS("salesOrders"), + SUPPLIERS("suppliers"), + TAX_RATES("taxRates"), + TRACKING_CATEGORIES("trackingCategories"), + TRANSFERS("transfers"), + BANKING_ACCOUNT_BALANCES("banking-accountBalances"), + BANKING_ACCOUNTS("banking-accounts"), + BANKING_TRANSACTION_CATEGORIES("banking-transactionCategories"), + BANKING_TRANSACTIONS("banking-transactions"), + COMMERCE_COMPANY_INFO("commerce-companyInfo"), + COMMERCE_CUSTOMERS("commerce-customers"), + COMMERCE_DISPUTES("commerce-disputes"), + COMMERCE_LOCATIONS("commerce-locations"), + COMMERCE_ORDERS("commerce-orders"), + COMMERCE_PAYMENT_METHODS("commerce-paymentMethods"), + COMMERCE_PAYMENTS("commerce-payments"), + COMMERCE_PRODUCT_CATEGORIES("commerce-productCategories"), + COMMERCE_PRODUCTS("commerce-products"), + COMMERCE_TAX_COMPONENTS("commerce-taxComponents"), + COMMERCE_TRANSACTIONS("commerce-transactions"); + + @JsonValue + private final String value; + + private DataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DataTypes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DataTypes.java new file mode 100644 index 00000000..40ac8c4e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DataTypes.java @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * DataTypes - Available Data types + */ +public enum DataTypes { + ACCOUNT_TRANSACTIONS("accountTransactions"), + BALANCE_SHEET("balanceSheet"), + BANK_ACCOUNTS("bankAccounts"), + BANK_TRANSACTIONS("bankTransactions"), + BILL_CREDIT_NOTES("billCreditNotes"), + BILL_PAYMENTS("billPayments"), + BILLS("bills"), + CASH_FLOW_STATEMENT("cashFlowStatement"), + CHART_OF_ACCOUNTS("chartOfAccounts"), + COMPANY("company"), + CREDIT_NOTES("creditNotes"), + CUSTOMERS("customers"), + DIRECT_COSTS("directCosts"), + DIRECT_INCOMES("directIncomes"), + INVOICES("invoices"), + ITEM_RECEIPTS("itemReceipts"), + ITEMS("items"), + JOURNAL_ENTRIES("journalEntries"), + JOURNALS("journals"), + PAYMENT_METHODS("paymentMethods"), + PAYMENTS("payments"), + PROFIT_AND_LOSS("profitAndLoss"), + PURCHASE_ORDERS("purchaseOrders"), + SALES_ORDERS("salesOrders"), + SUPPLIERS("suppliers"), + TAX_RATES("taxRates"), + TRACKING_CATEGORIES("trackingCategories"), + TRANSFERS("transfers"), + BANKING_ACCOUNT_BALANCES("banking-accountBalances"), + BANKING_ACCOUNTS("banking-accounts"), + BANKING_TRANSACTION_CATEGORIES("banking-transactionCategories"), + BANKING_TRANSACTIONS("banking-transactions"), + COMMERCE_COMPANY_INFO("commerce-companyInfo"), + COMMERCE_CUSTOMERS("commerce-customers"), + COMMERCE_DISPUTES("commerce-disputes"), + COMMERCE_LOCATIONS("commerce-locations"), + COMMERCE_ORDERS("commerce-orders"), + COMMERCE_PAYMENT_METHODS("commerce-paymentMethods"), + COMMERCE_PAYMENTS("commerce-payments"), + COMMERCE_PRODUCT_CATEGORIES("commerce-productCategories"), + COMMERCE_PRODUCTS("commerce-products"), + COMMERCE_TAX_COMPONENTS("commerce-taxComponents"), + COMMERCE_TRANSACTIONS("commerce-transactions"); + + @JsonValue + private final String value; + + private DataTypes(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostLineItem.java new file mode 100644 index 00000000..d10170ee --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostLineItem.java @@ -0,0 +1,848 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DirectCostLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Friendly name of the goods or services. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Discount amount for the line before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Discount percentage for the line before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * Number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Amount of tax for the line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * Total amount of the line, including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + @Deprecated + private JsonNullable> trackingCategoryRefs; + + /** + * Price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + public DirectCostLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("tracking") Optional tracking, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(tracking, "tracking"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.itemRef = itemRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.tracking = tracking; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Friendly name of the goods or services. + */ + public JsonNullable description() { + return description; + } + + /** + * Discount amount for the line before tax. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Discount percentage for the line before tax. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * Number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public double quantity() { + return quantity; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Amount of tax for the line. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * Total amount of the line, including tax. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + public Optional tracking() { + return tracking; + } + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * Price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public double unitAmount() { + return unitAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public DirectCostLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public DirectCostLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services. + */ + public DirectCostLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services. + */ + public DirectCostLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Discount amount for the line before tax. + */ + public DirectCostLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Discount amount for the line before tax. + */ + public DirectCostLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public DirectCostLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public DirectCostLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public DirectCostLineItem withItemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public DirectCostLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public DirectCostLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public DirectCostLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public DirectCostLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public DirectCostLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public DirectCostLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public DirectCostLineItem withTaxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public DirectCostLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. + */ + public DirectCostLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. + */ + public DirectCostLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public DirectCostLineItem withTracking(Tracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + public DirectCostLineItem withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public DirectCostLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public DirectCostLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public DirectCostLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectCostLineItem other = (DirectCostLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + + @Override + public String toString() { + return Utils.toString(DirectCostLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "itemRef", itemRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "tracking", tracking, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional itemRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private Optional tracking = Optional.empty(); + + @Deprecated + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Discount amount for the line before tax. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Discount amount for the line before tax. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public Builder tracking(Tracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Collection of categories against which this direct cost is tracked. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + public DirectCostLineItem build() { + return new DirectCostLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototype.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototype.java new file mode 100644 index 00000000..7de6de2e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototype.java @@ -0,0 +1,927 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DirectCostPrototype { + + /** + * A customer or supplier associated with the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("contactRef") + private Optional contactRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonProperty("currency") + private String currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("issueDate") + private String issueDate; + + /** + * An array of line items. + */ + @JsonProperty("lineItems") + private java.util.List lineItems; + + /** + * A note attached to the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * An array of payment allocations. + */ + @JsonProperty("paymentAllocations") + private java.util.List paymentAllocations; + + /** + * User-friendly reference for the direct cost. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + /** + * The total amount of the direct costs, excluding any taxes. + */ + @JsonProperty("subTotal") + private double subTotal; + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplementalData") + private Optional supplementalData; + + /** + * The total amount of tax on the direct costs. + */ + @JsonProperty("taxAmount") + private double taxAmount; + + /** + * The amount of the direct costs, inclusive of tax. + */ + @JsonProperty("totalAmount") + private double totalAmount; + + public DirectCostPrototype( + @JsonProperty("contactRef") Optional contactRef, + @JsonProperty("currency") String currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("issueDate") String issueDate, + @JsonProperty("lineItems") java.util.List lineItems, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paymentAllocations") java.util.List paymentAllocations, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("subTotal") double subTotal, + @JsonProperty("supplementalData") Optional supplementalData, + @JsonProperty("taxAmount") double taxAmount, + @JsonProperty("totalAmount") double totalAmount) { + Utils.checkNotNull(contactRef, "contactRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(supplementalData, "supplementalData"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.contactRef = contactRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.issueDate = issueDate; + this.lineItems = lineItems; + this.note = note; + this.paymentAllocations = paymentAllocations; + this.reference = reference; + this.subTotal = subTotal; + this.supplementalData = supplementalData; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Optional contactRef() { + return contactRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public String currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * 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 String issueDate() { + return issueDate; + } + + /** + * An array of line items. + */ + public java.util.List lineItems() { + return lineItems; + } + + /** + * A note attached to the direct cost. + */ + public JsonNullable note() { + return note; + } + + /** + * An array of payment allocations. + */ + public java.util.List paymentAllocations() { + return paymentAllocations; + } + + /** + * User-friendly reference for the direct cost. + */ + public JsonNullable reference() { + return reference; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public double subTotal() { + return subTotal; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Optional supplementalData() { + return supplementalData; + } + + /** + * The total amount of tax on the direct costs. + */ + public double taxAmount() { + return taxAmount; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public double totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A customer or supplier associated with the direct cost. + */ + public DirectCostPrototype withContactRef(ContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public DirectCostPrototype withContactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public DirectCostPrototype withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public DirectCostPrototype withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public DirectCostPrototype withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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 DirectCostPrototype withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public DirectCostPrototype withLineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + /** + * A note attached to the direct cost. + */ + public DirectCostPrototype withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public DirectCostPrototype withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public DirectCostPrototype withPaymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public DirectCostPrototype withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public DirectCostPrototype withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public DirectCostPrototype withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public DirectCostPrototype withSupplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public DirectCostPrototype withSupplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public DirectCostPrototype withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public DirectCostPrototype withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectCostPrototype other = (DirectCostPrototype) o; + return + java.util.Objects.deepEquals(this.contactRef, other.contactRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.lineItems, other.lineItems) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paymentAllocations, other.paymentAllocations) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.supplementalData, other.supplementalData) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contactRef, + currency, + currencyRate, + issueDate, + lineItems, + note, + paymentAllocations, + reference, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(DirectCostPrototype.class, + "contactRef", contactRef, + "currency", currency, + "currencyRate", currencyRate, + "issueDate", issueDate, + "lineItems", lineItems, + "note", note, + "paymentAllocations", paymentAllocations, + "reference", reference, + "subTotal", subTotal, + "supplementalData", supplementalData, + "taxAmount", taxAmount, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional contactRef = Optional.empty(); + + private String currency; + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private String issueDate; + + private java.util.List lineItems; + + private JsonNullable note = JsonNullable.undefined(); + + private java.util.List paymentAllocations; + + private JsonNullable reference = JsonNullable.undefined(); + + private Double subTotal; + + private Optional supplementalData = Optional.empty(); + + private Double taxAmount; + + private Double totalAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(ContactReference contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = Optional.ofNullable(contactRef); + return this; + } + + /** + * A customer or supplier associated with the direct cost. + */ + public Builder contactRef(Optional contactRef) { + Utils.checkNotNull(contactRef, "contactRef"); + this.contactRef = contactRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + /** + * An array of line items. + */ + public Builder lineItems(java.util.List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * A note attached to the direct cost. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + return this; + } + + /** + * An array of payment allocations. + */ + public Builder paymentAllocations(java.util.List paymentAllocations) { + Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + this.paymentAllocations = paymentAllocations; + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * User-friendly reference for the direct cost. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + /** + * The total amount of the direct costs, excluding any taxes. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(SupplementalData supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = Optional.ofNullable(supplementalData); + return this; + } + + /** + * Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + public Builder supplementalData(Optional supplementalData) { + Utils.checkNotNull(supplementalData, "supplementalData"); + this.supplementalData = supplementalData; + return this; + } + + /** + * The total amount of tax on the direct costs. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The amount of the direct costs, inclusive of tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public DirectCostPrototype build() { + return new DirectCostPrototype( + contactRef, + currency, + currencyRate, + issueDate, + lineItems, + note, + paymentAllocations, + reference, + subTotal, + supplementalData, + taxAmount, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototypeDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototypeDataType.java new file mode 100644 index 00000000..a3aaa491 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectCostPrototypeDataType.java @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * DirectCostPrototypeDataType - Allowed name of the 'dataType'. + */ +public enum DirectCostPrototypeDataType { + CUSTOMERS("customers"), + SUPPLIERS("suppliers"); + + @JsonValue + private final String value; + + private DirectCostPrototypeDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DirectIncomeLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectIncomeLineItem.java new file mode 100644 index 00000000..e1f992cc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DirectIncomeLineItem.java @@ -0,0 +1,800 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class DirectIncomeLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * A user-friendly name of the goods or services. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Discount amount for the line before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Discount percentage for the line before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * The number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * The total amount of the line, including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + /** + * An array of categories against which this direct cost is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + private JsonNullable> trackingCategoryRefs; + + /** + * The price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + public DirectIncomeLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.itemRef = itemRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * A user-friendly name of the goods or services. + */ + public JsonNullable description() { + return description; + } + + /** + * Discount amount for the line before tax. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Discount percentage for the line before tax. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * The number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public double quantity() { + return quantity; + } + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * The total amount of the line, including tax. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * An array of categories against which this direct cost is tracked. + */ + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * The price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public double unitAmount() { + return unitAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public DirectIncomeLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public DirectIncomeLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * A user-friendly name of the goods or services. + */ + public DirectIncomeLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * A user-friendly name of the goods or services. + */ + public DirectIncomeLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Discount amount for the line before tax. + */ + public DirectIncomeLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Discount amount for the line before tax. + */ + public DirectIncomeLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public DirectIncomeLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public DirectIncomeLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public DirectIncomeLineItem withItemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public DirectIncomeLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public DirectIncomeLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + public DirectIncomeLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + public DirectIncomeLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + public DirectIncomeLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + public DirectIncomeLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public DirectIncomeLineItem withTaxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public DirectIncomeLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * The total amount of the line, including tax. + */ + public DirectIncomeLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the line, including tax. + */ + public DirectIncomeLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * An array of categories against which this direct cost is tracked. + */ + public DirectIncomeLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * An array of categories against which this direct cost is tracked. + */ + public DirectIncomeLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * The price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public DirectIncomeLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectIncomeLineItem other = (DirectIncomeLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + trackingCategoryRefs, + unitAmount); + } + + @Override + public String toString() { + return Utils.toString(DirectIncomeLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "itemRef", itemRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional itemRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * A user-friendly name of the goods or services. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * A user-friendly name of the goods or services. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Discount amount for the line before tax. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Discount amount for the line before tax. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Discount percentage for the line before tax. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The number of units of goods or services received. + * + * Note: If the platform does not provide this information, the quantity will be mapped as 1. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * The amount of the line, inclusive of discounts, but exclusive of tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * The amount of tax for the line. + * Note: If the platform does not provide this information, the quantity will be mapped as 0.00. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * The total amount of the line, including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the line, including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * An array of categories against which this direct cost is tracked. + */ + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * An array of categories against which this direct cost is tracked. + */ + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * The price of each unit of goods or services. + * Note: If the platform does not provide this information, the unit amount will be mapped to the total amount. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + public DirectIncomeLineItem build() { + return new DirectIncomeLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + trackingCategoryRefs, + unitAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/DisputeStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/DisputeStatus.java new file mode 100644 index 00000000..2b0ff9bd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/DisputeStatus.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * DisputeStatus - Current status of the dispute + */ +public enum DisputeStatus { + WON("Won"), + LOST("Lost"), + ACCEPTED("Accepted"), + PROCESSING("Processing"), + CHARGE_REFUNDED("ChargeRefunded"), + EVIDENCE_REQUIRED("EvidenceRequired"), + INQUIRY_EVIDENCE_REQUIRED("InquiryEvidenceRequired"), + INQUIRY_PROCESSING("InquiryProcessing"), + INQUIRY_CLOSED("InquiryClosed"), + WAITING_THIRD_PARTY("WaitingThirdParty"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private DisputeStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowItem.java new file mode 100644 index 00000000..e85e0383 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowItem.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedCashFlowItem { + + /** + * An array of transaction data. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactions") + private Optional> transactions; + + public EnhancedCashFlowItem( + @JsonProperty("transactions") Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + } + + /** + * An array of transaction data. + */ + public Optional> transactions() { + return transactions; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An array of transaction data. + */ + public EnhancedCashFlowItem withTransactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + /** + * An array of transaction data. + */ + public EnhancedCashFlowItem withTransactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedCashFlowItem other = (EnhancedCashFlowItem) o; + return + java.util.Objects.deepEquals(this.transactions, other.transactions); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + transactions); + } + + @Override + public String toString() { + return Utils.toString(EnhancedCashFlowItem.class, + "transactions", transactions); + } + + public final static class Builder { + + private Optional> transactions = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * An array of transaction data. + */ + public Builder transactions(java.util.List transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = Optional.ofNullable(transactions); + return this; + } + + /** + * An array of transaction data. + */ + public Builder transactions(Optional> transactions) { + Utils.checkNotNull(transactions, "transactions"); + this.transactions = transactions; + return this; + } + + public EnhancedCashFlowItem build() { + return new EnhancedCashFlowItem( + transactions); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransaction.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransaction.java new file mode 100644 index 00000000..f0a6a066 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransaction.java @@ -0,0 +1,714 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedCashFlowTransaction { + + /** + * An account reference containing the account id and name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * The bank transaction amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * The description of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * The unique identifier of the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Returns the payment processor responsible for the transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("platformName") + private Optional platformName; + + /** + * A source reference containing the `sourceType` object "Banking". + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceRef") + private Optional sourceRef; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transactionCategory") + private Optional transactionCategory; + + public EnhancedCashFlowTransaction( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("amount") Optional amount, + @JsonProperty("currency") Optional currency, + @JsonProperty("date") Optional date, + @JsonProperty("description") Optional description, + @JsonProperty("id") Optional id, + @JsonProperty("platformName") Optional platformName, + @JsonProperty("sourceRef") Optional sourceRef, + @JsonProperty("transactionCategory") Optional transactionCategory) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(platformName, "platformName"); + Utils.checkNotNull(sourceRef, "sourceRef"); + Utils.checkNotNull(transactionCategory, "transactionCategory"); + this.accountRef = accountRef; + this.amount = amount; + this.currency = currency; + this.date = date; + this.description = description; + this.id = id; + this.platformName = platformName; + this.sourceRef = sourceRef; + this.transactionCategory = transactionCategory; + } + + /** + * An account reference containing the account id and name. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * The bank transaction amount. + */ + public Optional amount() { + return amount; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * The description of the bank transaction. + */ + public Optional description() { + return description; + } + + /** + * The unique identifier of the bank transaction. + */ + public Optional id() { + return id; + } + + /** + * Returns the payment processor responsible for the transaction. + */ + public Optional platformName() { + return platformName; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Optional sourceRef() { + return sourceRef; + } + + public Optional transactionCategory() { + return transactionCategory; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An account reference containing the account id and name. + */ + public EnhancedCashFlowTransaction withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * An account reference containing the account id and name. + */ + public EnhancedCashFlowTransaction withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The bank transaction amount. + */ + public EnhancedCashFlowTransaction withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The bank transaction amount. + */ + public EnhancedCashFlowTransaction withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedCashFlowTransaction withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedCashFlowTransaction withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 EnhancedCashFlowTransaction 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 EnhancedCashFlowTransaction withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * The description of the bank transaction. + */ + public EnhancedCashFlowTransaction withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The description of the bank transaction. + */ + public EnhancedCashFlowTransaction withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public EnhancedCashFlowTransaction withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public EnhancedCashFlowTransaction withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Returns the payment processor responsible for the transaction. + */ + public EnhancedCashFlowTransaction withPlatformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = Optional.ofNullable(platformName); + return this; + } + + /** + * Returns the payment processor responsible for the transaction. + */ + public EnhancedCashFlowTransaction withPlatformName(Optional platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public EnhancedCashFlowTransaction withSourceRef(SourceRef sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = Optional.ofNullable(sourceRef); + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public EnhancedCashFlowTransaction withSourceRef(Optional sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = sourceRef; + return this; + } + + public EnhancedCashFlowTransaction withTransactionCategory(TransactionCategory transactionCategory) { + Utils.checkNotNull(transactionCategory, "transactionCategory"); + this.transactionCategory = Optional.ofNullable(transactionCategory); + return this; + } + + public EnhancedCashFlowTransaction withTransactionCategory(Optional transactionCategory) { + Utils.checkNotNull(transactionCategory, "transactionCategory"); + this.transactionCategory = transactionCategory; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedCashFlowTransaction other = (EnhancedCashFlowTransaction) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.platformName, other.platformName) && + java.util.Objects.deepEquals(this.sourceRef, other.sourceRef) && + java.util.Objects.deepEquals(this.transactionCategory, other.transactionCategory); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + amount, + currency, + date, + description, + id, + platformName, + sourceRef, + transactionCategory); + } + + @Override + public String toString() { + return Utils.toString(EnhancedCashFlowTransaction.class, + "accountRef", accountRef, + "amount", amount, + "currency", currency, + "date", date, + "description", description, + "id", id, + "platformName", platformName, + "sourceRef", sourceRef, + "transactionCategory", transactionCategory); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional platformName = Optional.empty(); + + private Optional sourceRef = Optional.empty(); + + private Optional transactionCategory = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * An account reference containing the account id and name. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * An account reference containing the account id and name. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The bank transaction amount. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The bank transaction amount. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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(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; + } + + /** + * The description of the bank transaction. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The description of the bank transaction. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The unique identifier of the bank transaction. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Returns the payment processor responsible for the transaction. + */ + public Builder platformName(String platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = Optional.ofNullable(platformName); + return this; + } + + /** + * Returns the payment processor responsible for the transaction. + */ + public Builder platformName(Optional platformName) { + Utils.checkNotNull(platformName, "platformName"); + this.platformName = platformName; + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Builder sourceRef(SourceRef sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = Optional.ofNullable(sourceRef); + return this; + } + + /** + * A source reference containing the `sourceType` object "Banking". + */ + public Builder sourceRef(Optional sourceRef) { + Utils.checkNotNull(sourceRef, "sourceRef"); + this.sourceRef = sourceRef; + return this; + } + + public Builder transactionCategory(TransactionCategory transactionCategory) { + Utils.checkNotNull(transactionCategory, "transactionCategory"); + this.transactionCategory = Optional.ofNullable(transactionCategory); + return this; + } + + public Builder transactionCategory(Optional transactionCategory) { + Utils.checkNotNull(transactionCategory, "transactionCategory"); + this.transactionCategory = transactionCategory; + return this; + } + + public EnhancedCashFlowTransaction build() { + return new EnhancedCashFlowTransaction( + accountRef, + amount, + currency, + date, + description, + id, + platformName, + sourceRef, + transactionCategory); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransactions.java new file mode 100644 index 00000000..9e457f33 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedCashFlowTransactions.java @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * EnhancedCashFlowTransactions - > **Categorization engine** + * > + * > The categorization engine uses machine learning and has been fully trained against Plaid and TrueLayer banking data sources. It is not fully trained against the Basiq banking data source. + * + * The Enhanced Cash Flow Transactions endpoint provides a fully categorized list of banking transactions for a company. Accounts and transaction data are obtained from the company's banking data sources. + */ + +public class EnhancedCashFlowTransactions { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataSources") + private Optional> dataSources; + + /** + * Report additional information, which is specific to Lending API reports. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional reportInfo; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportItems") + private Optional> reportItems; + + public EnhancedCashFlowTransactions( + @JsonProperty("dataSources") Optional> dataSources, + @JsonProperty("reportInfo") Optional reportInfo, + @JsonProperty("reportItems") Optional> reportItems) { + Utils.checkNotNull(dataSources, "dataSources"); + Utils.checkNotNull(reportInfo, "reportInfo"); + Utils.checkNotNull(reportItems, "reportItems"); + this.dataSources = dataSources; + this.reportInfo = reportInfo; + this.reportItems = reportItems; + } + + public Optional> dataSources() { + return dataSources; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Optional reportInfo() { + return reportInfo; + } + + public Optional> reportItems() { + return reportItems; + } + + public final static Builder builder() { + return new Builder(); + } + + public EnhancedCashFlowTransactions withDataSources(java.util.List dataSources) { + Utils.checkNotNull(dataSources, "dataSources"); + this.dataSources = Optional.ofNullable(dataSources); + return this; + } + + public EnhancedCashFlowTransactions withDataSources(Optional> dataSources) { + Utils.checkNotNull(dataSources, "dataSources"); + this.dataSources = dataSources; + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public EnhancedCashFlowTransactions withReportInfo(ReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public EnhancedCashFlowTransactions withReportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + public EnhancedCashFlowTransactions withReportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + public EnhancedCashFlowTransactions withReportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedCashFlowTransactions other = (EnhancedCashFlowTransactions) o; + return + java.util.Objects.deepEquals(this.dataSources, other.dataSources) && + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo) && + java.util.Objects.deepEquals(this.reportItems, other.reportItems); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataSources, + reportInfo, + reportItems); + } + + @Override + public String toString() { + return Utils.toString(EnhancedCashFlowTransactions.class, + "dataSources", dataSources, + "reportInfo", reportInfo, + "reportItems", reportItems); + } + + public final static class Builder { + + private Optional> dataSources = Optional.empty(); + + private Optional reportInfo = Optional.empty(); + + private Optional> reportItems = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder dataSources(java.util.List dataSources) { + Utils.checkNotNull(dataSources, "dataSources"); + this.dataSources = Optional.ofNullable(dataSources); + return this; + } + + public Builder dataSources(Optional> dataSources) { + Utils.checkNotNull(dataSources, "dataSources"); + this.dataSources = dataSources; + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Builder reportInfo(ReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Builder reportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + public Builder reportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + public Builder reportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + public EnhancedCashFlowTransactions build() { + return new EnhancedCashFlowTransactions( + dataSources, + reportInfo, + reportItems); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedFinancialReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedFinancialReport.java new file mode 100644 index 00000000..4828f93a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedFinancialReport.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedFinancialReport { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional reportInfo; + + /** + * An array of report items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportItems") + private Optional> reportItems; + + public EnhancedFinancialReport( + @JsonProperty("reportInfo") Optional reportInfo, + @JsonProperty("reportItems") Optional> reportItems) { + Utils.checkNotNull(reportInfo, "reportInfo"); + Utils.checkNotNull(reportItems, "reportItems"); + this.reportInfo = reportInfo; + this.reportItems = reportItems; + } + + public Optional reportInfo() { + return reportInfo; + } + + /** + * An array of report items. + */ + public Optional> reportItems() { + return reportItems; + } + + public final static Builder builder() { + return new Builder(); + } + + public EnhancedFinancialReport withReportInfo(EnhancedReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public EnhancedFinancialReport withReportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * An array of report items. + */ + public EnhancedFinancialReport withReportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * An array of report items. + */ + public EnhancedFinancialReport withReportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedFinancialReport other = (EnhancedFinancialReport) o; + return + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo) && + java.util.Objects.deepEquals(this.reportItems, other.reportItems); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + reportInfo, + reportItems); + } + + @Override + public String toString() { + return Utils.toString(EnhancedFinancialReport.class, + "reportInfo", reportInfo, + "reportItems", reportItems); + } + + public final static class Builder { + + private Optional reportInfo = Optional.empty(); + + private Optional> reportItems = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder reportInfo(EnhancedReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public Builder reportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * An array of report items. + */ + public Builder reportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * An array of report items. + */ + public Builder reportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + public EnhancedFinancialReport build() { + return new EnhancedFinancialReport( + reportInfo, + reportItems); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoiceReportItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoiceReportItem.java new file mode 100644 index 00000000..744f6507 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoiceReportItem.java @@ -0,0 +1,1148 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedInvoiceReportItem { + + /** + * Invoice's total amount due. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amountDue") + private Optional amountDue; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerRef") + private Optional customerRef; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Invoice number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("invoiceNumber") + private Optional invoiceNumber; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("issueDate") + private Optional issueDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paidOnDate") + private Optional paidOnDate; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("payments") + private Optional> payments; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Invoice's total amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public EnhancedInvoiceReportItem( + @JsonProperty("amountDue") Optional amountDue, + @JsonProperty("currency") Optional currency, + @JsonProperty("customerRef") Optional customerRef, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") Optional id, + @JsonProperty("invoiceNumber") Optional invoiceNumber, + @JsonProperty("issueDate") Optional issueDate, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("paidOnDate") Optional paidOnDate, + @JsonProperty("payments") Optional> payments, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(amountDue, "amountDue"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(customerRef, "customerRef"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + Utils.checkNotNull(issueDate, "issueDate"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(paidOnDate, "paidOnDate"); + Utils.checkNotNull(payments, "payments"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.amountDue = amountDue; + this.currency = currency; + this.customerRef = customerRef; + this.dueDate = dueDate; + this.id = id; + this.invoiceNumber = invoiceNumber; + this.issueDate = issueDate; + this.modifiedDate = modifiedDate; + this.paidOnDate = paidOnDate; + this.payments = payments; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.totalAmount = totalAmount; + } + + /** + * Invoice's total amount due. + */ + public Optional amountDue() { + return amountDue; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + public Optional customerRef() { + return customerRef; + } + + /** + * 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 Optional dueDate() { + return dueDate; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * Invoice number. + */ + public Optional invoiceNumber() { + return invoiceNumber; + } + + /** + * 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 Optional issueDate() { + return issueDate; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * 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 Optional paidOnDate() { + return paidOnDate; + } + + public Optional> payments() { + return payments; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public Optional status() { + return status; + } + + /** + * Invoice's total amount. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Invoice's total amount due. + */ + public EnhancedInvoiceReportItem withAmountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = Optional.ofNullable(amountDue); + return this; + } + + /** + * Invoice's total amount due. + */ + public EnhancedInvoiceReportItem withAmountDue(Optional amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedInvoiceReportItem withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedInvoiceReportItem withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public EnhancedInvoiceReportItem withCustomerRef(LendingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public EnhancedInvoiceReportItem withCustomerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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 EnhancedInvoiceReportItem withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 EnhancedInvoiceReportItem withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public EnhancedInvoiceReportItem withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public EnhancedInvoiceReportItem withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Invoice number. + */ + public EnhancedInvoiceReportItem withInvoiceNumber(String invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = Optional.ofNullable(invoiceNumber); + return this; + } + + /** + * Invoice number. + */ + public EnhancedInvoiceReportItem withInvoiceNumber(Optional invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = invoiceNumber; + 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 EnhancedInvoiceReportItem withIssueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 EnhancedInvoiceReportItem withIssueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + public EnhancedInvoiceReportItem withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public EnhancedInvoiceReportItem withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 EnhancedInvoiceReportItem withPaidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 EnhancedInvoiceReportItem withPaidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + public EnhancedInvoiceReportItem withPayments(java.util.List payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = Optional.ofNullable(payments); + return this; + } + + public EnhancedInvoiceReportItem withPayments(Optional> payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = payments; + return this; + } + + public EnhancedInvoiceReportItem withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public EnhancedInvoiceReportItem withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public EnhancedInvoiceReportItem withStatus(InvoiceStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public EnhancedInvoiceReportItem withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Invoice's total amount. + */ + public EnhancedInvoiceReportItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Invoice's total amount. + */ + public EnhancedInvoiceReportItem withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedInvoiceReportItem other = (EnhancedInvoiceReportItem) o; + return + java.util.Objects.deepEquals(this.amountDue, other.amountDue) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.customerRef, other.customerRef) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.invoiceNumber, other.invoiceNumber) && + java.util.Objects.deepEquals(this.issueDate, other.issueDate) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.paidOnDate, other.paidOnDate) && + java.util.Objects.deepEquals(this.payments, other.payments) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amountDue, + currency, + customerRef, + dueDate, + id, + invoiceNumber, + issueDate, + modifiedDate, + paidOnDate, + payments, + sourceModifiedDate, + status, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(EnhancedInvoiceReportItem.class, + "amountDue", amountDue, + "currency", currency, + "customerRef", customerRef, + "dueDate", dueDate, + "id", id, + "invoiceNumber", invoiceNumber, + "issueDate", issueDate, + "modifiedDate", modifiedDate, + "paidOnDate", paidOnDate, + "payments", payments, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional amountDue = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional customerRef = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional invoiceNumber = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional paidOnDate = Optional.empty(); + + private Optional> payments = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Invoice's total amount due. + */ + public Builder amountDue(double amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = Optional.ofNullable(amountDue); + return this; + } + + /** + * Invoice's total amount due. + */ + public Builder amountDue(Optional amountDue) { + Utils.checkNotNull(amountDue, "amountDue"); + this.amountDue = amountDue; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public Builder customerRef(LendingCustomerRef customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = Optional.ofNullable(customerRef); + return this; + } + + public Builder customerRef(Optional customerRef) { + Utils.checkNotNull(customerRef, "customerRef"); + this.customerRef = customerRef; + 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 dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Invoice number. + */ + public Builder invoiceNumber(String invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = Optional.ofNullable(invoiceNumber); + return this; + } + + /** + * Invoice number. + */ + public Builder invoiceNumber(Optional invoiceNumber) { + Utils.checkNotNull(invoiceNumber, "invoiceNumber"); + this.invoiceNumber = invoiceNumber; + 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 issueDate(String issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = Optional.ofNullable(issueDate); + 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 issueDate(Optional issueDate) { + Utils.checkNotNull(issueDate, "issueDate"); + this.issueDate = issueDate; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + 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 paidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 paidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + public Builder payments(java.util.List payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = Optional.ofNullable(payments); + return this; + } + + public Builder payments(Optional> payments) { + Utils.checkNotNull(payments, "payments"); + this.payments = payments; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public Builder status(InvoiceStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Invoice's total amount. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Invoice's total amount. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public EnhancedInvoiceReportItem build() { + return new EnhancedInvoiceReportItem( + amountDue, + currency, + customerRef, + dueDate, + id, + invoiceNumber, + issueDate, + modifiedDate, + paidOnDate, + payments, + sourceModifiedDate, + status, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoicesReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoicesReport.java new file mode 100644 index 00000000..3dced1df --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedInvoicesReport.java @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * EnhancedInvoicesReport - The enhanced invoices report takes the key elements of the Invoices report verifying those marked as paid in the accounting platform have actually been paid by matching with the bank statement. + */ + +public class EnhancedInvoicesReport { + + /** + * Report additional information, which is specific to Lending API reports. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional reportInfo; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportItems") + private Optional> reportItems; + + public EnhancedInvoicesReport( + @JsonProperty("reportInfo") Optional reportInfo, + @JsonProperty("reportItems") Optional> reportItems) { + Utils.checkNotNull(reportInfo, "reportInfo"); + Utils.checkNotNull(reportItems, "reportItems"); + this.reportInfo = reportInfo; + this.reportItems = reportItems; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Optional reportInfo() { + return reportInfo; + } + + public Optional> reportItems() { + return reportItems; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public EnhancedInvoicesReport withReportInfo(ReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public EnhancedInvoicesReport withReportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + public EnhancedInvoicesReport withReportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + public EnhancedInvoicesReport withReportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedInvoicesReport other = (EnhancedInvoicesReport) o; + return + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo) && + java.util.Objects.deepEquals(this.reportItems, other.reportItems); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + reportInfo, + reportItems); + } + + @Override + public String toString() { + return Utils.toString(EnhancedInvoicesReport.class, + "reportInfo", reportInfo, + "reportItems", reportItems); + } + + public final static class Builder { + + private Optional reportInfo = Optional.empty(); + + private Optional> reportItems = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Builder reportInfo(ReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + /** + * Report additional information, which is specific to Lending API reports. + */ + public Builder reportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + public Builder reportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + public Builder reportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + public EnhancedInvoicesReport build() { + return new EnhancedInvoicesReport( + reportInfo, + reportItems); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportAccountCategory.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportAccountCategory.java new file mode 100644 index 00000000..b232baec --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportAccountCategory.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedReportAccountCategory { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("levels") + private Optional> levels; + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + public EnhancedReportAccountCategory( + @JsonProperty("levels") Optional> levels, + @JsonProperty("status") Optional status) { + Utils.checkNotNull(levels, "levels"); + Utils.checkNotNull(status, "status"); + this.levels = levels; + this.status = status; + } + + public Optional> levels() { + return levels; + } + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + public Optional status() { + return status; + } + + public final static Builder builder() { + return new Builder(); + } + + public EnhancedReportAccountCategory withLevels(java.util.List levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = Optional.ofNullable(levels); + return this; + } + + public EnhancedReportAccountCategory withLevels(Optional> levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = levels; + return this; + } + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + public EnhancedReportAccountCategory withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + public EnhancedReportAccountCategory withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedReportAccountCategory other = (EnhancedReportAccountCategory) o; + return + java.util.Objects.deepEquals(this.levels, other.levels) && + java.util.Objects.deepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + levels, + status); + } + + @Override + public String toString() { + return Utils.toString(EnhancedReportAccountCategory.class, + "levels", levels, + "status", status); + } + + public final static class Builder { + + private Optional> levels = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder levels(java.util.List levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = Optional.ofNullable(levels); + return this; + } + + public Builder levels(Optional> levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = levels; + return this; + } + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Returns a status of "Suggested" or "Confirmed". If an account has a confirmed category, it will replace any suggested category returned. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public EnhancedReportAccountCategory build() { + return new EnhancedReportAccountCategory( + levels, + status); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportInfo.java new file mode 100644 index 00000000..3ef1c130 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/EnhancedReportInfo.java @@ -0,0 +1,437 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class EnhancedReportInfo { + + /** + * Name of the company queried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private Optional companyName; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generatedDate") + private Optional generatedDate; + + /** + * The name of the report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportName") + private Optional reportName; + + public EnhancedReportInfo( + @JsonProperty("companyName") Optional companyName, + @JsonProperty("currency") Optional currency, + @JsonProperty("generatedDate") Optional generatedDate, + @JsonProperty("reportName") Optional reportName) { + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(generatedDate, "generatedDate"); + Utils.checkNotNull(reportName, "reportName"); + this.companyName = companyName; + this.currency = currency; + this.generatedDate = generatedDate; + this.reportName = reportName; + } + + /** + * Name of the company queried. + */ + public Optional companyName() { + return companyName; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * 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 Optional generatedDate() { + return generatedDate; + } + + /** + * The name of the report. + */ + public Optional reportName() { + return reportName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the company queried. + */ + public EnhancedReportInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public EnhancedReportInfo withCompanyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedReportInfo withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public EnhancedReportInfo withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 EnhancedReportInfo withGeneratedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 EnhancedReportInfo withGeneratedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The name of the report. + */ + public EnhancedReportInfo withReportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public EnhancedReportInfo withReportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnhancedReportInfo other = (EnhancedReportInfo) o; + return + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.generatedDate, other.generatedDate) && + java.util.Objects.deepEquals(this.reportName, other.reportName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyName, + currency, + generatedDate, + reportName); + } + + @Override + public String toString() { + return Utils.toString(EnhancedReportInfo.class, + "companyName", companyName, + "currency", currency, + "generatedDate", generatedDate, + "reportName", reportName); + } + + public final static class Builder { + + private Optional companyName = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional generatedDate = Optional.empty(); + + private Optional reportName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the company queried. + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public Builder companyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 generatedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 generatedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + public EnhancedReportInfo build() { + return new EnhancedReportInfo( + companyName, + currency, + generatedDate, + reportName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ErrorMessage.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ErrorMessage.java new file mode 100644 index 00000000..c2ee6b32 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ErrorMessage.java @@ -0,0 +1,411 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ErrorMessage { + + /** + * `True` if the error occurred transiently and can be retried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("canBeRetried") + private Optional canBeRetried; + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("correlationId") + private Optional correlationId; + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("detailedErrorCode") + private Optional detailedErrorCode; + + /** + * A brief description of the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("error") + private Optional error; + + /** + * Codat's service the returned the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("service") + private Optional service; + + /** + * The HTTP status code returned by the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusCode") + private Optional statusCode; + + public ErrorMessage( + @JsonProperty("canBeRetried") Optional canBeRetried, + @JsonProperty("correlationId") Optional correlationId, + @JsonProperty("detailedErrorCode") Optional detailedErrorCode, + @JsonProperty("error") Optional error, + @JsonProperty("service") Optional service, + @JsonProperty("statusCode") Optional statusCode) { + Utils.checkNotNull(canBeRetried, "canBeRetried"); + Utils.checkNotNull(correlationId, "correlationId"); + Utils.checkNotNull(detailedErrorCode, "detailedErrorCode"); + Utils.checkNotNull(error, "error"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(statusCode, "statusCode"); + this.canBeRetried = canBeRetried; + this.correlationId = correlationId; + this.detailedErrorCode = detailedErrorCode; + this.error = error; + this.service = service; + this.statusCode = statusCode; + } + + /** + * `True` if the error occurred transiently and can be retried. + */ + public Optional canBeRetried() { + return canBeRetried; + } + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + public Optional correlationId() { + return correlationId; + } + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + public Optional detailedErrorCode() { + return detailedErrorCode; + } + + /** + * A brief description of the error. + */ + public Optional error() { + return error; + } + + /** + * Codat's service the returned the error. + */ + public Optional service() { + return service; + } + + /** + * The HTTP status code returned by the error. + */ + public Optional statusCode() { + return statusCode; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * `True` if the error occurred transiently and can be retried. + */ + public ErrorMessage withCanBeRetried(String canBeRetried) { + Utils.checkNotNull(canBeRetried, "canBeRetried"); + this.canBeRetried = Optional.ofNullable(canBeRetried); + return this; + } + + /** + * `True` if the error occurred transiently and can be retried. + */ + public ErrorMessage withCanBeRetried(Optional canBeRetried) { + Utils.checkNotNull(canBeRetried, "canBeRetried"); + this.canBeRetried = canBeRetried; + return this; + } + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + public ErrorMessage withCorrelationId(String correlationId) { + Utils.checkNotNull(correlationId, "correlationId"); + this.correlationId = Optional.ofNullable(correlationId); + return this; + } + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + public ErrorMessage withCorrelationId(Optional correlationId) { + Utils.checkNotNull(correlationId, "correlationId"); + this.correlationId = correlationId; + return this; + } + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + public ErrorMessage withDetailedErrorCode(long detailedErrorCode) { + Utils.checkNotNull(detailedErrorCode, "detailedErrorCode"); + this.detailedErrorCode = Optional.ofNullable(detailedErrorCode); + return this; + } + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + public ErrorMessage withDetailedErrorCode(Optional detailedErrorCode) { + Utils.checkNotNull(detailedErrorCode, "detailedErrorCode"); + this.detailedErrorCode = detailedErrorCode; + return this; + } + + /** + * A brief description of the error. + */ + public ErrorMessage withError(String error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + /** + * A brief description of the error. + */ + public ErrorMessage withError(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + /** + * Codat's service the returned the error. + */ + public ErrorMessage withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = Optional.ofNullable(service); + return this; + } + + /** + * Codat's service the returned the error. + */ + public ErrorMessage withService(Optional service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public ErrorMessage withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public ErrorMessage 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; + } + ErrorMessage other = (ErrorMessage) o; + return + java.util.Objects.deepEquals(this.canBeRetried, other.canBeRetried) && + java.util.Objects.deepEquals(this.correlationId, other.correlationId) && + java.util.Objects.deepEquals(this.detailedErrorCode, other.detailedErrorCode) && + java.util.Objects.deepEquals(this.error, other.error) && + java.util.Objects.deepEquals(this.service, other.service) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + canBeRetried, + correlationId, + detailedErrorCode, + error, + service, + statusCode); + } + + @Override + public String toString() { + return Utils.toString(ErrorMessage.class, + "canBeRetried", canBeRetried, + "correlationId", correlationId, + "detailedErrorCode", detailedErrorCode, + "error", error, + "service", service, + "statusCode", statusCode); + } + + public final static class Builder { + + private Optional canBeRetried = Optional.empty(); + + private Optional correlationId = Optional.empty(); + + private Optional detailedErrorCode = Optional.empty(); + + private Optional error = Optional.empty(); + + private Optional service = Optional.empty(); + + private Optional statusCode = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * `True` if the error occurred transiently and can be retried. + */ + public Builder canBeRetried(String canBeRetried) { + Utils.checkNotNull(canBeRetried, "canBeRetried"); + this.canBeRetried = Optional.ofNullable(canBeRetried); + return this; + } + + /** + * `True` if the error occurred transiently and can be retried. + */ + public Builder canBeRetried(Optional canBeRetried) { + Utils.checkNotNull(canBeRetried, "canBeRetried"); + this.canBeRetried = canBeRetried; + return this; + } + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + public Builder correlationId(String correlationId) { + Utils.checkNotNull(correlationId, "correlationId"); + this.correlationId = Optional.ofNullable(correlationId); + return this; + } + + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + */ + public Builder correlationId(Optional correlationId) { + Utils.checkNotNull(correlationId, "correlationId"); + this.correlationId = correlationId; + return this; + } + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + public Builder detailedErrorCode(long detailedErrorCode) { + Utils.checkNotNull(detailedErrorCode, "detailedErrorCode"); + this.detailedErrorCode = Optional.ofNullable(detailedErrorCode); + return this; + } + + /** + * Machine readable error code used to automate processes based on the code returned. + */ + public Builder detailedErrorCode(Optional detailedErrorCode) { + Utils.checkNotNull(detailedErrorCode, "detailedErrorCode"); + this.detailedErrorCode = detailedErrorCode; + return this; + } + + /** + * A brief description of the error. + */ + public Builder error(String error) { + Utils.checkNotNull(error, "error"); + this.error = Optional.ofNullable(error); + return this; + } + + /** + * A brief description of the error. + */ + public Builder error(Optional error) { + Utils.checkNotNull(error, "error"); + this.error = error; + return this; + } + + /** + * Codat's service the returned the error. + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = Optional.ofNullable(service); + return this; + } + + /** + * Codat's service the returned the error. + */ + public Builder service(Optional service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = Optional.ofNullable(statusCode); + return this; + } + + /** + * The HTTP status code returned by the error. + */ + public Builder statusCode(Optional statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + public ErrorMessage build() { + return new ErrorMessage( + canBeRetried, + correlationId, + detailedErrorCode, + error, + service, + statusCode); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelReportTypes.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelReportTypes.java new file mode 100644 index 00000000..e5857ac1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelReportTypes.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ExcelReportTypes - The type of the report requested in the query string. + */ +public enum ExcelReportTypes { + AUDIT("audit"), + ENHANCED_FINANCIALS("enhancedFinancials"), + ENHANCED_INVOICES("enhancedInvoices"), + ENHANCED_CASH_FLOW("enhancedCashFlow"); + + @JsonValue + private final String value; + + private ExcelReportTypes(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelStatus.java new file mode 100644 index 00000000..98290caf --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ExcelStatus.java @@ -0,0 +1,638 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExcelStatus { + + /** + * Error details in case the report generation request was unsuccessful. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private Optional errorMessage; + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fileSize") + private JsonNullable fileSize; + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("inProgress") + private Optional inProgress; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastGenerated") + private Optional lastGenerated; + + /** + * A unique ID generated for this request. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lastInvocationId") + private Optional lastInvocationId; + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("queued") + private Optional queued; + + /** + * The type of the report requested in the query string. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportType") + private Optional reportType; + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("success") + private Optional success; + + public ExcelStatus( + @JsonProperty("errorMessage") Optional errorMessage, + @JsonProperty("fileSize") JsonNullable fileSize, + @JsonProperty("inProgress") Optional inProgress, + @JsonProperty("lastGenerated") Optional lastGenerated, + @JsonProperty("lastInvocationId") Optional lastInvocationId, + @JsonProperty("queued") Optional queued, + @JsonProperty("reportType") Optional reportType, + @JsonProperty("success") Optional success) { + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(fileSize, "fileSize"); + Utils.checkNotNull(inProgress, "inProgress"); + Utils.checkNotNull(lastGenerated, "lastGenerated"); + Utils.checkNotNull(lastInvocationId, "lastInvocationId"); + Utils.checkNotNull(queued, "queued"); + Utils.checkNotNull(reportType, "reportType"); + Utils.checkNotNull(success, "success"); + this.errorMessage = errorMessage; + this.fileSize = fileSize; + this.inProgress = inProgress; + this.lastGenerated = lastGenerated; + this.lastInvocationId = lastInvocationId; + this.queued = queued; + this.reportType = reportType; + this.success = success; + } + + /** + * Error details in case the report generation request was unsuccessful. + */ + public Optional errorMessage() { + return errorMessage; + } + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + public JsonNullable fileSize() { + return fileSize; + } + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + public Optional inProgress() { + return inProgress; + } + + /** + * 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 Optional lastGenerated() { + return lastGenerated; + } + + /** + * A unique ID generated for this request. + */ + public Optional lastInvocationId() { + return lastInvocationId; + } + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + public Optional queued() { + return queued; + } + + /** + * The type of the report requested in the query string. + */ + public Optional reportType() { + return reportType; + } + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + public Optional success() { + return success; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Error details in case the report generation request was unsuccessful. + */ + public ExcelStatus withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Error details in case the report generation request was unsuccessful. + */ + public ExcelStatus withErrorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + public ExcelStatus withFileSize(long fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = JsonNullable.of(fileSize); + return this; + } + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + public ExcelStatus withFileSize(JsonNullable fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = fileSize; + return this; + } + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + public ExcelStatus withInProgress(boolean inProgress) { + Utils.checkNotNull(inProgress, "inProgress"); + this.inProgress = Optional.ofNullable(inProgress); + return this; + } + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + public ExcelStatus withInProgress(Optional inProgress) { + Utils.checkNotNull(inProgress, "inProgress"); + this.inProgress = inProgress; + 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 ExcelStatus withLastGenerated(String lastGenerated) { + Utils.checkNotNull(lastGenerated, "lastGenerated"); + this.lastGenerated = Optional.ofNullable(lastGenerated); + 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 ExcelStatus withLastGenerated(Optional lastGenerated) { + Utils.checkNotNull(lastGenerated, "lastGenerated"); + this.lastGenerated = lastGenerated; + return this; + } + + /** + * A unique ID generated for this request. + */ + public ExcelStatus withLastInvocationId(String lastInvocationId) { + Utils.checkNotNull(lastInvocationId, "lastInvocationId"); + this.lastInvocationId = Optional.ofNullable(lastInvocationId); + return this; + } + + /** + * A unique ID generated for this request. + */ + public ExcelStatus withLastInvocationId(Optional lastInvocationId) { + Utils.checkNotNull(lastInvocationId, "lastInvocationId"); + this.lastInvocationId = lastInvocationId; + return this; + } + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + public ExcelStatus withQueued(String queued) { + Utils.checkNotNull(queued, "queued"); + this.queued = Optional.ofNullable(queued); + return this; + } + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + public ExcelStatus withQueued(Optional queued) { + Utils.checkNotNull(queued, "queued"); + this.queued = queued; + return this; + } + + /** + * The type of the report requested in the query string. + */ + public ExcelStatus withReportType(ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = Optional.ofNullable(reportType); + return this; + } + + /** + * The type of the report requested in the query string. + */ + public ExcelStatus withReportType(Optional reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + public ExcelStatus withSuccess(boolean success) { + Utils.checkNotNull(success, "success"); + this.success = Optional.ofNullable(success); + return this; + } + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + public ExcelStatus withSuccess(Optional success) { + Utils.checkNotNull(success, "success"); + this.success = success; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExcelStatus other = (ExcelStatus) o; + return + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.fileSize, other.fileSize) && + java.util.Objects.deepEquals(this.inProgress, other.inProgress) && + java.util.Objects.deepEquals(this.lastGenerated, other.lastGenerated) && + java.util.Objects.deepEquals(this.lastInvocationId, other.lastInvocationId) && + java.util.Objects.deepEquals(this.queued, other.queued) && + java.util.Objects.deepEquals(this.reportType, other.reportType) && + java.util.Objects.deepEquals(this.success, other.success); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errorMessage, + fileSize, + inProgress, + lastGenerated, + lastInvocationId, + queued, + reportType, + success); + } + + @Override + public String toString() { + return Utils.toString(ExcelStatus.class, + "errorMessage", errorMessage, + "fileSize", fileSize, + "inProgress", inProgress, + "lastGenerated", lastGenerated, + "lastInvocationId", lastInvocationId, + "queued", queued, + "reportType", reportType, + "success", success); + } + + public final static class Builder { + + private Optional errorMessage = Optional.empty(); + + private JsonNullable fileSize = JsonNullable.undefined(); + + private Optional inProgress = Optional.empty(); + + private Optional lastGenerated = Optional.empty(); + + private Optional lastInvocationId = Optional.empty(); + + private Optional queued = Optional.empty(); + + private Optional reportType = Optional.empty(); + + private Optional success = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Error details in case the report generation request was unsuccessful. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + /** + * Error details in case the report generation request was unsuccessful. + */ + public Builder errorMessage(Optional errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + public Builder fileSize(long fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = JsonNullable.of(fileSize); + return this; + } + + /** + * The file size in Bytes is populated upon successful generation of the report. + */ + public Builder fileSize(JsonNullable fileSize) { + Utils.checkNotNull(fileSize, "fileSize"); + this.fileSize = fileSize; + return this; + } + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + public Builder inProgress(boolean inProgress) { + Utils.checkNotNull(inProgress, "inProgress"); + this.inProgress = Optional.ofNullable(inProgress); + return this; + } + + /** + * When true, the request was successful and the report is being generated. If false, the request was unsuccessful and the report is not being generated. + */ + public Builder inProgress(Optional inProgress) { + Utils.checkNotNull(inProgress, "inProgress"); + this.inProgress = inProgress; + 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 lastGenerated(String lastGenerated) { + Utils.checkNotNull(lastGenerated, "lastGenerated"); + this.lastGenerated = Optional.ofNullable(lastGenerated); + 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 lastGenerated(Optional lastGenerated) { + Utils.checkNotNull(lastGenerated, "lastGenerated"); + this.lastGenerated = lastGenerated; + return this; + } + + /** + * A unique ID generated for this request. + */ + public Builder lastInvocationId(String lastInvocationId) { + Utils.checkNotNull(lastInvocationId, "lastInvocationId"); + this.lastInvocationId = Optional.ofNullable(lastInvocationId); + return this; + } + + /** + * A unique ID generated for this request. + */ + public Builder lastInvocationId(Optional lastInvocationId) { + Utils.checkNotNull(lastInvocationId, "lastInvocationId"); + this.lastInvocationId = lastInvocationId; + return this; + } + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + public Builder queued(String queued) { + Utils.checkNotNull(queued, "queued"); + this.queued = Optional.ofNullable(queued); + return this; + } + + /** + * The date and time of when a successful request was queued for the most recent report. + */ + public Builder queued(Optional queued) { + Utils.checkNotNull(queued, "queued"); + this.queued = queued; + return this; + } + + /** + * The type of the report requested in the query string. + */ + public Builder reportType(ExcelReportTypes reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = Optional.ofNullable(reportType); + return this; + } + + /** + * The type of the report requested in the query string. + */ + public Builder reportType(Optional reportType) { + Utils.checkNotNull(reportType, "reportType"); + this.reportType = reportType; + return this; + } + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + public Builder success(boolean success) { + Utils.checkNotNull(success, "success"); + this.success = Optional.ofNullable(success); + return this; + } + + /** + * True if the requested report was successfully queued and false if the requested report was not able to be queued. + */ + public Builder success(Optional success) { + Utils.checkNotNull(success, "success"); + this.success = success; + return this; + } + + public ExcelStatus build() { + return new ExcelStatus( + errorMessage, + fileSize, + inProgress, + lastGenerated, + lastInvocationId, + queued, + reportType, + success); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/File.java b/lending/lib/src/main/java/io/codat/lending/models/shared/File.java new file mode 100644 index 00000000..8d76b973 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/File.java @@ -0,0 +1,402 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class File { + + /** + * An optional display name for the file. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("displayName") + private JsonNullable displayName; + + /** + * The file's name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fileName") + private JsonNullable fileName; + + /** + * The source of the file uploaded. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceType") + private JsonNullable sourceType; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("uploaded") + private Optional uploaded; + + public File( + @JsonProperty("displayName") JsonNullable displayName, + @JsonProperty("fileName") JsonNullable fileName, + @JsonProperty("sourceType") JsonNullable sourceType, + @JsonProperty("uploaded") Optional uploaded) { + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(fileName, "fileName"); + Utils.checkNotNull(sourceType, "sourceType"); + Utils.checkNotNull(uploaded, "uploaded"); + this.displayName = displayName; + this.fileName = fileName; + this.sourceType = sourceType; + this.uploaded = uploaded; + } + + /** + * An optional display name for the file. + */ + public JsonNullable displayName() { + return displayName; + } + + /** + * The file's name. + */ + public JsonNullable fileName() { + return fileName; + } + + /** + * The source of the file uploaded. + */ + public JsonNullable sourceType() { + return sourceType; + } + + /** + * 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 Optional uploaded() { + return uploaded; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * An optional display name for the file. + */ + public File withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * An optional display name for the file. + */ + public File withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The file's name. + */ + public File withFileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = JsonNullable.of(fileName); + return this; + } + + /** + * The file's name. + */ + public File withFileName(JsonNullable fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + /** + * The source of the file uploaded. + */ + public File withSourceType(String sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = JsonNullable.of(sourceType); + return this; + } + + /** + * The source of the file uploaded. + */ + public File withSourceType(JsonNullable sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + 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 File withUploaded(String uploaded) { + Utils.checkNotNull(uploaded, "uploaded"); + this.uploaded = Optional.ofNullable(uploaded); + 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 File withUploaded(Optional uploaded) { + Utils.checkNotNull(uploaded, "uploaded"); + this.uploaded = uploaded; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + File other = (File) o; + return + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.fileName, other.fileName) && + java.util.Objects.deepEquals(this.sourceType, other.sourceType) && + java.util.Objects.deepEquals(this.uploaded, other.uploaded); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + displayName, + fileName, + sourceType, + uploaded); + } + + @Override + public String toString() { + return Utils.toString(File.class, + "displayName", displayName, + "fileName", fileName, + "sourceType", sourceType, + "uploaded", uploaded); + } + + public final static class Builder { + + private JsonNullable displayName = JsonNullable.undefined(); + + private JsonNullable fileName = JsonNullable.undefined(); + + private JsonNullable sourceType = JsonNullable.undefined(); + + private Optional uploaded = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * An optional display name for the file. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * An optional display name for the file. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The file's name. + */ + public Builder fileName(String fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = JsonNullable.of(fileName); + return this; + } + + /** + * The file's name. + */ + public Builder fileName(JsonNullable fileName) { + Utils.checkNotNull(fileName, "fileName"); + this.fileName = fileName; + return this; + } + + /** + * The source of the file uploaded. + */ + public Builder sourceType(String sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = JsonNullable.of(sourceType); + return this; + } + + /** + * The source of the file uploaded. + */ + public Builder sourceType(JsonNullable sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + 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 uploaded(String uploaded) { + Utils.checkNotNull(uploaded, "uploaded"); + this.uploaded = Optional.ofNullable(uploaded); + 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 uploaded(Optional uploaded) { + Utils.checkNotNull(uploaded, "uploaded"); + this.uploaded = uploaded; + return this; + } + + public File build() { + return new File( + displayName, + fileName, + sourceType, + uploaded); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/FileUpload.java b/lending/lib/src/main/java/io/codat/lending/models/shared/FileUpload.java new file mode 100644 index 00000000..f20a9487 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/FileUpload.java @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class FileUpload { + + /** + * The file to be uploaded as an attachment. + */ + @SpeakeasyMetadata("multipartForm:file") + private CodatFile file; + + public FileUpload( + CodatFile file) { + Utils.checkNotNull(file, "file"); + this.file = file; + } + + /** + * The file to be uploaded as an attachment. + */ + public CodatFile file() { + return file; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The file to be uploaded as an attachment. + */ + public FileUpload withFile(CodatFile file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileUpload other = (FileUpload) o; + return + java.util.Objects.deepEquals(this.file, other.file); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + file); + } + + @Override + public String toString() { + return Utils.toString(FileUpload.class, + "file", file); + } + + public final static class Builder { + + private CodatFile file; + + private Builder() { + // force use of static builder() method + } + + /** + * The file to be uploaded as an attachment. + */ + public Builder file(CodatFile file) { + Utils.checkNotNull(file, "file"); + this.file = file; + return this; + } + + public FileUpload build() { + return new FileUpload( + file); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/GroupReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/GroupReference.java new file mode 100644 index 00000000..a35840b4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/GroupReference.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class GroupReference { + + /** + * Unique identifier for the group. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public GroupReference( + @JsonProperty("id") Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * Unique identifier for the group. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for the group. + */ + public GroupReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the group. + */ + public GroupReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupReference other = (GroupReference) o; + return + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(GroupReference.class, + "id", id); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for the group. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the group. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public GroupReference build() { + return new GroupReference( + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/HalRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/HalRef.java new file mode 100644 index 00000000..74cfeb23 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/HalRef.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class HalRef { + + /** + * Uri hypertext reference. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("href") + private Optional href; + + public HalRef( + @JsonProperty("href") Optional href) { + Utils.checkNotNull(href, "href"); + this.href = href; + } + + /** + * Uri hypertext reference. + */ + public Optional href() { + return href; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Uri hypertext reference. + */ + public HalRef withHref(String href) { + Utils.checkNotNull(href, "href"); + this.href = Optional.ofNullable(href); + return this; + } + + /** + * Uri hypertext reference. + */ + public HalRef withHref(Optional href) { + Utils.checkNotNull(href, "href"); + this.href = href; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HalRef other = (HalRef) o; + return + java.util.Objects.deepEquals(this.href, other.href); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + href); + } + + @Override + public String toString() { + return Utils.toString(HalRef.class, + "href", href); + } + + public final static class Builder { + + private Optional href = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Uri hypertext reference. + */ + public Builder href(String href) { + Utils.checkNotNull(href, "href"); + this.href = Optional.ofNullable(href); + return this; + } + + /** + * Uri hypertext reference. + */ + public Builder href(Optional href) { + Utils.checkNotNull(href, "href"); + this.href = href; + return this; + } + + public HalRef build() { + return new HalRef( + href); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/IntegrityStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/IntegrityStatus.java new file mode 100644 index 00000000..9f7a0d6c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/IntegrityStatus.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * IntegrityStatus - The current status of the most recently run matching algorithm. + */ +public enum IntegrityStatus { + UNKNOWN("Unknown"), + DOES_NOT_EXIST("DoesNotExist"), + ERROR("Error"), + COMPLETE("Complete"); + + @JsonValue + private final String value; + + private IntegrityStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceLineItem.java new file mode 100644 index 00000000..a76e973d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceLineItem.java @@ -0,0 +1,900 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class InvoiceLineItem { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Friendly name of the goods or services provided. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Numerical value of any discounts applied. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAmount") + private JsonNullable discountAmount; + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountPercentage") + private JsonNullable discountPercentage; + + /** + * The invoice is a direct income if `True`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isDirectIncome") + private Optional isDirectIncome; + + /** + * Reference to the item the line is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * Number of units of goods or services provided. + */ + @JsonProperty("quantity") + private double quantity; + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subTotal") + private JsonNullable subTotal; + + /** + * Amount of tax for the line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private JsonNullable taxAmount; + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxRateRef") + private Optional taxRateRef; + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private JsonNullable totalAmount; + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + /** + * Reference to the tracking categories to which the line item is linked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("trackingCategoryRefs") + private JsonNullable> trackingCategoryRefs; + + /** + * Price of each unit of goods or services. + */ + @JsonProperty("unitAmount") + private double unitAmount; + + public InvoiceLineItem( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("description") JsonNullable description, + @JsonProperty("discountAmount") JsonNullable discountAmount, + @JsonProperty("discountPercentage") JsonNullable discountPercentage, + @JsonProperty("isDirectIncome") Optional isDirectIncome, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("quantity") double quantity, + @JsonProperty("subTotal") JsonNullable subTotal, + @JsonProperty("taxAmount") JsonNullable taxAmount, + @JsonProperty("taxRateRef") Optional taxRateRef, + @JsonProperty("totalAmount") JsonNullable totalAmount, + @JsonProperty("tracking") Optional tracking, + @JsonProperty("trackingCategoryRefs") JsonNullable> trackingCategoryRefs, + @JsonProperty("unitAmount") double unitAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(discountAmount, "discountAmount"); + Utils.checkNotNull(discountPercentage, "discountPercentage"); + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxRateRef, "taxRateRef"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(tracking, "tracking"); + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + Utils.checkNotNull(unitAmount, "unitAmount"); + this.accountRef = accountRef; + this.description = description; + this.discountAmount = discountAmount; + this.discountPercentage = discountPercentage; + this.isDirectIncome = isDirectIncome; + this.itemRef = itemRef; + this.quantity = quantity; + this.subTotal = subTotal; + this.taxAmount = taxAmount; + this.taxRateRef = taxRateRef; + this.totalAmount = totalAmount; + this.tracking = tracking; + this.trackingCategoryRefs = trackingCategoryRefs; + this.unitAmount = unitAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Friendly name of the goods or services provided. + */ + public JsonNullable description() { + return description; + } + + /** + * Numerical value of any discounts applied. + */ + public JsonNullable discountAmount() { + return discountAmount; + } + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + public JsonNullable discountPercentage() { + return discountPercentage; + } + + /** + * The invoice is a direct income if `True`. + */ + public Optional isDirectIncome() { + return isDirectIncome; + } + + /** + * Reference to the item the line is linked to. + */ + public Optional itemRef() { + return itemRef; + } + + /** + * Number of units of goods or services provided. + */ + public double quantity() { + return quantity; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Amount of tax for the line. + */ + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Optional taxRateRef() { + return taxRateRef; + } + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Optional tracking() { + return tracking; + } + + /** + * Reference to the tracking categories to which the line item is linked. + */ + public JsonNullable> trackingCategoryRefs() { + return trackingCategoryRefs; + } + + /** + * Price of each unit of goods or services. + */ + public double unitAmount() { + return unitAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public InvoiceLineItem withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public InvoiceLineItem withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services provided. + */ + public InvoiceLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services provided. + */ + public InvoiceLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Numerical value of any discounts applied. + */ + public InvoiceLineItem withDiscountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Numerical value of any discounts applied. + */ + public InvoiceLineItem withDiscountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + public InvoiceLineItem withDiscountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + public InvoiceLineItem withDiscountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The invoice is a direct income if `True`. + */ + public InvoiceLineItem withIsDirectIncome(boolean isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = Optional.ofNullable(isDirectIncome); + return this; + } + + /** + * The invoice is a direct income if `True`. + */ + public InvoiceLineItem withIsDirectIncome(Optional isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = isDirectIncome; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public InvoiceLineItem withItemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public InvoiceLineItem withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of goods or services provided. + */ + public InvoiceLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public InvoiceLineItem withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public InvoiceLineItem withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public InvoiceLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public InvoiceLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public InvoiceLineItem withTaxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public InvoiceLineItem withTaxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + public InvoiceLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + public InvoiceLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public InvoiceLineItem withTracking(AccountsReceivableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public InvoiceLineItem withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + */ + public InvoiceLineItem withTrackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + */ + public InvoiceLineItem withTrackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + */ + public InvoiceLineItem withUnitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvoiceLineItem other = (InvoiceLineItem) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.discountAmount, other.discountAmount) && + java.util.Objects.deepEquals(this.discountPercentage, other.discountPercentage) && + java.util.Objects.deepEquals(this.isDirectIncome, other.isDirectIncome) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.subTotal, other.subTotal) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxRateRef, other.taxRateRef) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking) && + java.util.Objects.deepEquals(this.trackingCategoryRefs, other.trackingCategoryRefs) && + java.util.Objects.deepEquals(this.unitAmount, other.unitAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectIncome, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + + @Override + public String toString() { + return Utils.toString(InvoiceLineItem.class, + "accountRef", accountRef, + "description", description, + "discountAmount", discountAmount, + "discountPercentage", discountPercentage, + "isDirectIncome", isDirectIncome, + "itemRef", itemRef, + "quantity", quantity, + "subTotal", subTotal, + "taxAmount", taxAmount, + "taxRateRef", taxRateRef, + "totalAmount", totalAmount, + "tracking", tracking, + "trackingCategoryRefs", trackingCategoryRefs, + "unitAmount", unitAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable discountAmount = JsonNullable.undefined(); + + private JsonNullable discountPercentage = JsonNullable.undefined(); + + private Optional isDirectIncome = Optional.empty(); + + private Optional itemRef = Optional.empty(); + + private Double quantity; + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private Optional taxRateRef = Optional.empty(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private Optional tracking = Optional.empty(); + + private JsonNullable> trackingCategoryRefs = JsonNullable.undefined(); + + private Double unitAmount; + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Friendly name of the goods or services provided. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Friendly name of the goods or services provided. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Numerical value of any discounts applied. + */ + public Builder discountAmount(double discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = JsonNullable.of(discountAmount); + return this; + } + + /** + * Numerical value of any discounts applied. + */ + public Builder discountAmount(JsonNullable discountAmount) { + Utils.checkNotNull(discountAmount, "discountAmount"); + this.discountAmount = discountAmount; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + public Builder discountPercentage(double discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = JsonNullable.of(discountPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any discounts applied to the unit amount. + */ + public Builder discountPercentage(JsonNullable discountPercentage) { + Utils.checkNotNull(discountPercentage, "discountPercentage"); + this.discountPercentage = discountPercentage; + return this; + } + + /** + * The invoice is a direct income if `True`. + */ + public Builder isDirectIncome(boolean isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = Optional.ofNullable(isDirectIncome); + return this; + } + + /** + * The invoice is a direct income if `True`. + */ + public Builder isDirectIncome(Optional isDirectIncome) { + Utils.checkNotNull(isDirectIncome, "isDirectIncome"); + this.isDirectIncome = isDirectIncome; + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(PropertieItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + /** + * Reference to the item the line is linked to. + */ + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * Number of units of goods or services provided. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Amount of the line, inclusive of discounts but exclusive of tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Amount of tax for the line. + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(TaxRateRef taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = Optional.ofNullable(taxRateRef); + return this; + } + + /** + * Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + public Builder taxRateRef(Optional taxRateRef) { + Utils.checkNotNull(taxRateRef, "taxRateRef"); + this.taxRateRef = taxRateRef; + return this; + } + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of the line, including tax. When pushing invoices to Xero, the total amount is exclusive of tax to allow automatic calculations if a tax rate or tax amount is not specified. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(AccountsReceivableTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * Categories, and a project and customer, against which the item is tracked. + */ + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + */ + public Builder trackingCategoryRefs(java.util.List trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = JsonNullable.of(trackingCategoryRefs); + return this; + } + + /** + * Reference to the tracking categories to which the line item is linked. + */ + public Builder trackingCategoryRefs(JsonNullable> trackingCategoryRefs) { + Utils.checkNotNull(trackingCategoryRefs, "trackingCategoryRefs"); + this.trackingCategoryRefs = trackingCategoryRefs; + return this; + } + + /** + * Price of each unit of goods or services. + */ + public Builder unitAmount(double unitAmount) { + Utils.checkNotNull(unitAmount, "unitAmount"); + this.unitAmount = unitAmount; + return this; + } + + public InvoiceLineItem build() { + return new InvoiceLineItem( + accountRef, + description, + discountAmount, + discountPercentage, + isDirectIncome, + itemRef, + quantity, + subTotal, + taxAmount, + taxRateRef, + totalAmount, + tracking, + trackingCategoryRefs, + unitAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceStatus.java new file mode 100644 index 00000000..feb66c3f --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/InvoiceStatus.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * InvoiceStatus - Current state of the invoice: + * + * - `Draft` - Invoice hasn't been submitted to the supplier. It may be in a pending state or is scheduled for future submission, for example by email. + * - `Submitted` - Invoice is no longer a draft. It has been processed and, or, sent to the customer. In this state, it will impact the ledger. It also has no payments made against it (amountDue == totalAmount). + * - `PartiallyPaid` - The balance paid against the invoice is positive, but less than the total invoice amount (0 < amountDue < totalAmount). + * - `Paid` - Invoice is paid in full. This includes if the invoice has been credited or overpaid (amountDue == 0). + * - `Void` - An invoice can become Void when it's deleted, refunded, written off, or cancelled. A voided invoice may still be PartiallyPaid, and so all outstanding amounts on voided invoices are removed from the accounts receivable account. + */ +public enum InvoiceStatus { + UNKNOWN("Unknown"), + DRAFT("Draft"), + SUBMITTED("Submitted"), + PARTIALLY_PAID("PartiallyPaid"), + PAID("Paid"), + VOID_("Void"); + + @JsonValue + private final String value; + + private InvoiceStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ItemRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ItemRef.java new file mode 100644 index 00000000..688ecc98 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ItemRef.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ItemRef { + + /** + * The data connection id being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnectionId") + private Optional dataConnectionId; + + /** + * The id of the object, e.g. the Journal entry. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The data type the loan transaction entry was extracted from. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public ItemRef( + @JsonProperty("dataConnectionId") Optional dataConnectionId, + @JsonProperty("id") Optional id, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.dataConnectionId = dataConnectionId; + this.id = id; + this.type = type; + } + + /** + * The data connection id being referenced. + */ + public Optional dataConnectionId() { + return dataConnectionId; + } + + /** + * The id of the object, e.g. the Journal entry. + */ + public Optional id() { + return id; + } + + /** + * The data type the loan transaction entry was extracted from. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The data connection id being referenced. + */ + public ItemRef withDataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The data connection id being referenced. + */ + public ItemRef withDataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object, e.g. the Journal entry. + */ + public ItemRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object, e.g. the Journal entry. + */ + public ItemRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The data type the loan transaction entry was extracted from. + */ + public ItemRef withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type the loan transaction entry was extracted from. + */ + public ItemRef withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemRef other = (ItemRef) o; + return + java.util.Objects.deepEquals(this.dataConnectionId, other.dataConnectionId) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataConnectionId, + id, + type); + } + + @Override + public String toString() { + return Utils.toString(ItemRef.class, + "dataConnectionId", dataConnectionId, + "id", id, + "type", type); + } + + public final static class Builder { + + private Optional dataConnectionId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The data connection id being referenced. + */ + public Builder dataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The data connection id being referenced. + */ + public Builder dataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object, e.g. the Journal entry. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object, e.g. the Journal entry. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The data type the loan transaction entry was extracted from. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The data type the loan transaction entry was extracted from. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public ItemRef build() { + return new ItemRef( + dataConnectionId, + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ItemReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ItemReference.java new file mode 100644 index 00000000..238e6423 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ItemReference.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ItemReference - Reference to the item the line is linked to. + */ + +public class ItemReference { + + /** + * Unique identifier for the item in the accounting platform. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the item in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public ItemReference( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public String id() { + return id; + } + + /** + * Name of the item in the accounting platform. + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public ItemReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public ItemReference withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public ItemReference withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemReference other = (ItemReference) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(ItemReference.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public ItemReference build() { + return new ItemReference( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Items.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Items.java new file mode 100644 index 00000000..c7e93fe1 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Items.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Items { + + /** + * Unique identifier for the group. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public Items( + @JsonProperty("id") Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + } + + /** + * Unique identifier for the group. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for the group. + */ + public Items withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the group. + */ + public Items withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Items other = (Items) o; + return + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id); + } + + @Override + public String toString() { + return Utils.toString(Items.class, + "id", id); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for the group. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the group. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Items build() { + return new Items( + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRef.java new file mode 100644 index 00000000..5ff5e7bc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRef.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * JournalEntryRecordRef - Links a journal entry to the underlying record that created it. + */ + +public class JournalEntryRecordRef { + + /** + * Name of underlying data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record or data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public JournalEntryRecordRef( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Name of underlying data type. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record or data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of underlying data type. + */ + public JournalEntryRecordRef withDataType(JournalEntryRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public JournalEntryRecordRef withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public JournalEntryRecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public JournalEntryRecordRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalEntryRecordRef other = (JournalEntryRecordRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(JournalEntryRecordRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of underlying data type. + */ + public Builder dataType(JournalEntryRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public JournalEntryRecordRef build() { + return new JournalEntryRecordRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRefDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRefDataType.java new file mode 100644 index 00000000..c4da8579 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalEntryRecordRefDataType.java @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * JournalEntryRecordRefDataType - Name of underlying data type. + */ +public enum JournalEntryRecordRefDataType { + BANK_TRANSACTIONS("bankTransactions"), + BILL_CREDIT_NOTES("billCreditNotes"), + BILL_PAYMENTS("billPayments"), + BILLS("bills"), + CREDIT_NOTES("creditNotes"), + DIRECT_COSTS("directCosts"), + DIRECT_INCOMES("directIncomes"), + INVOICES("invoices"), + JOURNAL_ENTRIES("journalEntries"), + PAYMENTS("payments"), + TRANSFERS("transfers"); + + @JsonValue + private final String value; + + private JournalEntryRecordRefDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLine.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLine.java new file mode 100644 index 00000000..699cf9f5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLine.java @@ -0,0 +1,334 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class JournalLine { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * Currency for the journal line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Description of the journal line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. + */ + @JsonProperty("netAmount") + private double netAmount; + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking") + private Optional tracking; + + public JournalLine( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("description") JsonNullable description, + @JsonProperty("netAmount") double netAmount, + @JsonProperty("tracking") Optional tracking) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(netAmount, "netAmount"); + Utils.checkNotNull(tracking, "tracking"); + this.accountRef = accountRef; + this.currency = currency; + this.description = description; + this.netAmount = netAmount; + this.tracking = tracking; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * Currency for the journal line item. + */ + public JsonNullable currency() { + return currency; + } + + /** + * Description of the journal line item. + */ + public JsonNullable description() { + return description; + } + + /** + * Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. + */ + public double netAmount() { + return netAmount; + } + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + public Optional tracking() { + return tracking; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public JournalLine withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public JournalLine withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Currency for the journal line item. + */ + public JournalLine withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Currency for the journal line item. + */ + public JournalLine withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Description of the journal line item. + */ + public JournalLine withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the journal line item. + */ + public JournalLine withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. + */ + public JournalLine withNetAmount(double netAmount) { + Utils.checkNotNull(netAmount, "netAmount"); + this.netAmount = netAmount; + return this; + } + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + public JournalLine withTracking(JournalLineTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + public JournalLine withTracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalLine other = (JournalLine) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.netAmount, other.netAmount) && + java.util.Objects.deepEquals(this.tracking, other.tracking); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + currency, + description, + netAmount, + tracking); + } + + @Override + public String toString() { + return Utils.toString(JournalLine.class, + "accountRef", accountRef, + "currency", currency, + "description", description, + "netAmount", netAmount, + "tracking", tracking); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private Double netAmount; + + private Optional tracking = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * Currency for the journal line item. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Currency for the journal line item. + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Description of the journal line item. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description of the journal line item. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. + */ + public Builder netAmount(double netAmount) { + Utils.checkNotNull(netAmount, "netAmount"); + this.netAmount = netAmount; + return this; + } + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + public Builder tracking(JournalLineTracking tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = Optional.ofNullable(tracking); + return this; + } + + /** + * List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + public Builder tracking(Optional tracking) { + Utils.checkNotNull(tracking, "tracking"); + this.tracking = tracking; + return this; + } + + public JournalLine build() { + return new JournalLine( + accountRef, + currency, + description, + netAmount, + tracking); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLineTracking.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLineTracking.java new file mode 100644 index 00000000..3d68a005 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalLineTracking.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * JournalLineTracking - List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + */ + +public class JournalLineTracking { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRefs") + private JsonNullable> recordRefs; + + public JournalLineTracking( + @JsonProperty("recordRefs") JsonNullable> recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = recordRefs; + } + + public JsonNullable> recordRefs() { + return recordRefs; + } + + public final static Builder builder() { + return new Builder(); + } + + public JournalLineTracking withRecordRefs(java.util.List recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = JsonNullable.of(recordRefs); + return this; + } + + public JournalLineTracking withRecordRefs(JsonNullable> recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = recordRefs; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalLineTracking other = (JournalLineTracking) o; + return + java.util.Objects.deepEquals(this.recordRefs, other.recordRefs); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + recordRefs); + } + + @Override + public String toString() { + return Utils.toString(JournalLineTracking.class, + "recordRefs", recordRefs); + } + + public final static class Builder { + + private JsonNullable> recordRefs = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder recordRefs(java.util.List recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = JsonNullable.of(recordRefs); + return this; + } + + public Builder recordRefs(JsonNullable> recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = recordRefs; + return this; + } + + public JournalLineTracking build() { + return new JournalLineTracking( + recordRefs); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalRef.java new file mode 100644 index 00000000..93268afc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * JournalRef - Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + */ + +public class JournalRef { + + /** + * GUID of the underlying journal. + */ + @JsonProperty("id") + private String id; + + /** + * Name of journal + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public JournalRef( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * GUID of the underlying journal. + */ + public String id() { + return id; + } + + /** + * Name of journal + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * GUID of the underlying journal. + */ + public JournalRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of journal + */ + public JournalRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of journal + */ + public JournalRef withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalRef other = (JournalRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(JournalRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * GUID of the underlying journal. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of journal + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of journal + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public JournalRef build() { + return new JournalRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/JournalStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalStatus.java new file mode 100644 index 00000000..c90cc137 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/JournalStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * JournalStatus - Current journal status. + */ +public enum JournalStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"); + + @JsonValue + private final String value; + + private JournalStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LendingCustomerRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LendingCustomerRef.java new file mode 100644 index 00000000..b7f156ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LendingCustomerRef.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class LendingCustomerRef { + + /** + * `customerName` from the Customer data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customerName") + private JsonNullable customerName; + + /** + * `id` from the Customers data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public LendingCustomerRef( + @JsonProperty("customerName") JsonNullable customerName, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(customerName, "customerName"); + Utils.checkNotNull(id, "id"); + this.customerName = customerName; + this.id = id; + } + + /** + * `customerName` from the Customer data type. + */ + public JsonNullable customerName() { + return customerName; + } + + /** + * `id` from the Customers data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * `customerName` from the Customer data type. + */ + public LendingCustomerRef withCustomerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = JsonNullable.of(customerName); + return this; + } + + /** + * `customerName` from the Customer data type. + */ + public LendingCustomerRef withCustomerName(JsonNullable customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + /** + * `id` from the Customers data type. + */ + public LendingCustomerRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * `id` from the Customers data type. + */ + public LendingCustomerRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LendingCustomerRef other = (LendingCustomerRef) o; + return + java.util.Objects.deepEquals(this.customerName, other.customerName) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + customerName, + id); + } + + @Override + public String toString() { + return Utils.toString(LendingCustomerRef.class, + "customerName", customerName, + "id", id); + } + + public final static class Builder { + + private JsonNullable customerName = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * `customerName` from the Customer data type. + */ + public Builder customerName(String customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = JsonNullable.of(customerName); + return this; + } + + /** + * `customerName` from the Customer data type. + */ + public Builder customerName(JsonNullable customerName) { + Utils.checkNotNull(customerName, "customerName"); + this.customerName = customerName; + return this; + } + + /** + * `id` from the Customers data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * `id` from the Customers data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public LendingCustomerRef build() { + return new LendingCustomerRef( + customerName, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Links.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Links.java new file mode 100644 index 00000000..32b4da93 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Links.java @@ -0,0 +1,195 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Links { + + @JsonProperty("current") + private HalRef current; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("next") + private Optional next; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("previous") + private Optional previous; + + @JsonProperty("self") + private HalRef self; + + public Links( + @JsonProperty("current") HalRef current, + @JsonProperty("next") Optional next, + @JsonProperty("previous") Optional previous, + @JsonProperty("self") HalRef self) { + Utils.checkNotNull(current, "current"); + Utils.checkNotNull(next, "next"); + Utils.checkNotNull(previous, "previous"); + Utils.checkNotNull(self, "self"); + this.current = current; + this.next = next; + this.previous = previous; + this.self = self; + } + + public HalRef current() { + return current; + } + + public Optional next() { + return next; + } + + public Optional previous() { + return previous; + } + + public HalRef self() { + return self; + } + + public final static Builder builder() { + return new Builder(); + } + + public Links withCurrent(HalRef current) { + Utils.checkNotNull(current, "current"); + this.current = current; + return this; + } + + public Links withNext(HalRef next) { + Utils.checkNotNull(next, "next"); + this.next = Optional.ofNullable(next); + return this; + } + + public Links withNext(Optional next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public Links withPrevious(HalRef previous) { + Utils.checkNotNull(previous, "previous"); + this.previous = Optional.ofNullable(previous); + return this; + } + + public Links withPrevious(Optional previous) { + Utils.checkNotNull(previous, "previous"); + this.previous = previous; + return this; + } + + public Links withSelf(HalRef self) { + Utils.checkNotNull(self, "self"); + this.self = self; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Links other = (Links) o; + return + java.util.Objects.deepEquals(this.current, other.current) && + java.util.Objects.deepEquals(this.next, other.next) && + java.util.Objects.deepEquals(this.previous, other.previous) && + java.util.Objects.deepEquals(this.self, other.self); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + current, + next, + previous, + self); + } + + @Override + public String toString() { + return Utils.toString(Links.class, + "current", current, + "next", next, + "previous", previous, + "self", self); + } + + public final static class Builder { + + private HalRef current; + + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private HalRef self; + + private Builder() { + // force use of static builder() method + } + + public Builder current(HalRef current) { + Utils.checkNotNull(current, "current"); + this.current = current; + return this; + } + + public Builder next(HalRef next) { + Utils.checkNotNull(next, "next"); + this.next = Optional.ofNullable(next); + return this; + } + + public Builder next(Optional next) { + Utils.checkNotNull(next, "next"); + this.next = next; + return this; + } + + public Builder previous(HalRef previous) { + Utils.checkNotNull(previous, "previous"); + this.previous = Optional.ofNullable(previous); + return this; + } + + public Builder previous(Optional previous) { + Utils.checkNotNull(previous, "previous"); + this.previous = previous; + return this; + } + + public Builder self(HalRef self) { + Utils.checkNotNull(self, "self"); + this.self = self; + return this; + } + + public Links build() { + return new Links( + current, + next, + previous, + self); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanRef.java new file mode 100644 index 00000000..213ac439 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanRef.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanRef { + + /** + * The dataConnectionId the object being referred to is associated with. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnectionId") + private Optional dataConnectionId; + + /** + * The id of the object being referred to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The object type data is referring to, e.g. Account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public LoanRef( + @JsonProperty("dataConnectionId") Optional dataConnectionId, + @JsonProperty("id") Optional id, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.dataConnectionId = dataConnectionId; + this.id = id; + this.type = type; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Optional dataConnectionId() { + return dataConnectionId; + } + + /** + * The id of the object being referred to. + */ + public Optional id() { + return id; + } + + /** + * The object type data is referring to, e.g. Account. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public LoanRef withDataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public LoanRef withDataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object being referred to. + */ + public LoanRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object being referred to. + */ + public LoanRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The object type data is referring to, e.g. Account. + */ + public LoanRef withType(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The object type data is referring to, e.g. Account. + */ + public LoanRef withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanRef other = (LoanRef) o; + return + java.util.Objects.deepEquals(this.dataConnectionId, other.dataConnectionId) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataConnectionId, + id, + type); + } + + @Override + public String toString() { + return Utils.toString(LoanRef.class, + "dataConnectionId", dataConnectionId, + "id", id, + "type", type); + } + + public final static class Builder { + + private Optional dataConnectionId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Builder dataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Builder dataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object being referred to. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object being referred to. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The object type data is referring to, e.g. Account. + */ + public Builder type(String type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The object type data is referring to, e.g. Account. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public LoanRef build() { + return new LoanRef( + dataConnectionId, + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummary.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummary.java new file mode 100644 index 00000000..5df4d9f9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummary.java @@ -0,0 +1,157 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanSummary { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional reportInfo; + + /** + * Returns a summary of all loan activity for that integration type + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportItems") + private Optional> reportItems; + + public LoanSummary( + @JsonProperty("reportInfo") Optional reportInfo, + @JsonProperty("reportItems") Optional> reportItems) { + Utils.checkNotNull(reportInfo, "reportInfo"); + Utils.checkNotNull(reportItems, "reportItems"); + this.reportInfo = reportInfo; + this.reportItems = reportItems; + } + + public Optional reportInfo() { + return reportInfo; + } + + /** + * Returns a summary of all loan activity for that integration type + */ + public Optional> reportItems() { + return reportItems; + } + + public final static Builder builder() { + return new Builder(); + } + + public LoanSummary withReportInfo(LoanSummaryReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public LoanSummary withReportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * Returns a summary of all loan activity for that integration type + */ + public LoanSummary withReportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * Returns a summary of all loan activity for that integration type + */ + public LoanSummary withReportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanSummary other = (LoanSummary) o; + return + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo) && + java.util.Objects.deepEquals(this.reportItems, other.reportItems); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + reportInfo, + reportItems); + } + + @Override + public String toString() { + return Utils.toString(LoanSummary.class, + "reportInfo", reportInfo, + "reportItems", reportItems); + } + + public final static class Builder { + + private Optional reportInfo = Optional.empty(); + + private Optional> reportItems = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder reportInfo(LoanSummaryReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public Builder reportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * Returns a summary of all loan activity for that integration type + */ + public Builder reportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * Returns a summary of all loan activity for that integration type + */ + public Builder reportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + public LoanSummary build() { + return new LoanSummary( + reportInfo, + reportItems); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryIntegrationType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryIntegrationType.java new file mode 100644 index 00000000..b6994338 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryIntegrationType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * LoanSummaryIntegrationType - The integration type begin referred to. + */ +public enum LoanSummaryIntegrationType { + ACCOUNTING("Accounting"), + BANKING("Banking"), + COMMERCE("Commerce"); + + @JsonValue + private final String value; + + private LoanSummaryIntegrationType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRef.java new file mode 100644 index 00000000..d4a95840 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRef.java @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanSummaryRecordRef { + + /** + * The dataConnectionId the object being referred to is associated with. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataConnectionId") + private Optional dataConnectionId; + + /** + * The id of the object being referred to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The integration type begin referred to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("integrationType") + private Optional integrationType; + + /** + * The datatype being referred to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRefType") + private Optional recordRefType; + + public LoanSummaryRecordRef( + @JsonProperty("dataConnectionId") Optional dataConnectionId, + @JsonProperty("id") Optional id, + @JsonProperty("integrationType") Optional integrationType, + @JsonProperty("recordRefType") Optional recordRefType) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(integrationType, "integrationType"); + Utils.checkNotNull(recordRefType, "recordRefType"); + this.dataConnectionId = dataConnectionId; + this.id = id; + this.integrationType = integrationType; + this.recordRefType = recordRefType; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Optional dataConnectionId() { + return dataConnectionId; + } + + /** + * The id of the object being referred to. + */ + public Optional id() { + return id; + } + + /** + * The integration type begin referred to. + */ + public Optional integrationType() { + return integrationType; + } + + /** + * The datatype being referred to. + */ + public Optional recordRefType() { + return recordRefType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public LoanSummaryRecordRef withDataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public LoanSummaryRecordRef withDataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object being referred to. + */ + public LoanSummaryRecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object being referred to. + */ + public LoanSummaryRecordRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The integration type begin referred to. + */ + public LoanSummaryRecordRef withIntegrationType(LoanSummaryIntegrationType integrationType) { + Utils.checkNotNull(integrationType, "integrationType"); + this.integrationType = Optional.ofNullable(integrationType); + return this; + } + + /** + * The integration type begin referred to. + */ + public LoanSummaryRecordRef withIntegrationType(Optional integrationType) { + Utils.checkNotNull(integrationType, "integrationType"); + this.integrationType = integrationType; + return this; + } + + /** + * The datatype being referred to. + */ + public LoanSummaryRecordRef withRecordRefType(LoanSummaryRecordRefType recordRefType) { + Utils.checkNotNull(recordRefType, "recordRefType"); + this.recordRefType = Optional.ofNullable(recordRefType); + return this; + } + + /** + * The datatype being referred to. + */ + public LoanSummaryRecordRef withRecordRefType(Optional recordRefType) { + Utils.checkNotNull(recordRefType, "recordRefType"); + this.recordRefType = recordRefType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanSummaryRecordRef other = (LoanSummaryRecordRef) o; + return + java.util.Objects.deepEquals(this.dataConnectionId, other.dataConnectionId) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.integrationType, other.integrationType) && + java.util.Objects.deepEquals(this.recordRefType, other.recordRefType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataConnectionId, + id, + integrationType, + recordRefType); + } + + @Override + public String toString() { + return Utils.toString(LoanSummaryRecordRef.class, + "dataConnectionId", dataConnectionId, + "id", id, + "integrationType", integrationType, + "recordRefType", recordRefType); + } + + public final static class Builder { + + private Optional dataConnectionId = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional integrationType = Optional.empty(); + + private Optional recordRefType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Builder dataConnectionId(String dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = Optional.ofNullable(dataConnectionId); + return this; + } + + /** + * The dataConnectionId the object being referred to is associated with. + */ + public Builder dataConnectionId(Optional dataConnectionId) { + Utils.checkNotNull(dataConnectionId, "dataConnectionId"); + this.dataConnectionId = dataConnectionId; + return this; + } + + /** + * The id of the object being referred to. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * The id of the object being referred to. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The integration type begin referred to. + */ + public Builder integrationType(LoanSummaryIntegrationType integrationType) { + Utils.checkNotNull(integrationType, "integrationType"); + this.integrationType = Optional.ofNullable(integrationType); + return this; + } + + /** + * The integration type begin referred to. + */ + public Builder integrationType(Optional integrationType) { + Utils.checkNotNull(integrationType, "integrationType"); + this.integrationType = integrationType; + return this; + } + + /** + * The datatype being referred to. + */ + public Builder recordRefType(LoanSummaryRecordRefType recordRefType) { + Utils.checkNotNull(recordRefType, "recordRefType"); + this.recordRefType = Optional.ofNullable(recordRefType); + return this; + } + + /** + * The datatype being referred to. + */ + public Builder recordRefType(Optional recordRefType) { + Utils.checkNotNull(recordRefType, "recordRefType"); + this.recordRefType = recordRefType; + return this; + } + + public LoanSummaryRecordRef build() { + return new LoanSummaryRecordRef( + dataConnectionId, + id, + integrationType, + recordRefType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRefType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRefType.java new file mode 100644 index 00000000..fc60e2a3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryRecordRefType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * LoanSummaryRecordRefType - The datatype being referred to. + */ +public enum LoanSummaryRecordRefType { + ACCOUNTS("accounts"), + BANKING_ACCOUNTS("banking-accounts"), + COMMERCE_TRANSACTIONS("commerce-transactions"); + + @JsonValue + private final String value; + + private LoanSummaryRecordRefType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportInfo.java new file mode 100644 index 00000000..00a3cfd6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportInfo.java @@ -0,0 +1,342 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanSummaryReportInfo { + + /** + * Name of the company queried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private Optional companyName; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generatedDate") + private Optional generatedDate; + + /** + * The name of the report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportName") + private Optional reportName; + + public LoanSummaryReportInfo( + @JsonProperty("companyName") Optional companyName, + @JsonProperty("generatedDate") Optional generatedDate, + @JsonProperty("reportName") Optional reportName) { + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(generatedDate, "generatedDate"); + Utils.checkNotNull(reportName, "reportName"); + this.companyName = companyName; + this.generatedDate = generatedDate; + this.reportName = reportName; + } + + /** + * Name of the company queried. + */ + public Optional companyName() { + return companyName; + } + + /** + * 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 Optional generatedDate() { + return generatedDate; + } + + /** + * The name of the report. + */ + public Optional reportName() { + return reportName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the company queried. + */ + public LoanSummaryReportInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public LoanSummaryReportInfo withCompanyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 LoanSummaryReportInfo withGeneratedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 LoanSummaryReportInfo withGeneratedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The name of the report. + */ + public LoanSummaryReportInfo withReportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public LoanSummaryReportInfo withReportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanSummaryReportInfo other = (LoanSummaryReportInfo) o; + return + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.generatedDate, other.generatedDate) && + java.util.Objects.deepEquals(this.reportName, other.reportName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyName, + generatedDate, + reportName); + } + + @Override + public String toString() { + return Utils.toString(LoanSummaryReportInfo.class, + "companyName", companyName, + "generatedDate", generatedDate, + "reportName", reportName); + } + + public final static class Builder { + + private Optional companyName = Optional.empty(); + + private Optional generatedDate = Optional.empty(); + + private Optional reportName = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the company queried. + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public Builder companyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 generatedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 generatedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + public LoanSummaryReportInfo build() { + return new LoanSummaryReportInfo( + companyName, + generatedDate, + reportName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportItem.java new file mode 100644 index 00000000..9d6b5630 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanSummaryReportItem.java @@ -0,0 +1,560 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanSummaryReportItem { + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private Optional balance; + + /** + * The description of the object being referred to. E.g. the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * The name of lender providing the loan. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lenderName") + private Optional lenderName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRef") + private Optional recordRef; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("startDate") + private Optional startDate; + + /** + * The total loan drawdowns. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalDrawdowns") + private Optional totalDrawdowns; + + /** + * The total loan repayments which includes capital plus any interest. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalRepayments") + private Optional totalRepayments; + + public LoanSummaryReportItem( + @JsonProperty("balance") Optional balance, + @JsonProperty("description") Optional description, + @JsonProperty("lenderName") Optional lenderName, + @JsonProperty("recordRef") Optional recordRef, + @JsonProperty("startDate") Optional startDate, + @JsonProperty("totalDrawdowns") Optional totalDrawdowns, + @JsonProperty("totalRepayments") Optional totalRepayments) { + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(lenderName, "lenderName"); + Utils.checkNotNull(recordRef, "recordRef"); + Utils.checkNotNull(startDate, "startDate"); + Utils.checkNotNull(totalDrawdowns, "totalDrawdowns"); + Utils.checkNotNull(totalRepayments, "totalRepayments"); + this.balance = balance; + this.description = description; + this.lenderName = lenderName; + this.recordRef = recordRef; + this.startDate = startDate; + this.totalDrawdowns = totalDrawdowns; + this.totalRepayments = totalRepayments; + } + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + public Optional balance() { + return balance; + } + + /** + * The description of the object being referred to. E.g. the account. + */ + public Optional description() { + return description; + } + + /** + * The name of lender providing the loan. + */ + public Optional lenderName() { + return lenderName; + } + + public Optional recordRef() { + return recordRef; + } + + /** + * 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 Optional startDate() { + return startDate; + } + + /** + * The total loan drawdowns. + */ + public Optional totalDrawdowns() { + return totalDrawdowns; + } + + /** + * The total loan repayments which includes capital plus any interest. + */ + public Optional totalRepayments() { + return totalRepayments; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + public LoanSummaryReportItem withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + public LoanSummaryReportItem withBalance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The description of the object being referred to. E.g. the account. + */ + public LoanSummaryReportItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The description of the object being referred to. E.g. the account. + */ + public LoanSummaryReportItem withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The name of lender providing the loan. + */ + public LoanSummaryReportItem withLenderName(String lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = Optional.ofNullable(lenderName); + return this; + } + + /** + * The name of lender providing the loan. + */ + public LoanSummaryReportItem withLenderName(Optional lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = lenderName; + return this; + } + + public LoanSummaryReportItem withRecordRef(LoanSummaryRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + public LoanSummaryReportItem withRecordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + 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 LoanSummaryReportItem withStartDate(String startDate) { + Utils.checkNotNull(startDate, "startDate"); + this.startDate = Optional.ofNullable(startDate); + 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 LoanSummaryReportItem withStartDate(Optional startDate) { + Utils.checkNotNull(startDate, "startDate"); + this.startDate = startDate; + return this; + } + + /** + * The total loan drawdowns. + */ + public LoanSummaryReportItem withTotalDrawdowns(double totalDrawdowns) { + Utils.checkNotNull(totalDrawdowns, "totalDrawdowns"); + this.totalDrawdowns = Optional.ofNullable(totalDrawdowns); + return this; + } + + /** + * The total loan drawdowns. + */ + public LoanSummaryReportItem withTotalDrawdowns(Optional totalDrawdowns) { + Utils.checkNotNull(totalDrawdowns, "totalDrawdowns"); + this.totalDrawdowns = totalDrawdowns; + return this; + } + + /** + * The total loan repayments which includes capital plus any interest. + */ + public LoanSummaryReportItem withTotalRepayments(double totalRepayments) { + Utils.checkNotNull(totalRepayments, "totalRepayments"); + this.totalRepayments = Optional.ofNullable(totalRepayments); + return this; + } + + /** + * The total loan repayments which includes capital plus any interest. + */ + public LoanSummaryReportItem withTotalRepayments(Optional totalRepayments) { + Utils.checkNotNull(totalRepayments, "totalRepayments"); + this.totalRepayments = totalRepayments; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanSummaryReportItem other = (LoanSummaryReportItem) o; + return + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.lenderName, other.lenderName) && + java.util.Objects.deepEquals(this.recordRef, other.recordRef) && + java.util.Objects.deepEquals(this.startDate, other.startDate) && + java.util.Objects.deepEquals(this.totalDrawdowns, other.totalDrawdowns) && + java.util.Objects.deepEquals(this.totalRepayments, other.totalRepayments); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + balance, + description, + lenderName, + recordRef, + startDate, + totalDrawdowns, + totalRepayments); + } + + @Override + public String toString() { + return Utils.toString(LoanSummaryReportItem.class, + "balance", balance, + "description", description, + "lenderName", lenderName, + "recordRef", recordRef, + "startDate", startDate, + "totalDrawdowns", totalDrawdowns, + "totalRepayments", totalRepayments); + } + + public final static class Builder { + + private Optional balance = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional lenderName = Optional.empty(); + + private Optional recordRef = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional totalDrawdowns = Optional.empty(); + + private Optional totalRepayments = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. + */ + public Builder balance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + return this; + } + + /** + * The description of the object being referred to. E.g. the account. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * The description of the object being referred to. E.g. the account. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The name of lender providing the loan. + */ + public Builder lenderName(String lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = Optional.ofNullable(lenderName); + return this; + } + + /** + * The name of lender providing the loan. + */ + public Builder lenderName(Optional lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = lenderName; + return this; + } + + public Builder recordRef(LoanSummaryRecordRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + public Builder recordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + 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 startDate(String startDate) { + Utils.checkNotNull(startDate, "startDate"); + this.startDate = Optional.ofNullable(startDate); + 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 startDate(Optional startDate) { + Utils.checkNotNull(startDate, "startDate"); + this.startDate = startDate; + return this; + } + + /** + * The total loan drawdowns. + */ + public Builder totalDrawdowns(double totalDrawdowns) { + Utils.checkNotNull(totalDrawdowns, "totalDrawdowns"); + this.totalDrawdowns = Optional.ofNullable(totalDrawdowns); + return this; + } + + /** + * The total loan drawdowns. + */ + public Builder totalDrawdowns(Optional totalDrawdowns) { + Utils.checkNotNull(totalDrawdowns, "totalDrawdowns"); + this.totalDrawdowns = totalDrawdowns; + return this; + } + + /** + * The total loan repayments which includes capital plus any interest. + */ + public Builder totalRepayments(double totalRepayments) { + Utils.checkNotNull(totalRepayments, "totalRepayments"); + this.totalRepayments = Optional.ofNullable(totalRepayments); + return this; + } + + /** + * The total loan repayments which includes capital plus any interest. + */ + public Builder totalRepayments(Optional totalRepayments) { + Utils.checkNotNull(totalRepayments, "totalRepayments"); + this.totalRepayments = totalRepayments; + return this; + } + + public LoanSummaryReportItem build() { + return new LoanSummaryReportItem( + balance, + description, + lenderName, + recordRef, + startDate, + totalDrawdowns, + totalRepayments); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionType.java new file mode 100644 index 00000000..a4eeb5ac --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionType.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * LoanTransactionType - The type of loan transaction. + */ +public enum LoanTransactionType { + INVESTMENT("Investment"), + REPAYMENT("Repayment"), + INTEREST("Interest"), + ACCURED_INTEREST("AccuredInterest"); + + @JsonValue + private final String value; + + private LoanTransactionType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactions.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactions.java new file mode 100644 index 00000000..242209c6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactions.java @@ -0,0 +1,216 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanTransactions { + + /** + * If there are no errors, an empty array is returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportInfo") + private Optional reportInfo; + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportItems") + private Optional> reportItems; + + public LoanTransactions( + @JsonProperty("errors") Optional> errors, + @JsonProperty("reportInfo") Optional reportInfo, + @JsonProperty("reportItems") Optional> reportItems) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(reportInfo, "reportInfo"); + Utils.checkNotNull(reportItems, "reportItems"); + this.errors = errors; + this.reportInfo = reportInfo; + this.reportItems = reportItems; + } + + /** + * If there are no errors, an empty array is returned. + */ + public Optional> errors() { + return errors; + } + + public Optional reportInfo() { + return reportInfo; + } + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + public Optional> reportItems() { + return reportItems; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * If there are no errors, an empty array is returned. + */ + public LoanTransactions withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + /** + * If there are no errors, an empty array is returned. + */ + public LoanTransactions withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public LoanTransactions withReportInfo(LoanTransactionsReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public LoanTransactions withReportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + public LoanTransactions withReportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + public LoanTransactions withReportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanTransactions other = (LoanTransactions) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.reportInfo, other.reportInfo) && + java.util.Objects.deepEquals(this.reportItems, other.reportItems); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + reportInfo, + reportItems); + } + + @Override + public String toString() { + return Utils.toString(LoanTransactions.class, + "errors", errors, + "reportInfo", reportInfo, + "reportItems", reportItems); + } + + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional reportInfo = Optional.empty(); + + private Optional> reportItems = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * If there are no errors, an empty array is returned. + */ + public Builder errors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + /** + * If there are no errors, an empty array is returned. + */ + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public Builder reportInfo(LoanTransactionsReportInfo reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = Optional.ofNullable(reportInfo); + return this; + } + + public Builder reportInfo(Optional reportInfo) { + Utils.checkNotNull(reportInfo, "reportInfo"); + this.reportInfo = reportInfo; + return this; + } + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + public Builder reportItems(java.util.List reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = Optional.ofNullable(reportItems); + return this; + } + + /** + * Contains object of reporting properties. The loan ref will reference a different object depending on the integration type. + */ + public Builder reportItems(Optional> reportItems) { + Utils.checkNotNull(reportItems, "reportItems"); + this.reportItems = reportItems; + return this; + } + + public LoanTransactions build() { + return new LoanTransactions( + errors, + reportInfo, + reportItems); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionsReportInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionsReportInfo.java new file mode 100644 index 00000000..cf49cd58 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LoanTransactionsReportInfo.java @@ -0,0 +1,519 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class LoanTransactionsReportInfo { + + /** + * Name of the company queried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private Optional companyName; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generatedDate") + private Optional generatedDate; + + /** + * The page number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pageNumber") + private Optional pageNumber; + + /** + * Queried page size. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pageSize") + private Optional pageSize; + + /** + * The name of the report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportName") + private Optional reportName; + + /** + * The total number of transactions returned. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalResults") + private Optional totalResults; + + public LoanTransactionsReportInfo( + @JsonProperty("companyName") Optional companyName, + @JsonProperty("generatedDate") Optional generatedDate, + @JsonProperty("pageNumber") Optional pageNumber, + @JsonProperty("pageSize") Optional pageSize, + @JsonProperty("reportName") Optional reportName, + @JsonProperty("totalResults") Optional totalResults) { + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(generatedDate, "generatedDate"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(reportName, "reportName"); + Utils.checkNotNull(totalResults, "totalResults"); + this.companyName = companyName; + this.generatedDate = generatedDate; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.reportName = reportName; + this.totalResults = totalResults; + } + + /** + * Name of the company queried. + */ + public Optional companyName() { + return companyName; + } + + /** + * 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 Optional generatedDate() { + return generatedDate; + } + + /** + * The page number. + */ + public Optional pageNumber() { + return pageNumber; + } + + /** + * Queried page size. + */ + public Optional pageSize() { + return pageSize; + } + + /** + * The name of the report. + */ + public Optional reportName() { + return reportName; + } + + /** + * The total number of transactions returned. + */ + public Optional totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the company queried. + */ + public LoanTransactionsReportInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public LoanTransactionsReportInfo withCompanyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 LoanTransactionsReportInfo withGeneratedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 LoanTransactionsReportInfo withGeneratedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The page number. + */ + public LoanTransactionsReportInfo withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = Optional.ofNullable(pageNumber); + return this; + } + + /** + * The page number. + */ + public LoanTransactionsReportInfo withPageNumber(Optional pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Queried page size. + */ + public LoanTransactionsReportInfo withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Queried page size. + */ + public LoanTransactionsReportInfo withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * The name of the report. + */ + public LoanTransactionsReportInfo withReportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public LoanTransactionsReportInfo withReportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + /** + * The total number of transactions returned. + */ + public LoanTransactionsReportInfo withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = Optional.ofNullable(totalResults); + return this; + } + + /** + * The total number of transactions returned. + */ + public LoanTransactionsReportInfo withTotalResults(Optional totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoanTransactionsReportInfo other = (LoanTransactionsReportInfo) o; + return + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.generatedDate, other.generatedDate) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.reportName, other.reportName) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyName, + generatedDate, + pageNumber, + pageSize, + reportName, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(LoanTransactionsReportInfo.class, + "companyName", companyName, + "generatedDate", generatedDate, + "pageNumber", pageNumber, + "pageSize", pageSize, + "reportName", reportName, + "totalResults", totalResults); + } + + public final static class Builder { + + private Optional companyName = Optional.empty(); + + private Optional generatedDate = Optional.empty(); + + private Optional pageNumber = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional reportName = Optional.empty(); + + private Optional totalResults = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the company queried. + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * Name of the company queried. + */ + public Builder companyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + 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 generatedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + 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 generatedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = Optional.ofNullable(pageNumber); + return this; + } + + /** + * The page number. + */ + public Builder pageNumber(Optional pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Queried page size. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * Queried page size. + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * The name of the report. + */ + public Builder reportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + /** + * The total number of transactions returned. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = Optional.ofNullable(totalResults); + return this; + } + + /** + * The total number of transactions returned. + */ + public Builder totalResults(Optional totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public LoanTransactionsReportInfo build() { + return new LoanTransactionsReportInfo( + companyName, + generatedDate, + pageNumber, + pageSize, + reportName, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/LocationRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/LocationRef.java new file mode 100644 index 00000000..22fd980a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/LocationRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * LocationRef - Reference to the geographic location where the order was placed. + */ + +public class LocationRef { + + /** + * The unique identitifer of the location being referenced. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the location being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public LocationRef( + @JsonProperty("id") String id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identitifer of the location being referenced. + */ + public String id() { + return id; + } + + /** + * Name of the location being referenced. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identitifer of the location being referenced. + */ + public LocationRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the location being referenced. + */ + public LocationRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the location being referenced. + */ + public LocationRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LocationRef other = (LocationRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(LocationRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identitifer of the location being referenced. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the location being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the location being referenced. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public LocationRef build() { + return new LocationRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Metadata.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Metadata.java new file mode 100644 index 00000000..dc033dd7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Metadata.java @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class Metadata { + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isDeleted") + private JsonNullable isDeleted; + + public Metadata( + @JsonProperty("isDeleted") JsonNullable isDeleted) { + Utils.checkNotNull(isDeleted, "isDeleted"); + this.isDeleted = isDeleted; + } + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + public JsonNullable isDeleted() { + return isDeleted; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + public Metadata withIsDeleted(boolean isDeleted) { + Utils.checkNotNull(isDeleted, "isDeleted"); + this.isDeleted = JsonNullable.of(isDeleted); + return this; + } + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + public Metadata withIsDeleted(JsonNullable isDeleted) { + Utils.checkNotNull(isDeleted, "isDeleted"); + this.isDeleted = isDeleted; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Metadata other = (Metadata) o; + return + java.util.Objects.deepEquals(this.isDeleted, other.isDeleted); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + isDeleted); + } + + @Override + public String toString() { + return Utils.toString(Metadata.class, + "isDeleted", isDeleted); + } + + public final static class Builder { + + private JsonNullable isDeleted = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + public Builder isDeleted(boolean isDeleted) { + Utils.checkNotNull(isDeleted, "isDeleted"); + this.isDeleted = JsonNullable.of(isDeleted); + return this; + } + + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + */ + public Builder isDeleted(JsonNullable isDeleted) { + Utils.checkNotNull(isDeleted, "isDeleted"); + this.isDeleted = isDeleted; + return this; + } + + public Metadata build() { + return new Metadata( + isDeleted); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/OrderDiscountAllocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/OrderDiscountAllocation.java new file mode 100644 index 00000000..dc645f8a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/OrderDiscountAllocation.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class OrderDiscountAllocation { + + /** + * Name of the discount in the commerce or point of sale platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public OrderDiscountAllocation( + @JsonProperty("name") Optional name, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.name = name; + this.totalAmount = totalAmount; + } + + /** + * Name of the discount in the commerce or point of sale platform. + */ + public Optional name() { + return name; + } + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of the discount in the commerce or point of sale platform. + */ + public OrderDiscountAllocation withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the discount in the commerce or point of sale platform. + */ + public OrderDiscountAllocation withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + public OrderDiscountAllocation withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + public OrderDiscountAllocation withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderDiscountAllocation other = (OrderDiscountAllocation) o; + return + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + name, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(OrderDiscountAllocation.class, + "name", name, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional name = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of the discount in the commerce or point of sale platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the discount in the commerce or point of sale platform. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public OrderDiscountAllocation build() { + return new OrderDiscountAllocation( + name, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/OrderLineItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/OrderLineItem.java new file mode 100644 index 00000000..a3d0459a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/OrderLineItem.java @@ -0,0 +1,622 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class OrderLineItem { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("discountAllocations") + private Optional> discountAllocations; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + /** + * Reference that links the line item to the correct product details. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("productRef") + private Optional productRef; + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("productVariantRef") + private Optional productVariantRef; + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("quantity") + private Optional quantity; + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxPercentage") + private Optional taxPercentage; + + /** + * Taxes breakdown as applied to order lines. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxes") + private Optional> taxes; + + /** + * Total amount of the line item, including discounts and tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalTaxAmount") + private Optional totalTaxAmount; + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unitPrice") + private Optional unitPrice; + + public OrderLineItem( + @JsonProperty("discountAllocations") Optional> discountAllocations, + @JsonProperty("id") String id, + @JsonProperty("productRef") Optional productRef, + @JsonProperty("productVariantRef") Optional productVariantRef, + @JsonProperty("quantity") Optional quantity, + @JsonProperty("taxPercentage") Optional taxPercentage, + @JsonProperty("taxes") Optional> taxes, + @JsonProperty("totalAmount") Optional totalAmount, + @JsonProperty("totalTaxAmount") Optional totalTaxAmount, + @JsonProperty("unitPrice") Optional unitPrice) { + Utils.checkNotNull(discountAllocations, "discountAllocations"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(productRef, "productRef"); + Utils.checkNotNull(productVariantRef, "productVariantRef"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(taxPercentage, "taxPercentage"); + Utils.checkNotNull(taxes, "taxes"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + Utils.checkNotNull(unitPrice, "unitPrice"); + this.discountAllocations = discountAllocations; + this.id = id; + this.productRef = productRef; + this.productVariantRef = productVariantRef; + this.quantity = quantity; + this.taxPercentage = taxPercentage; + this.taxes = taxes; + this.totalAmount = totalAmount; + this.totalTaxAmount = totalTaxAmount; + this.unitPrice = unitPrice; + } + + public Optional> discountAllocations() { + return discountAllocations; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + /** + * Reference that links the line item to the correct product details. + */ + public Optional productRef() { + return productRef; + } + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + public Optional productVariantRef() { + return productVariantRef; + } + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + public Optional quantity() { + return quantity; + } + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + public Optional taxPercentage() { + return taxPercentage; + } + + /** + * Taxes breakdown as applied to order lines. + */ + public Optional> taxes() { + return taxes; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Optional totalAmount() { + return totalAmount; + } + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + public Optional totalTaxAmount() { + return totalTaxAmount; + } + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + public Optional unitPrice() { + return unitPrice; + } + + public final static Builder builder() { + return new Builder(); + } + + public OrderLineItem withDiscountAllocations(java.util.List discountAllocations) { + Utils.checkNotNull(discountAllocations, "discountAllocations"); + this.discountAllocations = Optional.ofNullable(discountAllocations); + return this; + } + + public OrderLineItem withDiscountAllocations(Optional> discountAllocations) { + Utils.checkNotNull(discountAllocations, "discountAllocations"); + this.discountAllocations = discountAllocations; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public OrderLineItem withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Reference that links the line item to the correct product details. + */ + public OrderLineItem withProductRef(ProductRef productRef) { + Utils.checkNotNull(productRef, "productRef"); + this.productRef = Optional.ofNullable(productRef); + return this; + } + + /** + * Reference that links the line item to the correct product details. + */ + public OrderLineItem withProductRef(Optional productRef) { + Utils.checkNotNull(productRef, "productRef"); + this.productRef = productRef; + return this; + } + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + public OrderLineItem withProductVariantRef(ProductVariantRef productVariantRef) { + Utils.checkNotNull(productVariantRef, "productVariantRef"); + this.productVariantRef = Optional.ofNullable(productVariantRef); + return this; + } + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + public OrderLineItem withProductVariantRef(Optional productVariantRef) { + Utils.checkNotNull(productVariantRef, "productVariantRef"); + this.productVariantRef = productVariantRef; + return this; + } + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + public OrderLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + public OrderLineItem withQuantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + public OrderLineItem withTaxPercentage(double taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = Optional.ofNullable(taxPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + public OrderLineItem withTaxPercentage(Optional taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = taxPercentage; + return this; + } + + /** + * Taxes breakdown as applied to order lines. + */ + public OrderLineItem withTaxes(java.util.List taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = Optional.ofNullable(taxes); + return this; + } + + /** + * Taxes breakdown as applied to order lines. + */ + public OrderLineItem withTaxes(Optional> taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = taxes; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public OrderLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public OrderLineItem withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + public OrderLineItem withTotalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + public OrderLineItem withTotalTaxAmount(Optional totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + public OrderLineItem withUnitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + public OrderLineItem withUnitPrice(Optional unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderLineItem other = (OrderLineItem) o; + return + java.util.Objects.deepEquals(this.discountAllocations, other.discountAllocations) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.productRef, other.productRef) && + java.util.Objects.deepEquals(this.productVariantRef, other.productVariantRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.taxPercentage, other.taxPercentage) && + java.util.Objects.deepEquals(this.taxes, other.taxes) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.totalTaxAmount, other.totalTaxAmount) && + java.util.Objects.deepEquals(this.unitPrice, other.unitPrice); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + discountAllocations, + id, + productRef, + productVariantRef, + quantity, + taxPercentage, + taxes, + totalAmount, + totalTaxAmount, + unitPrice); + } + + @Override + public String toString() { + return Utils.toString(OrderLineItem.class, + "discountAllocations", discountAllocations, + "id", id, + "productRef", productRef, + "productVariantRef", productVariantRef, + "quantity", quantity, + "taxPercentage", taxPercentage, + "taxes", taxes, + "totalAmount", totalAmount, + "totalTaxAmount", totalTaxAmount, + "unitPrice", unitPrice); + } + + public final static class Builder { + + private Optional> discountAllocations = Optional.empty(); + + private String id; + + private Optional productRef = Optional.empty(); + + private Optional productVariantRef = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional taxPercentage = Optional.empty(); + + private Optional> taxes = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional totalTaxAmount = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder discountAllocations(java.util.List discountAllocations) { + Utils.checkNotNull(discountAllocations, "discountAllocations"); + this.discountAllocations = Optional.ofNullable(discountAllocations); + return this; + } + + public Builder discountAllocations(Optional> discountAllocations) { + Utils.checkNotNull(discountAllocations, "discountAllocations"); + this.discountAllocations = discountAllocations; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Reference that links the line item to the correct product details. + */ + public Builder productRef(ProductRef productRef) { + Utils.checkNotNull(productRef, "productRef"); + this.productRef = Optional.ofNullable(productRef); + return this; + } + + /** + * Reference that links the line item to the correct product details. + */ + public Builder productRef(Optional productRef) { + Utils.checkNotNull(productRef, "productRef"); + this.productRef = productRef; + return this; + } + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + public Builder productVariantRef(ProductVariantRef productVariantRef) { + Utils.checkNotNull(productVariantRef, "productVariantRef"); + this.productVariantRef = Optional.ofNullable(productVariantRef); + return this; + } + + /** + * Reference that links the line item to the specific version of product that has been ordered. + */ + public Builder productVariantRef(Optional productVariantRef) { + Utils.checkNotNull(productVariantRef, "productVariantRef"); + this.productVariantRef = productVariantRef; + return this; + } + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * Number of units of the product sold. + * For refunds, quantity is negative. + * + */ + public Builder quantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + public Builder taxPercentage(double taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = Optional.ofNullable(taxPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any sales tax applied to the unit price. + */ + public Builder taxPercentage(Optional taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = taxPercentage; + return this; + } + + /** + * Taxes breakdown as applied to order lines. + */ + public Builder taxes(java.util.List taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = Optional.ofNullable(taxes); + return this; + } + + /** + * Taxes breakdown as applied to order lines. + */ + public Builder taxes(Optional> taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = taxes; + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the line item, including discounts and tax. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + public Builder totalTaxAmount(double totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = Optional.ofNullable(totalTaxAmount); + return this; + } + + /** + * Total amount of tax applied to the line item, factoring in any discounts. + */ + public Builder totalTaxAmount(Optional totalTaxAmount) { + Utils.checkNotNull(totalTaxAmount, "totalTaxAmount"); + this.totalTaxAmount = totalTaxAmount; + return this; + } + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + public Builder unitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + * Price per unit of goods or services, excluding discounts and tax. + */ + public Builder unitPrice(Optional unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + public OrderLineItem build() { + return new OrderLineItem( + discountAllocations, + id, + productRef, + productVariantRef, + quantity, + taxPercentage, + taxes, + totalAmount, + totalTaxAmount, + unitPrice); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Payment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Payment.java new file mode 100644 index 00000000..1526d4e0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Payment.java @@ -0,0 +1,783 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class Payment { + + /** + * Payment amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("bankingTransactionRefs") + private Optional> bankingTransactionRefs; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The type of payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentType") + private Optional paymentType; + + public Payment( + @JsonProperty("amount") Optional amount, + @JsonProperty("bankingTransactionRefs") Optional> bankingTransactionRefs, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("date") Optional date, + @JsonProperty("id") Optional id, + @JsonProperty("paymentType") Optional paymentType) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(bankingTransactionRefs, "bankingTransactionRefs"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(paymentType, "paymentType"); + this.amount = amount; + this.bankingTransactionRefs = bankingTransactionRefs; + this.currency = currency; + this.currencyRate = currencyRate; + this.date = date; + this.id = id; + this.paymentType = paymentType; + } + + /** + * Payment amount. + */ + public Optional amount() { + return amount; + } + + public Optional> bankingTransactionRefs() { + return bankingTransactionRefs; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * 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 Optional date() { + return date; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * The type of payment. + */ + public Optional paymentType() { + return paymentType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Payment amount. + */ + public Payment withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Payment amount. + */ + public Payment withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public Payment withBankingTransactionRefs(java.util.List bankingTransactionRefs) { + Utils.checkNotNull(bankingTransactionRefs, "bankingTransactionRefs"); + this.bankingTransactionRefs = Optional.ofNullable(bankingTransactionRefs); + return this; + } + + public Payment withBankingTransactionRefs(Optional> bankingTransactionRefs) { + Utils.checkNotNull(bankingTransactionRefs, "bankingTransactionRefs"); + this.bankingTransactionRefs = bankingTransactionRefs; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Payment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Payment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Payment withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Payment withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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 Payment 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 Payment withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Payment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Payment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of payment. + */ + public Payment withPaymentType(String paymentType) { + Utils.checkNotNull(paymentType, "paymentType"); + this.paymentType = Optional.ofNullable(paymentType); + return this; + } + + /** + * The type of payment. + */ + public Payment withPaymentType(Optional paymentType) { + Utils.checkNotNull(paymentType, "paymentType"); + this.paymentType = paymentType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Payment other = (Payment) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.bankingTransactionRefs, other.bankingTransactionRefs) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.paymentType, other.paymentType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + bankingTransactionRefs, + currency, + currencyRate, + date, + id, + paymentType); + } + + @Override + public String toString() { + return Utils.toString(Payment.class, + "amount", amount, + "bankingTransactionRefs", bankingTransactionRefs, + "currency", currency, + "currencyRate", currencyRate, + "date", date, + "id", id, + "paymentType", paymentType); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional> bankingTransactionRefs = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional date = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional paymentType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Payment amount. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * Payment amount. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public Builder bankingTransactionRefs(java.util.List bankingTransactionRefs) { + Utils.checkNotNull(bankingTransactionRefs, "bankingTransactionRefs"); + this.bankingTransactionRefs = Optional.ofNullable(bankingTransactionRefs); + return this; + } + + public Builder bankingTransactionRefs(Optional> bankingTransactionRefs) { + Utils.checkNotNull(bankingTransactionRefs, "bankingTransactionRefs"); + this.bankingTransactionRefs = bankingTransactionRefs; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + 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(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; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of payment. + */ + public Builder paymentType(String paymentType) { + Utils.checkNotNull(paymentType, "paymentType"); + this.paymentType = Optional.ofNullable(paymentType); + return this; + } + + /** + * The type of payment. + */ + public Builder paymentType(Optional paymentType) { + Utils.checkNotNull(paymentType, "paymentType"); + this.paymentType = paymentType; + return this; + } + + public Payment build() { + return new Payment( + amount, + bankingTransactionRefs, + currency, + currencyRate, + date, + id, + paymentType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentAllocationPayment.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentAllocationPayment.java new file mode 100644 index 00000000..e918f0a9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentAllocationPayment.java @@ -0,0 +1,860 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PaymentAllocationPayment { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Identifier of the allocated payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Notes attached to the allocated payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("note") + private JsonNullable note; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paidOnDate") + private Optional paidOnDate; + + /** + * Reference to the allocated payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reference") + private JsonNullable reference; + + /** + * Total amount that was paid. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + public PaymentAllocationPayment( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("currency") Optional currency, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") Optional id, + @JsonProperty("note") JsonNullable note, + @JsonProperty("paidOnDate") Optional paidOnDate, + @JsonProperty("reference") JsonNullable reference, + @JsonProperty("totalAmount") Optional totalAmount) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(note, "note"); + Utils.checkNotNull(paidOnDate, "paidOnDate"); + Utils.checkNotNull(reference, "reference"); + Utils.checkNotNull(totalAmount, "totalAmount"); + this.accountRef = accountRef; + this.currency = currency; + this.currencyRate = currencyRate; + this.id = id; + this.note = note; + this.paidOnDate = paidOnDate; + this.reference = reference; + this.totalAmount = totalAmount; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Identifier of the allocated payment. + */ + public Optional id() { + return id; + } + + /** + * Notes attached to the allocated payment. + */ + public JsonNullable note() { + return note; + } + + /** + * 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 Optional paidOnDate() { + return paidOnDate; + } + + /** + * Reference to the allocated payment. + */ + public JsonNullable reference() { + return reference; + } + + /** + * Total amount that was paid. + */ + public Optional totalAmount() { + return totalAmount; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public PaymentAllocationPayment withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public PaymentAllocationPayment withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public PaymentAllocationPayment withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public PaymentAllocationPayment withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public PaymentAllocationPayment withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public PaymentAllocationPayment withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the allocated payment. + */ + public PaymentAllocationPayment withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the allocated payment. + */ + public PaymentAllocationPayment withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Notes attached to the allocated payment. + */ + public PaymentAllocationPayment withNote(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Notes attached to the allocated payment. + */ + public PaymentAllocationPayment withNote(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + 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 PaymentAllocationPayment withPaidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 PaymentAllocationPayment withPaidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + /** + * Reference to the allocated payment. + */ + public PaymentAllocationPayment withReference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Reference to the allocated payment. + */ + public PaymentAllocationPayment withReference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + /** + * Total amount that was paid. + */ + public PaymentAllocationPayment withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount that was paid. + */ + public PaymentAllocationPayment withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentAllocationPayment other = (PaymentAllocationPayment) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.note, other.note) && + java.util.Objects.deepEquals(this.paidOnDate, other.paidOnDate) && + java.util.Objects.deepEquals(this.reference, other.reference) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + currency, + currencyRate, + id, + note, + paidOnDate, + reference, + totalAmount); + } + + @Override + public String toString() { + return Utils.toString(PaymentAllocationPayment.class, + "accountRef", accountRef, + "currency", currency, + "currencyRate", currencyRate, + "id", id, + "note", note, + "paidOnDate", paidOnDate, + "reference", reference, + "totalAmount", totalAmount); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional currency = Optional.empty(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private JsonNullable note = JsonNullable.undefined(); + + private Optional paidOnDate = Optional.empty(); + + private JsonNullable reference = JsonNullable.undefined(); + + private Optional totalAmount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Identifier of the allocated payment. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier of the allocated payment. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Notes attached to the allocated payment. + */ + public Builder note(String note) { + Utils.checkNotNull(note, "note"); + this.note = JsonNullable.of(note); + return this; + } + + /** + * Notes attached to the allocated payment. + */ + public Builder note(JsonNullable note) { + Utils.checkNotNull(note, "note"); + this.note = note; + 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 paidOnDate(String paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = Optional.ofNullable(paidOnDate); + 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 paidOnDate(Optional paidOnDate) { + Utils.checkNotNull(paidOnDate, "paidOnDate"); + this.paidOnDate = paidOnDate; + return this; + } + + /** + * Reference to the allocated payment. + */ + public Builder reference(String reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = JsonNullable.of(reference); + return this; + } + + /** + * Reference to the allocated payment. + */ + public Builder reference(JsonNullable reference) { + Utils.checkNotNull(reference, "reference"); + this.reference = reference; + return this; + } + + /** + * Total amount that was paid. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount that was paid. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + public PaymentAllocationPayment build() { + return new PaymentAllocationPayment( + accountRef, + currency, + currencyRate, + id, + note, + paidOnDate, + reference, + totalAmount); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLine.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLine.java new file mode 100644 index 00000000..0ea0215d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLine.java @@ -0,0 +1,306 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PaymentLine { + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("allocatedOnDate") + private Optional allocatedOnDate; + + /** + * Amount in the payment currency. + */ + @JsonProperty("amount") + private double amount; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private JsonNullable> links; + + public PaymentLine( + @JsonProperty("allocatedOnDate") Optional allocatedOnDate, + @JsonProperty("amount") double amount, + @JsonProperty("links") JsonNullable> links) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(links, "links"); + this.allocatedOnDate = allocatedOnDate; + this.amount = amount; + this.links = links; + } + + /** + * 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 Optional allocatedOnDate() { + return allocatedOnDate; + } + + /** + * Amount in the payment currency. + */ + public double amount() { + return amount; + } + + public JsonNullable> links() { + return links; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * 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 PaymentLine withAllocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 PaymentLine withAllocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Amount in the payment currency. + */ + public PaymentLine withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public PaymentLine withLinks(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + public PaymentLine withLinks(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentLine other = (PaymentLine) o; + return + java.util.Objects.deepEquals(this.allocatedOnDate, other.allocatedOnDate) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.links, other.links); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + allocatedOnDate, + amount, + links); + } + + @Override + public String toString() { + return Utils.toString(PaymentLine.class, + "allocatedOnDate", allocatedOnDate, + "amount", amount, + "links", links); + } + + public final static class Builder { + + private Optional allocatedOnDate = Optional.empty(); + + private Double amount; + + private JsonNullable> links = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * 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 allocatedOnDate(String allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = Optional.ofNullable(allocatedOnDate); + 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 allocatedOnDate(Optional allocatedOnDate) { + Utils.checkNotNull(allocatedOnDate, "allocatedOnDate"); + this.allocatedOnDate = allocatedOnDate; + return this; + } + + /** + * Amount in the payment currency. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public Builder links(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + public Builder links(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + public PaymentLine build() { + return new PaymentLine( + allocatedOnDate, + amount, + links); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLineLink.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLineLink.java new file mode 100644 index 00000000..237e42f9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLineLink.java @@ -0,0 +1,513 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PaymentLineLink { + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private JsonNullable amount; + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currencyRate") + private JsonNullable currencyRate; + + /** + * Unique identifier of the transaction represented by the link. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Types of payment line links, either: + * `Unknown` + * `Unlinked` - Not used + * `Invoice` - ID refers to the invoice + * `CreditNote` - ID refers to the credit note + * `Refund` - ID refers to the sibling payment + * `Payment` - ID refers to the sibling payment + * `PaymentOnAccount` - ID refers to the customer + * `Other` - ID refers to the customer + * `Manual Journal` + * `Discount` - ID refers to the payment + */ + @JsonProperty("type") + private PaymentLinkType type; + + public PaymentLineLink( + @JsonProperty("amount") JsonNullable amount, + @JsonProperty("currencyRate") JsonNullable currencyRate, + @JsonProperty("id") Optional id, + @JsonProperty("type") PaymentLinkType type) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.amount = amount; + this.currencyRate = currencyRate; + this.id = id; + this.type = type; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + public JsonNullable amount() { + return amount; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public Optional id() { + return id; + } + + /** + * Types of payment line links, either: + * `Unknown` + * `Unlinked` - Not used + * `Invoice` - ID refers to the invoice + * `CreditNote` - ID refers to the credit note + * `Refund` - ID refers to the sibling payment + * `Payment` - ID refers to the sibling payment + * `PaymentOnAccount` - ID refers to the customer + * `Other` - ID refers to the customer + * `Manual Journal` + * `Discount` - ID refers to the payment + */ + public PaymentLinkType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + public PaymentLineLink withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + public PaymentLineLink withAmount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public PaymentLineLink withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public PaymentLineLink withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public PaymentLineLink withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public PaymentLineLink withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Types of payment line links, either: + * `Unknown` + * `Unlinked` - Not used + * `Invoice` - ID refers to the invoice + * `CreditNote` - ID refers to the credit note + * `Refund` - ID refers to the sibling payment + * `Payment` - ID refers to the sibling payment + * `PaymentOnAccount` - ID refers to the customer + * `Other` - ID refers to the customer + * `Manual Journal` + * `Discount` - ID refers to the payment + */ + public PaymentLineLink withType(PaymentLinkType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentLineLink other = (PaymentLineLink) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.currencyRate, other.currencyRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + currencyRate, + id, + type); + } + + @Override + public String toString() { + return Utils.toString(PaymentLineLink.class, + "amount", amount, + "currencyRate", currencyRate, + "id", id, + "type", type); + } + + public final static class Builder { + + private JsonNullable amount = JsonNullable.undefined(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private Optional id = Optional.empty(); + + private PaymentLinkType type; + + private Builder() { + // force use of static builder() method + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + * A negative link amount _reduces_ the outstanding amount on the accounts receivable account. + * A positive link amount _increases_ the outstanding amount on the accounts receivable account. + */ + public Builder amount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + * + * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + * + * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + * + * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + * + * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + * + * ## Examples with base currency of GBP + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **USD** | $20 | 0.781 | £15.62 | + * | **EUR** | €20 | 0.885 | £17.70 | + * | **RUB** | ₽20 | 0.011 | £0.22 | + * + * ## Examples with base currency of USD + * + * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + * | :--------------- | :------------- | :------------ | :------------------------- | + * | **GBP** | £20 | 1.277 | $25.54 | + * | **EUR** | €20 | 1.134 | $22.68 | + * | **RUB** | ₽20 | 0.015 | $0.30 | + * + * + * ### Integration-specific details + * + * | Integration | Scenario | System behavior | + * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier of the transaction represented by the link. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Types of payment line links, either: + * `Unknown` + * `Unlinked` - Not used + * `Invoice` - ID refers to the invoice + * `CreditNote` - ID refers to the credit note + * `Refund` - ID refers to the sibling payment + * `Payment` - ID refers to the sibling payment + * `PaymentOnAccount` - ID refers to the customer + * `Other` - ID refers to the customer + * `Manual Journal` + * `Discount` - ID refers to the payment + */ + public Builder type(PaymentLinkType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PaymentLineLink build() { + return new PaymentLineLink( + amount, + currencyRate, + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLinkType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLinkType.java new file mode 100644 index 00000000..403fcef5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentLinkType.java @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PaymentLinkType - Types of payment line links, either: + * `Unknown` + * `Unlinked` - Not used + * `Invoice` - ID refers to the invoice + * `CreditNote` - ID refers to the credit note + * `Refund` - ID refers to the sibling payment + * `Payment` - ID refers to the sibling payment + * `PaymentOnAccount` - ID refers to the customer + * `Other` - ID refers to the customer + * `Manual Journal` + * `Discount` - ID refers to the payment + */ +public enum PaymentLinkType { + UNKNOWN("Unknown"), + UNLINKED("Unlinked"), + INVOICE("Invoice"), + CREDIT_NOTE("CreditNote"), + OTHER("Other"), + REFUND("Refund"), + PAYMENT("Payment"), + PAYMENT_ON_ACCOUNT("PaymentOnAccount"), + MANUAL_JOURNAL("ManualJournal"), + DISCOUNT("Discount"); + + @JsonValue + private final String value; + + private PaymentLinkType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentMethodRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentMethodRef.java new file mode 100644 index 00000000..35598a2a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentMethodRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * PaymentMethodRef - The payment method the record is linked to in the accounting or commerce platform. + */ + +public class PaymentMethodRef { + + /** + * The unique identifier of the location being referenced. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the location being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public PaymentMethodRef( + @JsonProperty("id") String id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identifier of the location being referenced. + */ + public String id() { + return id; + } + + /** + * Name of the location being referenced. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identifier of the location being referenced. + */ + public PaymentMethodRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the location being referenced. + */ + public PaymentMethodRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the location being referenced. + */ + public PaymentMethodRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentMethodRef other = (PaymentMethodRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(PaymentMethodRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identifier of the location being referenced. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the location being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the location being referenced. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public PaymentMethodRef build() { + return new PaymentMethodRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentRef.java new file mode 100644 index 00000000..1b5b570d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentRef.java @@ -0,0 +1,845 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PaymentRef { + + /** + * Payment Amount (including gratuity). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private JsonNullable amount; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dueDate") + private Optional dueDate; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Service provider of the payment, if applicable. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("paymentProvider") + private Optional paymentProvider; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * Status of the payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Type of payment. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private JsonNullable type; + + public PaymentRef( + @JsonProperty("amount") JsonNullable amount, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("currency") Optional currency, + @JsonProperty("dueDate") Optional dueDate, + @JsonProperty("id") String id, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("paymentProvider") Optional paymentProvider, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("type") JsonNullable type) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(paymentProvider, "paymentProvider"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(type, "type"); + this.amount = amount; + this.createdDate = createdDate; + this.currency = currency; + this.dueDate = dueDate; + this.id = id; + this.modifiedDate = modifiedDate; + this.paymentProvider = paymentProvider; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.type = type; + } + + /** + * Payment Amount (including gratuity). + */ + public JsonNullable amount() { + return amount; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * 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 Optional dueDate() { + return dueDate; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Service provider of the payment, if applicable. + */ + public Optional paymentProvider() { + return paymentProvider; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * Status of the payment. + */ + public Optional status() { + return status; + } + + /** + * Type of payment. + */ + public JsonNullable type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Payment Amount (including gratuity). + */ + public PaymentRef withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Payment Amount (including gratuity). + */ + public PaymentRef withAmount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 PaymentRef withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 PaymentRef withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public PaymentRef withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public PaymentRef withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 PaymentRef withDueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 PaymentRef withDueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public PaymentRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public PaymentRef withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public PaymentRef withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public PaymentRef withPaymentProvider(String paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = Optional.ofNullable(paymentProvider); + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public PaymentRef withPaymentProvider(Optional paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = paymentProvider; + return this; + } + + public PaymentRef withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public PaymentRef withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the payment. + */ + public PaymentRef withStatus(PaymentStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the payment. + */ + public PaymentRef withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Type of payment. + */ + public PaymentRef withType(PaymentType type) { + Utils.checkNotNull(type, "type"); + this.type = JsonNullable.of(type); + return this; + } + + /** + * Type of payment. + */ + public PaymentRef withType(JsonNullable type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentRef other = (PaymentRef) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.dueDate, other.dueDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.paymentProvider, other.paymentProvider) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + createdDate, + currency, + dueDate, + id, + modifiedDate, + paymentProvider, + sourceModifiedDate, + status, + type); + } + + @Override + public String toString() { + return Utils.toString(PaymentRef.class, + "amount", amount, + "createdDate", createdDate, + "currency", currency, + "dueDate", dueDate, + "id", id, + "modifiedDate", modifiedDate, + "paymentProvider", paymentProvider, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "type", type); + } + + public final static class Builder { + + private JsonNullable amount = JsonNullable.undefined(); + + private Optional createdDate = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional dueDate = Optional.empty(); + + private String id; + + private Optional modifiedDate = Optional.empty(); + + private Optional paymentProvider = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private JsonNullable type = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Payment Amount (including gratuity). + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = JsonNullable.of(amount); + return this; + } + + /** + * Payment Amount (including gratuity). + */ + public Builder amount(JsonNullable amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + 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 dueDate(String dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = Optional.ofNullable(dueDate); + 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 dueDate(Optional dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public Builder paymentProvider(String paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = Optional.ofNullable(paymentProvider); + return this; + } + + /** + * Service provider of the payment, if applicable. + */ + public Builder paymentProvider(Optional paymentProvider) { + Utils.checkNotNull(paymentProvider, "paymentProvider"); + this.paymentProvider = paymentProvider; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * Status of the payment. + */ + public Builder status(PaymentStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * Status of the payment. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Type of payment. + */ + public Builder type(PaymentType type) { + Utils.checkNotNull(type, "type"); + this.type = JsonNullable.of(type); + return this; + } + + /** + * Type of payment. + */ + public Builder type(JsonNullable type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PaymentRef build() { + return new PaymentRef( + amount, + createdDate, + currency, + dueDate, + id, + modifiedDate, + paymentProvider, + sourceModifiedDate, + status, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentStatus.java new file mode 100644 index 00000000..27293ae2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentStatus.java @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PaymentStatus - Status of the payment. + */ +public enum PaymentStatus { + PENDING("Pending"), + AUTHORIZED("Authorized"), + PAID("Paid"), + FAILED("Failed"), + CANCELLED("Cancelled"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private PaymentStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentType.java new file mode 100644 index 00000000..54340408 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PaymentType.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PaymentType - Type of payment. + */ +public enum PaymentType { + CASH("Cash"), + CARD("Card"), + INVOICE("Invoice"), + ONLINE_CARD("OnlineCard"), + SWISH("Swish"), + VIPPS("Vipps"), + MOBILE("Mobile"), + STORE_CREDIT("StoreCredit"), + PAYPAL("Paypal"), + CUSTOM("Custom"), + PREPAID("Prepaid"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private PaymentType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PeriodUnit.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PeriodUnit.java new file mode 100644 index 00000000..4fbad7ec --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PeriodUnit.java @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +public enum PeriodUnit { + DAY("Day"), + WEEK("Week"), + MONTH("Month"), + YEAR("Year"); + + @JsonValue + private final String value; + + private PeriodUnit(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumber.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumber.java new file mode 100644 index 00000000..bcac1fb9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumber.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class PhoneNumber { + + /** + * A phone number. + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("number") + private Optional number; + + /** + * The type of phone number + */ + @JsonProperty("type") + private PhoneNumberType type; + + public PhoneNumber( + @JsonProperty("number") Optional number, + @JsonProperty("type") PhoneNumberType type) { + Utils.checkNotNull(number, "number"); + Utils.checkNotNull(type, "type"); + this.number = number; + this.type = type; + } + + /** + * A phone number. + */ + public Optional number() { + return number; + } + + /** + * The type of phone number + */ + public PhoneNumberType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A phone number. + */ + public PhoneNumber withNumber(String number) { + Utils.checkNotNull(number, "number"); + this.number = Optional.ofNullable(number); + return this; + } + + /** + * A phone number. + */ + public PhoneNumber withNumber(Optional number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * The type of phone number + */ + public PhoneNumber withType(PhoneNumberType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumber other = (PhoneNumber) o; + return + java.util.Objects.deepEquals(this.number, other.number) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + number, + type); + } + + @Override + public String toString() { + return Utils.toString(PhoneNumber.class, + "number", number, + "type", type); + } + + public final static class Builder { + + private Optional number = Optional.empty(); + + private PhoneNumberType type; + + private Builder() { + // force use of static builder() method + } + + /** + * A phone number. + */ + public Builder number(String number) { + Utils.checkNotNull(number, "number"); + this.number = Optional.ofNullable(number); + return this; + } + + /** + * A phone number. + */ + public Builder number(Optional number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * The type of phone number + */ + public Builder type(PhoneNumberType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PhoneNumber build() { + return new PhoneNumber( + number, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumberType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumberType.java new file mode 100644 index 00000000..e6089a1d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PhoneNumberType.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PhoneNumberType - The type of phone number + */ +public enum PhoneNumberType { + PRIMARY("Primary"), + LANDLINE("Landline"), + MOBILE("Mobile"), + FAX("Fax"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private PhoneNumberType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventory.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventory.java new file mode 100644 index 00000000..4d7b17a7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventory.java @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ProductInventory - Information about the total inventory as well as the locations inventory is in. + */ + +public class ProductInventory { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("locations") + private Optional> locations; + + /** + * The total quantity of stock remaining across locations. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalQuantity") + private JsonNullable totalQuantity; + + public ProductInventory( + @JsonProperty("locations") Optional> locations, + @JsonProperty("totalQuantity") JsonNullable totalQuantity) { + Utils.checkNotNull(locations, "locations"); + Utils.checkNotNull(totalQuantity, "totalQuantity"); + this.locations = locations; + this.totalQuantity = totalQuantity; + } + + public Optional> locations() { + return locations; + } + + /** + * The total quantity of stock remaining across locations. + */ + public JsonNullable totalQuantity() { + return totalQuantity; + } + + public final static Builder builder() { + return new Builder(); + } + + public ProductInventory withLocations(java.util.List locations) { + Utils.checkNotNull(locations, "locations"); + this.locations = Optional.ofNullable(locations); + return this; + } + + public ProductInventory withLocations(Optional> locations) { + Utils.checkNotNull(locations, "locations"); + this.locations = locations; + return this; + } + + /** + * The total quantity of stock remaining across locations. + */ + public ProductInventory withTotalQuantity(double totalQuantity) { + Utils.checkNotNull(totalQuantity, "totalQuantity"); + this.totalQuantity = JsonNullable.of(totalQuantity); + return this; + } + + /** + * The total quantity of stock remaining across locations. + */ + public ProductInventory withTotalQuantity(JsonNullable totalQuantity) { + Utils.checkNotNull(totalQuantity, "totalQuantity"); + this.totalQuantity = totalQuantity; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductInventory other = (ProductInventory) o; + return + java.util.Objects.deepEquals(this.locations, other.locations) && + java.util.Objects.deepEquals(this.totalQuantity, other.totalQuantity); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + locations, + totalQuantity); + } + + @Override + public String toString() { + return Utils.toString(ProductInventory.class, + "locations", locations, + "totalQuantity", totalQuantity); + } + + public final static class Builder { + + private Optional> locations = Optional.empty(); + + private JsonNullable totalQuantity = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder locations(java.util.List locations) { + Utils.checkNotNull(locations, "locations"); + this.locations = Optional.ofNullable(locations); + return this; + } + + public Builder locations(Optional> locations) { + Utils.checkNotNull(locations, "locations"); + this.locations = locations; + return this; + } + + /** + * The total quantity of stock remaining across locations. + */ + public Builder totalQuantity(double totalQuantity) { + Utils.checkNotNull(totalQuantity, "totalQuantity"); + this.totalQuantity = JsonNullable.of(totalQuantity); + return this; + } + + /** + * The total quantity of stock remaining across locations. + */ + public Builder totalQuantity(JsonNullable totalQuantity) { + Utils.checkNotNull(totalQuantity, "totalQuantity"); + this.totalQuantity = totalQuantity; + return this; + } + + public ProductInventory build() { + return new ProductInventory( + locations, + totalQuantity); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventoryLocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventoryLocation.java new file mode 100644 index 00000000..53364b0d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductInventoryLocation.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ProductInventoryLocation { + + /** + * Reference to the geographic location where the order was placed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("locationRef") + private Optional locationRef; + + /** + * The quantity of stock remaining at location. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("quantity") + private Optional quantity; + + public ProductInventoryLocation( + @JsonProperty("locationRef") Optional locationRef, + @JsonProperty("quantity") Optional quantity) { + Utils.checkNotNull(locationRef, "locationRef"); + Utils.checkNotNull(quantity, "quantity"); + this.locationRef = locationRef; + this.quantity = quantity; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Optional locationRef() { + return locationRef; + } + + /** + * The quantity of stock remaining at location. + */ + public Optional quantity() { + return quantity; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Reference to the geographic location where the order was placed. + */ + public ProductInventoryLocation withLocationRef(LocationRef locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = Optional.ofNullable(locationRef); + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public ProductInventoryLocation withLocationRef(Optional locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = locationRef; + return this; + } + + /** + * The quantity of stock remaining at location. + */ + public ProductInventoryLocation withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * The quantity of stock remaining at location. + */ + public ProductInventoryLocation withQuantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductInventoryLocation other = (ProductInventoryLocation) o; + return + java.util.Objects.deepEquals(this.locationRef, other.locationRef) && + java.util.Objects.deepEquals(this.quantity, other.quantity); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + locationRef, + quantity); + } + + @Override + public String toString() { + return Utils.toString(ProductInventoryLocation.class, + "locationRef", locationRef, + "quantity", quantity); + } + + public final static class Builder { + + private Optional locationRef = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Builder locationRef(LocationRef locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = Optional.ofNullable(locationRef); + return this; + } + + /** + * Reference to the geographic location where the order was placed. + */ + public Builder locationRef(Optional locationRef) { + Utils.checkNotNull(locationRef, "locationRef"); + this.locationRef = locationRef; + return this; + } + + /** + * The quantity of stock remaining at location. + */ + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * The quantity of stock remaining at location. + */ + public Builder quantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + public ProductInventoryLocation build() { + return new ProductInventoryLocation( + locationRef, + quantity); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductPrice.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductPrice.java new file mode 100644 index 00000000..3088d5aa --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductPrice.java @@ -0,0 +1,211 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ProductPrice { + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + /** + * The product variant's unit price. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unitPrice") + private Optional unitPrice; + + public ProductPrice( + @JsonProperty("currency") Optional currency, + @JsonProperty("unitPrice") Optional unitPrice) { + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(unitPrice, "unitPrice"); + this.currency = currency; + this.unitPrice = unitPrice; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + /** + * The product variant's unit price. + */ + public Optional unitPrice() { + return unitPrice; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public ProductPrice withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public ProductPrice withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The product variant's unit price. + */ + public ProductPrice withUnitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + * The product variant's unit price. + */ + public ProductPrice withUnitPrice(Optional unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductPrice other = (ProductPrice) o; + return + java.util.Objects.deepEquals(this.currency, other.currency) && + java.util.Objects.deepEquals(this.unitPrice, other.unitPrice); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + currency, + unitPrice); + } + + @Override + public String toString() { + return Utils.toString(ProductPrice.class, + "currency", currency, + "unitPrice", unitPrice); + } + + public final static class Builder { + + private Optional currency = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * The product variant's unit price. + */ + public Builder unitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + * The product variant's unit price. + */ + public Builder unitPrice(Optional unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + public ProductPrice build() { + return new ProductPrice( + currency, + unitPrice); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductRef.java new file mode 100644 index 00000000..59425f2a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ProductRef - Reference that links the line item to the correct product details. + */ + +public class ProductRef { + + /** + * The unique identifier of the product being referenced. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the product being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public ProductRef( + @JsonProperty("id") String id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identifier of the product being referenced. + */ + public String id() { + return id; + } + + /** + * Name of the product being referenced. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identifier of the product being referenced. + */ + public ProductRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the product being referenced. + */ + public ProductRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product being referenced. + */ + public ProductRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductRef other = (ProductRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(ProductRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identifier of the product being referenced. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the product being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product being referenced. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public ProductRef build() { + return new ProductRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariant.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariant.java new file mode 100644 index 00000000..2a1d55d3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariant.java @@ -0,0 +1,940 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ProductVariant - Represents a variation of a product available for sale, for example an item of clothing that may be available for sale in multiple sizes and colors. + * + */ + +public class ProductVariant { + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("barcode") + private Optional barcode; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("createdDate") + private Optional createdDate; + + /** + * A unique, persistent identifier for this record + */ + @JsonProperty("id") + private String id; + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("inventory") + private Optional inventory; + + /** + * Whether sales taxes are enabled for this product variant. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("isTaxEnabled") + private Optional isTaxEnabled; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("modifiedDate") + private Optional modifiedDate; + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + /** + * Prices for the product variants in different currencies. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("prices") + private Optional> prices; + + /** + * Indicates whether or not the product requires physical delivery. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("shippingRequired") + private Optional shippingRequired; + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sku") + private Optional sku; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceModifiedDate") + private Optional sourceModifiedDate; + + /** + * The status of the product variant. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private Optional status; + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unitOfMeasure") + private Optional unitOfMeasure; + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("vatPercentage") + private Optional vatPercentage; + + public ProductVariant( + @JsonProperty("barcode") Optional barcode, + @JsonProperty("createdDate") Optional createdDate, + @JsonProperty("id") String id, + @JsonProperty("inventory") Optional inventory, + @JsonProperty("isTaxEnabled") Optional isTaxEnabled, + @JsonProperty("modifiedDate") Optional modifiedDate, + @JsonProperty("name") Optional name, + @JsonProperty("prices") Optional> prices, + @JsonProperty("shippingRequired") Optional shippingRequired, + @JsonProperty("sku") Optional sku, + @JsonProperty("sourceModifiedDate") Optional sourceModifiedDate, + @JsonProperty("status") Optional status, + @JsonProperty("unitOfMeasure") Optional unitOfMeasure, + @JsonProperty("vatPercentage") Optional vatPercentage) { + Utils.checkNotNull(barcode, "barcode"); + Utils.checkNotNull(createdDate, "createdDate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(inventory, "inventory"); + Utils.checkNotNull(isTaxEnabled, "isTaxEnabled"); + Utils.checkNotNull(modifiedDate, "modifiedDate"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(prices, "prices"); + Utils.checkNotNull(shippingRequired, "shippingRequired"); + Utils.checkNotNull(sku, "sku"); + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + Utils.checkNotNull(vatPercentage, "vatPercentage"); + this.barcode = barcode; + this.createdDate = createdDate; + this.id = id; + this.inventory = inventory; + this.isTaxEnabled = isTaxEnabled; + this.modifiedDate = modifiedDate; + this.name = name; + this.prices = prices; + this.shippingRequired = shippingRequired; + this.sku = sku; + this.sourceModifiedDate = sourceModifiedDate; + this.status = status; + this.unitOfMeasure = unitOfMeasure; + this.vatPercentage = vatPercentage; + } + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + public Optional barcode() { + return barcode; + } + + /** + * 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 Optional createdDate() { + return createdDate; + } + + /** + * A unique, persistent identifier for this record + */ + public String id() { + return id; + } + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + public Optional inventory() { + return inventory; + } + + /** + * Whether sales taxes are enabled for this product variant. + */ + public Optional isTaxEnabled() { + return isTaxEnabled; + } + + public Optional modifiedDate() { + return modifiedDate; + } + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + public Optional name() { + return name; + } + + /** + * Prices for the product variants in different currencies. + */ + public Optional> prices() { + return prices; + } + + /** + * Indicates whether or not the product requires physical delivery. + */ + public Optional shippingRequired() { + return shippingRequired; + } + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + public Optional sku() { + return sku; + } + + public Optional sourceModifiedDate() { + return sourceModifiedDate; + } + + /** + * The status of the product variant. + */ + public Optional status() { + return status; + } + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + public Optional unitOfMeasure() { + return unitOfMeasure; + } + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + public Optional vatPercentage() { + return vatPercentage; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + public ProductVariant withBarcode(String barcode) { + Utils.checkNotNull(barcode, "barcode"); + this.barcode = Optional.ofNullable(barcode); + return this; + } + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + public ProductVariant withBarcode(Optional barcode) { + Utils.checkNotNull(barcode, "barcode"); + this.barcode = barcode; + 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 ProductVariant withCreatedDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 ProductVariant withCreatedDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public ProductVariant withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + public ProductVariant withInventory(ProductInventory inventory) { + Utils.checkNotNull(inventory, "inventory"); + this.inventory = Optional.ofNullable(inventory); + return this; + } + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + public ProductVariant withInventory(Optional inventory) { + Utils.checkNotNull(inventory, "inventory"); + this.inventory = inventory; + return this; + } + + /** + * Whether sales taxes are enabled for this product variant. + */ + public ProductVariant withIsTaxEnabled(boolean isTaxEnabled) { + Utils.checkNotNull(isTaxEnabled, "isTaxEnabled"); + this.isTaxEnabled = Optional.ofNullable(isTaxEnabled); + return this; + } + + /** + * Whether sales taxes are enabled for this product variant. + */ + public ProductVariant withIsTaxEnabled(Optional isTaxEnabled) { + Utils.checkNotNull(isTaxEnabled, "isTaxEnabled"); + this.isTaxEnabled = isTaxEnabled; + return this; + } + + public ProductVariant withModifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public ProductVariant withModifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + public ProductVariant withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + public ProductVariant withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Prices for the product variants in different currencies. + */ + public ProductVariant withPrices(java.util.List prices) { + Utils.checkNotNull(prices, "prices"); + this.prices = Optional.ofNullable(prices); + return this; + } + + /** + * Prices for the product variants in different currencies. + */ + public ProductVariant withPrices(Optional> prices) { + Utils.checkNotNull(prices, "prices"); + this.prices = prices; + return this; + } + + /** + * Indicates whether or not the product requires physical delivery. + */ + public ProductVariant withShippingRequired(boolean shippingRequired) { + Utils.checkNotNull(shippingRequired, "shippingRequired"); + this.shippingRequired = Optional.ofNullable(shippingRequired); + return this; + } + + /** + * Indicates whether or not the product requires physical delivery. + */ + public ProductVariant withShippingRequired(Optional shippingRequired) { + Utils.checkNotNull(shippingRequired, "shippingRequired"); + this.shippingRequired = shippingRequired; + return this; + } + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + public ProductVariant withSku(String sku) { + Utils.checkNotNull(sku, "sku"); + this.sku = Optional.ofNullable(sku); + return this; + } + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + public ProductVariant withSku(Optional sku) { + Utils.checkNotNull(sku, "sku"); + this.sku = sku; + return this; + } + + public ProductVariant withSourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public ProductVariant withSourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the product variant. + */ + public ProductVariant withStatus(ProductVariantStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the product variant. + */ + public ProductVariant withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + public ProductVariant withUnitOfMeasure(String unitOfMeasure) { + Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure); + return this; + } + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + public ProductVariant withUnitOfMeasure(Optional unitOfMeasure) { + Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + this.unitOfMeasure = unitOfMeasure; + return this; + } + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + public ProductVariant withVatPercentage(double vatPercentage) { + Utils.checkNotNull(vatPercentage, "vatPercentage"); + this.vatPercentage = Optional.ofNullable(vatPercentage); + return this; + } + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + public ProductVariant withVatPercentage(Optional vatPercentage) { + Utils.checkNotNull(vatPercentage, "vatPercentage"); + this.vatPercentage = vatPercentage; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductVariant other = (ProductVariant) o; + return + java.util.Objects.deepEquals(this.barcode, other.barcode) && + java.util.Objects.deepEquals(this.createdDate, other.createdDate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.inventory, other.inventory) && + java.util.Objects.deepEquals(this.isTaxEnabled, other.isTaxEnabled) && + java.util.Objects.deepEquals(this.modifiedDate, other.modifiedDate) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.prices, other.prices) && + java.util.Objects.deepEquals(this.shippingRequired, other.shippingRequired) && + java.util.Objects.deepEquals(this.sku, other.sku) && + java.util.Objects.deepEquals(this.sourceModifiedDate, other.sourceModifiedDate) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.unitOfMeasure, other.unitOfMeasure) && + java.util.Objects.deepEquals(this.vatPercentage, other.vatPercentage); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + barcode, + createdDate, + id, + inventory, + isTaxEnabled, + modifiedDate, + name, + prices, + shippingRequired, + sku, + sourceModifiedDate, + status, + unitOfMeasure, + vatPercentage); + } + + @Override + public String toString() { + return Utils.toString(ProductVariant.class, + "barcode", barcode, + "createdDate", createdDate, + "id", id, + "inventory", inventory, + "isTaxEnabled", isTaxEnabled, + "modifiedDate", modifiedDate, + "name", name, + "prices", prices, + "shippingRequired", shippingRequired, + "sku", sku, + "sourceModifiedDate", sourceModifiedDate, + "status", status, + "unitOfMeasure", unitOfMeasure, + "vatPercentage", vatPercentage); + } + + public final static class Builder { + + private Optional barcode = Optional.empty(); + + private Optional createdDate = Optional.empty(); + + private String id; + + private Optional inventory = Optional.empty(); + + private Optional isTaxEnabled = Optional.empty(); + + private Optional modifiedDate = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional> prices = Optional.empty(); + + private Optional shippingRequired = Optional.empty(); + + private Optional sku = Optional.empty(); + + private Optional sourceModifiedDate = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional unitOfMeasure = Optional.empty(); + + private Optional vatPercentage = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + public Builder barcode(String barcode) { + Utils.checkNotNull(barcode, "barcode"); + this.barcode = Optional.ofNullable(barcode); + return this; + } + + /** + * Unique product number of the variant. This might be a barcode, UPC, ISBN, etc. + */ + public Builder barcode(Optional barcode) { + Utils.checkNotNull(barcode, "barcode"); + this.barcode = barcode; + 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 createdDate(String createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = Optional.ofNullable(createdDate); + 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 createdDate(Optional createdDate) { + Utils.checkNotNull(createdDate, "createdDate"); + this.createdDate = createdDate; + return this; + } + + /** + * A unique, persistent identifier for this record + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + public Builder inventory(ProductInventory inventory) { + Utils.checkNotNull(inventory, "inventory"); + this.inventory = Optional.ofNullable(inventory); + return this; + } + + /** + * Information about the total inventory as well as the locations inventory is in. + */ + public Builder inventory(Optional inventory) { + Utils.checkNotNull(inventory, "inventory"); + this.inventory = inventory; + return this; + } + + /** + * Whether sales taxes are enabled for this product variant. + */ + public Builder isTaxEnabled(boolean isTaxEnabled) { + Utils.checkNotNull(isTaxEnabled, "isTaxEnabled"); + this.isTaxEnabled = Optional.ofNullable(isTaxEnabled); + return this; + } + + /** + * Whether sales taxes are enabled for this product variant. + */ + public Builder isTaxEnabled(Optional isTaxEnabled) { + Utils.checkNotNull(isTaxEnabled, "isTaxEnabled"); + this.isTaxEnabled = isTaxEnabled; + return this; + } + + public Builder modifiedDate(String modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = Optional.ofNullable(modifiedDate); + return this; + } + + public Builder modifiedDate(Optional modifiedDate) { + Utils.checkNotNull(modifiedDate, "modifiedDate"); + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product recorded in the commerce or point of sale platform. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Prices for the product variants in different currencies. + */ + public Builder prices(java.util.List prices) { + Utils.checkNotNull(prices, "prices"); + this.prices = Optional.ofNullable(prices); + return this; + } + + /** + * Prices for the product variants in different currencies. + */ + public Builder prices(Optional> prices) { + Utils.checkNotNull(prices, "prices"); + this.prices = prices; + return this; + } + + /** + * Indicates whether or not the product requires physical delivery. + */ + public Builder shippingRequired(boolean shippingRequired) { + Utils.checkNotNull(shippingRequired, "shippingRequired"); + this.shippingRequired = Optional.ofNullable(shippingRequired); + return this; + } + + /** + * Indicates whether or not the product requires physical delivery. + */ + public Builder shippingRequired(Optional shippingRequired) { + Utils.checkNotNull(shippingRequired, "shippingRequired"); + this.shippingRequired = shippingRequired; + return this; + } + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + public Builder sku(String sku) { + Utils.checkNotNull(sku, "sku"); + this.sku = Optional.ofNullable(sku); + return this; + } + + /** + * SKU (stock keeping unit) of the variant, as defined by the merchant. + */ + public Builder sku(Optional sku) { + Utils.checkNotNull(sku, "sku"); + this.sku = sku; + return this; + } + + public Builder sourceModifiedDate(String sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = Optional.ofNullable(sourceModifiedDate); + return this; + } + + public Builder sourceModifiedDate(Optional sourceModifiedDate) { + Utils.checkNotNull(sourceModifiedDate, "sourceModifiedDate"); + this.sourceModifiedDate = sourceModifiedDate; + return this; + } + + /** + * The status of the product variant. + */ + public Builder status(ProductVariantStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + /** + * The status of the product variant. + */ + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + public Builder unitOfMeasure(String unitOfMeasure) { + Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure); + return this; + } + + /** + * Unit of measure for the variant, such as `kg` or `meters`. + */ + public Builder unitOfMeasure(Optional unitOfMeasure) { + Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + this.unitOfMeasure = unitOfMeasure; + return this; + } + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + public Builder vatPercentage(double vatPercentage) { + Utils.checkNotNull(vatPercentage, "vatPercentage"); + this.vatPercentage = Optional.ofNullable(vatPercentage); + return this; + } + + /** + * VAT rate for the product variant if sales taxes are enabled. + */ + public Builder vatPercentage(Optional vatPercentage) { + Utils.checkNotNull(vatPercentage, "vatPercentage"); + this.vatPercentage = vatPercentage; + return this; + } + + public ProductVariant build() { + return new ProductVariant( + barcode, + createdDate, + id, + inventory, + isTaxEnabled, + modifiedDate, + name, + prices, + shippingRequired, + sku, + sourceModifiedDate, + status, + unitOfMeasure, + vatPercentage); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantRef.java new file mode 100644 index 00000000..b48d078e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ProductVariantRef - Reference that links the line item to the specific version of product that has been ordered. + */ + +public class ProductVariantRef { + + /** + * The unique identifier of the product variant being referenced. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the product variant being referenced. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public ProductVariantRef( + @JsonProperty("id") String id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identifier of the product variant being referenced. + */ + public String id() { + return id; + } + + /** + * Name of the product variant being referenced. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identifier of the product variant being referenced. + */ + public ProductVariantRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the product variant being referenced. + */ + public ProductVariantRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product variant being referenced. + */ + public ProductVariantRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProductVariantRef other = (ProductVariantRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(ProductVariantRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identifier of the product variant being referenced. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the product variant being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the product variant being referenced. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public ProductVariantRef build() { + return new ProductVariantRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantStatus.java new file mode 100644 index 00000000..7c1e1c2b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProductVariantStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ProductVariantStatus - The status of the product variant. + */ +public enum ProductVariantStatus { + UNKNOWN("Unknown"), + PUBLISHED("Published"), + UNPUBLISHED("Unpublished"); + + @JsonValue + private final String value; + + private ProductVariantStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProfitAndLossReport.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProfitAndLossReport.java new file mode 100644 index 00000000..511d5b20 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProfitAndLossReport.java @@ -0,0 +1,756 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ProfitAndLossReport { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("costOfSales") + private Optional costOfSales; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expenses") + private Optional expenses; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("fromDate") + private Optional fromDate; + + /** + * Gross profit of the company in the given date range. + */ + @JsonProperty("grossProfit") + private double grossProfit; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("income") + private Optional income; + + /** + * Net operating profit of the company in the given date range. + */ + @JsonProperty("netOperatingProfit") + private double netOperatingProfit; + + /** + * Net other income of the company in the given date range. + */ + @JsonProperty("netOtherIncome") + private double netOtherIncome; + + /** + * Net profit of the company in the given date range. + */ + @JsonProperty("netProfit") + private double netProfit; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("otherExpenses") + private Optional otherExpenses; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("otherIncome") + private Optional otherIncome; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("toDate") + private Optional toDate; + + public ProfitAndLossReport( + @JsonProperty("costOfSales") Optional costOfSales, + @JsonProperty("expenses") Optional expenses, + @JsonProperty("fromDate") Optional fromDate, + @JsonProperty("grossProfit") double grossProfit, + @JsonProperty("income") Optional income, + @JsonProperty("netOperatingProfit") double netOperatingProfit, + @JsonProperty("netOtherIncome") double netOtherIncome, + @JsonProperty("netProfit") double netProfit, + @JsonProperty("otherExpenses") Optional otherExpenses, + @JsonProperty("otherIncome") Optional otherIncome, + @JsonProperty("toDate") Optional toDate) { + Utils.checkNotNull(costOfSales, "costOfSales"); + Utils.checkNotNull(expenses, "expenses"); + Utils.checkNotNull(fromDate, "fromDate"); + Utils.checkNotNull(grossProfit, "grossProfit"); + Utils.checkNotNull(income, "income"); + Utils.checkNotNull(netOperatingProfit, "netOperatingProfit"); + Utils.checkNotNull(netOtherIncome, "netOtherIncome"); + Utils.checkNotNull(netProfit, "netProfit"); + Utils.checkNotNull(otherExpenses, "otherExpenses"); + Utils.checkNotNull(otherIncome, "otherIncome"); + Utils.checkNotNull(toDate, "toDate"); + this.costOfSales = costOfSales; + this.expenses = expenses; + this.fromDate = fromDate; + this.grossProfit = grossProfit; + this.income = income; + this.netOperatingProfit = netOperatingProfit; + this.netOtherIncome = netOtherIncome; + this.netProfit = netProfit; + this.otherExpenses = otherExpenses; + this.otherIncome = otherIncome; + this.toDate = toDate; + } + + public Optional costOfSales() { + return costOfSales; + } + + public Optional expenses() { + return expenses; + } + + /** + * 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 Optional fromDate() { + return fromDate; + } + + /** + * Gross profit of the company in the given date range. + */ + public double grossProfit() { + return grossProfit; + } + + public Optional income() { + return income; + } + + /** + * Net operating profit of the company in the given date range. + */ + public double netOperatingProfit() { + return netOperatingProfit; + } + + /** + * Net other income of the company in the given date range. + */ + public double netOtherIncome() { + return netOtherIncome; + } + + /** + * Net profit of the company in the given date range. + */ + public double netProfit() { + return netProfit; + } + + public Optional otherExpenses() { + return otherExpenses; + } + + public Optional otherIncome() { + return otherIncome; + } + + /** + * 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 Optional toDate() { + return toDate; + } + + public final static Builder builder() { + return new Builder(); + } + + public ProfitAndLossReport withCostOfSales(ReportLineInput costOfSales) { + Utils.checkNotNull(costOfSales, "costOfSales"); + this.costOfSales = Optional.ofNullable(costOfSales); + return this; + } + + public ProfitAndLossReport withCostOfSales(Optional costOfSales) { + Utils.checkNotNull(costOfSales, "costOfSales"); + this.costOfSales = costOfSales; + return this; + } + + public ProfitAndLossReport withExpenses(ReportLineInput expenses) { + Utils.checkNotNull(expenses, "expenses"); + this.expenses = Optional.ofNullable(expenses); + return this; + } + + public ProfitAndLossReport withExpenses(Optional expenses) { + Utils.checkNotNull(expenses, "expenses"); + this.expenses = expenses; + 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 ProfitAndLossReport withFromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 ProfitAndLossReport withFromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + return this; + } + + /** + * Gross profit of the company in the given date range. + */ + public ProfitAndLossReport withGrossProfit(double grossProfit) { + Utils.checkNotNull(grossProfit, "grossProfit"); + this.grossProfit = grossProfit; + return this; + } + + public ProfitAndLossReport withIncome(ReportLineInput income) { + Utils.checkNotNull(income, "income"); + this.income = Optional.ofNullable(income); + return this; + } + + public ProfitAndLossReport withIncome(Optional income) { + Utils.checkNotNull(income, "income"); + this.income = income; + return this; + } + + /** + * Net operating profit of the company in the given date range. + */ + public ProfitAndLossReport withNetOperatingProfit(double netOperatingProfit) { + Utils.checkNotNull(netOperatingProfit, "netOperatingProfit"); + this.netOperatingProfit = netOperatingProfit; + return this; + } + + /** + * Net other income of the company in the given date range. + */ + public ProfitAndLossReport withNetOtherIncome(double netOtherIncome) { + Utils.checkNotNull(netOtherIncome, "netOtherIncome"); + this.netOtherIncome = netOtherIncome; + return this; + } + + /** + * Net profit of the company in the given date range. + */ + public ProfitAndLossReport withNetProfit(double netProfit) { + Utils.checkNotNull(netProfit, "netProfit"); + this.netProfit = netProfit; + return this; + } + + public ProfitAndLossReport withOtherExpenses(ReportLineInput otherExpenses) { + Utils.checkNotNull(otherExpenses, "otherExpenses"); + this.otherExpenses = Optional.ofNullable(otherExpenses); + return this; + } + + public ProfitAndLossReport withOtherExpenses(Optional otherExpenses) { + Utils.checkNotNull(otherExpenses, "otherExpenses"); + this.otherExpenses = otherExpenses; + return this; + } + + public ProfitAndLossReport withOtherIncome(ReportLineInput otherIncome) { + Utils.checkNotNull(otherIncome, "otherIncome"); + this.otherIncome = Optional.ofNullable(otherIncome); + return this; + } + + public ProfitAndLossReport withOtherIncome(Optional otherIncome) { + Utils.checkNotNull(otherIncome, "otherIncome"); + this.otherIncome = otherIncome; + 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 ProfitAndLossReport withToDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 ProfitAndLossReport withToDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfitAndLossReport other = (ProfitAndLossReport) o; + return + java.util.Objects.deepEquals(this.costOfSales, other.costOfSales) && + java.util.Objects.deepEquals(this.expenses, other.expenses) && + java.util.Objects.deepEquals(this.fromDate, other.fromDate) && + java.util.Objects.deepEquals(this.grossProfit, other.grossProfit) && + java.util.Objects.deepEquals(this.income, other.income) && + java.util.Objects.deepEquals(this.netOperatingProfit, other.netOperatingProfit) && + java.util.Objects.deepEquals(this.netOtherIncome, other.netOtherIncome) && + java.util.Objects.deepEquals(this.netProfit, other.netProfit) && + java.util.Objects.deepEquals(this.otherExpenses, other.otherExpenses) && + java.util.Objects.deepEquals(this.otherIncome, other.otherIncome) && + java.util.Objects.deepEquals(this.toDate, other.toDate); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + costOfSales, + expenses, + fromDate, + grossProfit, + income, + netOperatingProfit, + netOtherIncome, + netProfit, + otherExpenses, + otherIncome, + toDate); + } + + @Override + public String toString() { + return Utils.toString(ProfitAndLossReport.class, + "costOfSales", costOfSales, + "expenses", expenses, + "fromDate", fromDate, + "grossProfit", grossProfit, + "income", income, + "netOperatingProfit", netOperatingProfit, + "netOtherIncome", netOtherIncome, + "netProfit", netProfit, + "otherExpenses", otherExpenses, + "otherIncome", otherIncome, + "toDate", toDate); + } + + public final static class Builder { + + private Optional costOfSales = Optional.empty(); + + private Optional expenses = Optional.empty(); + + private Optional fromDate = Optional.empty(); + + private Double grossProfit; + + private Optional income = Optional.empty(); + + private Double netOperatingProfit; + + private Double netOtherIncome; + + private Double netProfit; + + private Optional otherExpenses = Optional.empty(); + + private Optional otherIncome = Optional.empty(); + + private Optional toDate = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder costOfSales(ReportLineInput costOfSales) { + Utils.checkNotNull(costOfSales, "costOfSales"); + this.costOfSales = Optional.ofNullable(costOfSales); + return this; + } + + public Builder costOfSales(Optional costOfSales) { + Utils.checkNotNull(costOfSales, "costOfSales"); + this.costOfSales = costOfSales; + return this; + } + + public Builder expenses(ReportLineInput expenses) { + Utils.checkNotNull(expenses, "expenses"); + this.expenses = Optional.ofNullable(expenses); + return this; + } + + public Builder expenses(Optional expenses) { + Utils.checkNotNull(expenses, "expenses"); + this.expenses = expenses; + 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 fromDate(String fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = Optional.ofNullable(fromDate); + 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 fromDate(Optional fromDate) { + Utils.checkNotNull(fromDate, "fromDate"); + this.fromDate = fromDate; + return this; + } + + /** + * Gross profit of the company in the given date range. + */ + public Builder grossProfit(double grossProfit) { + Utils.checkNotNull(grossProfit, "grossProfit"); + this.grossProfit = grossProfit; + return this; + } + + public Builder income(ReportLineInput income) { + Utils.checkNotNull(income, "income"); + this.income = Optional.ofNullable(income); + return this; + } + + public Builder income(Optional income) { + Utils.checkNotNull(income, "income"); + this.income = income; + return this; + } + + /** + * Net operating profit of the company in the given date range. + */ + public Builder netOperatingProfit(double netOperatingProfit) { + Utils.checkNotNull(netOperatingProfit, "netOperatingProfit"); + this.netOperatingProfit = netOperatingProfit; + return this; + } + + /** + * Net other income of the company in the given date range. + */ + public Builder netOtherIncome(double netOtherIncome) { + Utils.checkNotNull(netOtherIncome, "netOtherIncome"); + this.netOtherIncome = netOtherIncome; + return this; + } + + /** + * Net profit of the company in the given date range. + */ + public Builder netProfit(double netProfit) { + Utils.checkNotNull(netProfit, "netProfit"); + this.netProfit = netProfit; + return this; + } + + public Builder otherExpenses(ReportLineInput otherExpenses) { + Utils.checkNotNull(otherExpenses, "otherExpenses"); + this.otherExpenses = Optional.ofNullable(otherExpenses); + return this; + } + + public Builder otherExpenses(Optional otherExpenses) { + Utils.checkNotNull(otherExpenses, "otherExpenses"); + this.otherExpenses = otherExpenses; + return this; + } + + public Builder otherIncome(ReportLineInput otherIncome) { + Utils.checkNotNull(otherIncome, "otherIncome"); + this.otherIncome = Optional.ofNullable(otherIncome); + return this; + } + + public Builder otherIncome(Optional otherIncome) { + Utils.checkNotNull(otherIncome, "otherIncome"); + this.otherIncome = otherIncome; + 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 toDate(String toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = Optional.ofNullable(toDate); + 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 toDate(Optional toDate) { + Utils.checkNotNull(toDate, "toDate"); + this.toDate = toDate; + return this; + } + + public ProfitAndLossReport build() { + return new ProfitAndLossReport( + costOfSales, + expenses, + fromDate, + grossProfit, + income, + netOperatingProfit, + netOtherIncome, + netProfit, + otherExpenses, + otherIncome, + toDate); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ProjectRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ProjectRef.java new file mode 100644 index 00000000..7bb847b5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ProjectRef.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ProjectRef { + + /** + * Unique identifier to the project reference. + */ + @JsonProperty("id") + private String id; + + /** + * The project's name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public ProjectRef( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * Unique identifier to the project reference. + */ + public String id() { + return id; + } + + /** + * The project's name. + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier to the project reference. + */ + public ProjectRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The project's name. + */ + public ProjectRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The project's name. + */ + public ProjectRef withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectRef other = (ProjectRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(ProjectRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier to the project reference. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The project's name. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The project's name. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public ProjectRef build() { + return new ProjectRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PropertieItemRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PropertieItemRef.java new file mode 100644 index 00000000..4912b78c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PropertieItemRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * PropertieItemRef - Reference to the item the line is linked to. + */ + +public class PropertieItemRef { + + /** + * Unique identifier for the item in the accounting platform. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the item in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public PropertieItemRef( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public String id() { + return id; + } + + /** + * Name of the item in the accounting platform. + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public PropertieItemRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public PropertieItemRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public PropertieItemRef withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertieItemRef other = (PropertieItemRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(PropertieItemRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for the item in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the item in the accounting platform. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public PropertieItemRef build() { + return new PropertieItemRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperation.java new file mode 100644 index 00000000..d673da7c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperation.java @@ -0,0 +1,779 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * PullOperation - Information about a queued, in progress or completed pull operation. + * *Formally called `dataset`* + */ + +public class PullOperation { + + /** + * Unique identifier of the company associated to this pull operation. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completed") + private Optional completed; + + /** + * Unique identifier of the connection associated to this pull operation. + */ + @JsonProperty("connectionId") + private String connectionId; + + /** + * The data type you are requesting in a pull operation. + */ + @JsonProperty("dataType") + private String dataType; + + /** + * A message about a transient or persistent error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * Unique identifier of the pull operation. + */ + @JsonProperty("id") + private String id; + + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + */ + @JsonProperty("isCompleted") + private boolean isCompleted; + + /** + * `True` if the pull operation entered an error state. + */ + @JsonProperty("isErrored") + private boolean isErrored; + + /** + * An integer signifying the progress of the pull operation. + */ + @JsonProperty("progress") + private long progress; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requested") + private String requested; + + /** + * The current status of the pull operation. + */ + @JsonProperty("status") + private PullOperationStatus status; + + /** + * Additional information about the dataset status. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("statusDescription") + private JsonNullable statusDescription; + + public PullOperation( + @JsonProperty("companyId") String companyId, + @JsonProperty("completed") Optional completed, + @JsonProperty("connectionId") String connectionId, + @JsonProperty("dataType") String dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("id") String id, + @JsonProperty("isCompleted") boolean isCompleted, + @JsonProperty("isErrored") boolean isErrored, + @JsonProperty("progress") long progress, + @JsonProperty("requested") String requested, + @JsonProperty("status") PullOperationStatus status, + @JsonProperty("statusDescription") JsonNullable statusDescription) { + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completed, "completed"); + Utils.checkNotNull(connectionId, "connectionId"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(isCompleted, "isCompleted"); + Utils.checkNotNull(isErrored, "isErrored"); + Utils.checkNotNull(progress, "progress"); + Utils.checkNotNull(requested, "requested"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusDescription, "statusDescription"); + this.companyId = companyId; + this.completed = completed; + this.connectionId = connectionId; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.id = id; + this.isCompleted = isCompleted; + this.isErrored = isErrored; + this.progress = progress; + this.requested = requested; + this.status = status; + this.statusDescription = statusDescription; + } + + /** + * Unique identifier of the company associated to this pull operation. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completed() { + return completed; + } + + /** + * Unique identifier of the connection associated to this pull operation. + */ + public String connectionId() { + return connectionId; + } + + /** + * The data type you are requesting in a pull operation. + */ + public String dataType() { + return dataType; + } + + /** + * A message about a transient or persistent error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * Unique identifier of the pull operation. + */ + public String id() { + return id; + } + + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + */ + public boolean isCompleted() { + return isCompleted; + } + + /** + * `True` if the pull operation entered an error state. + */ + public boolean isErrored() { + return isErrored; + } + + /** + * An integer signifying the progress of the pull operation. + */ + public long progress() { + return progress; + } + + /** + * 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 String requested() { + return requested; + } + + /** + * The current status of the pull operation. + */ + public PullOperationStatus status() { + return status; + } + + /** + * Additional information about the dataset status. + */ + public JsonNullable statusDescription() { + return statusDescription; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier of the company associated to this pull operation. + */ + public PullOperation withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 PullOperation withCompleted(String completed) { + Utils.checkNotNull(completed, "completed"); + this.completed = Optional.ofNullable(completed); + 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 PullOperation withCompleted(Optional completed) { + Utils.checkNotNull(completed, "completed"); + this.completed = completed; + return this; + } + + /** + * Unique identifier of the connection associated to this pull operation. + */ + public PullOperation withConnectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The data type you are requesting in a pull operation. + */ + public PullOperation withDataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about a transient or persistent error. + */ + public PullOperation withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about a transient or persistent error. + */ + public PullOperation withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Unique identifier of the pull operation. + */ + public PullOperation withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + */ + public PullOperation withIsCompleted(boolean isCompleted) { + Utils.checkNotNull(isCompleted, "isCompleted"); + this.isCompleted = isCompleted; + return this; + } + + /** + * `True` if the pull operation entered an error state. + */ + public PullOperation withIsErrored(boolean isErrored) { + Utils.checkNotNull(isErrored, "isErrored"); + this.isErrored = isErrored; + return this; + } + + /** + * An integer signifying the progress of the pull operation. + */ + public PullOperation withProgress(long progress) { + Utils.checkNotNull(progress, "progress"); + this.progress = progress; + 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 PullOperation withRequested(String requested) { + Utils.checkNotNull(requested, "requested"); + this.requested = requested; + return this; + } + + /** + * The current status of the pull operation. + */ + public PullOperation withStatus(PullOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Additional information about the dataset status. + */ + public PullOperation withStatusDescription(String statusDescription) { + Utils.checkNotNull(statusDescription, "statusDescription"); + this.statusDescription = JsonNullable.of(statusDescription); + return this; + } + + /** + * Additional information about the dataset status. + */ + public PullOperation withStatusDescription(JsonNullable statusDescription) { + Utils.checkNotNull(statusDescription, "statusDescription"); + this.statusDescription = statusDescription; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullOperation other = (PullOperation) o; + return + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completed, other.completed) && + java.util.Objects.deepEquals(this.connectionId, other.connectionId) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.isCompleted, other.isCompleted) && + java.util.Objects.deepEquals(this.isErrored, other.isErrored) && + java.util.Objects.deepEquals(this.progress, other.progress) && + java.util.Objects.deepEquals(this.requested, other.requested) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusDescription, other.statusDescription); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyId, + completed, + connectionId, + dataType, + errorMessage, + id, + isCompleted, + isErrored, + progress, + requested, + status, + statusDescription); + } + + @Override + public String toString() { + return Utils.toString(PullOperation.class, + "companyId", companyId, + "completed", completed, + "connectionId", connectionId, + "dataType", dataType, + "errorMessage", errorMessage, + "id", id, + "isCompleted", isCompleted, + "isErrored", isErrored, + "progress", progress, + "requested", requested, + "status", status, + "statusDescription", statusDescription); + } + + public final static class Builder { + + private String companyId; + + private Optional completed = Optional.empty(); + + private String connectionId; + + private String dataType; + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String id; + + private Boolean isCompleted; + + private Boolean isErrored; + + private Long progress; + + private String requested; + + private PullOperationStatus status; + + private JsonNullable statusDescription = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier of the company associated to this pull operation. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completed(String completed) { + Utils.checkNotNull(completed, "completed"); + this.completed = Optional.ofNullable(completed); + 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 completed(Optional completed) { + Utils.checkNotNull(completed, "completed"); + this.completed = completed; + return this; + } + + /** + * Unique identifier of the connection associated to this pull operation. + */ + public Builder connectionId(String connectionId) { + Utils.checkNotNull(connectionId, "connectionId"); + this.connectionId = connectionId; + return this; + } + + /** + * The data type you are requesting in a pull operation. + */ + public Builder dataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about a transient or persistent error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about a transient or persistent error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * Unique identifier of the pull operation. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. + */ + public Builder isCompleted(boolean isCompleted) { + Utils.checkNotNull(isCompleted, "isCompleted"); + this.isCompleted = isCompleted; + return this; + } + + /** + * `True` if the pull operation entered an error state. + */ + public Builder isErrored(boolean isErrored) { + Utils.checkNotNull(isErrored, "isErrored"); + this.isErrored = isErrored; + return this; + } + + /** + * An integer signifying the progress of the pull operation. + */ + public Builder progress(long progress) { + Utils.checkNotNull(progress, "progress"); + this.progress = progress; + 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 requested(String requested) { + Utils.checkNotNull(requested, "requested"); + this.requested = requested; + return this; + } + + /** + * The current status of the pull operation. + */ + public Builder status(PullOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Additional information about the dataset status. + */ + public Builder statusDescription(String statusDescription) { + Utils.checkNotNull(statusDescription, "statusDescription"); + this.statusDescription = JsonNullable.of(statusDescription); + return this; + } + + /** + * Additional information about the dataset status. + */ + public Builder statusDescription(JsonNullable statusDescription) { + Utils.checkNotNull(statusDescription, "statusDescription"); + this.statusDescription = statusDescription; + return this; + } + + public PullOperation build() { + return new PullOperation( + companyId, + completed, + connectionId, + dataType, + errorMessage, + id, + isCompleted, + isErrored, + progress, + requested, + status, + statusDescription); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperationStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperationStatus.java new file mode 100644 index 00000000..569396d9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperationStatus.java @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PullOperationStatus - The current status of the pull operation. + */ +public enum PullOperationStatus { + INITIAL("Initial"), + QUEUED("Queued"), + FETCHING("Fetching"), + MAP_QUEUED("MapQueued"), + MAPPING("Mapping"), + COMPLETE("Complete"), + FETCH_ERROR("FetchError"), + MAP_ERROR("MapError"), + INTERNAL_ERROR("InternalError"), + PROCESSING_QUEUED("ProcessingQueued"), + PROCESSING("Processing"), + PROCESSING_ERROR("ProcessingError"), + VALIDATION_QUEUED("ValidationQueued"), + VALIDATING("Validating"), + VALIDATION_ERROR("ValidationError"), + AUTH_ERROR("AuthError"), + CANCELLED("Cancelled"), + ROUTING("Routing"), + ROUTING_ERROR("RoutingError"), + NOT_SUPPORTED("NotSupported"), + RATE_LIMIT_ERROR("RateLimitError"), + PERMISSIONS_ERROR("PermissionsError"), + PREREQUISITE_NOT_MET("PrerequisiteNotMet"); + + @JsonValue + private final String value; + + private PullOperationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperations.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperations.java new file mode 100644 index 00000000..0cae69e3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PullOperations.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class PullOperations { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public PullOperations( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public PullOperations withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public PullOperations withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public PullOperations withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public PullOperations withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public PullOperations withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public PullOperations withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullOperations other = (PullOperations) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(PullOperations.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public PullOperations build() { + return new PullOperations( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PurchaseOrderReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PurchaseOrderReference.java new file mode 100644 index 00000000..c9db800e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PurchaseOrderReference.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PurchaseOrderReference { + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("purchaseOrderNumber") + private JsonNullable purchaseOrderNumber; + + public PurchaseOrderReference( + @JsonProperty("id") Optional id, + @JsonProperty("purchaseOrderNumber") JsonNullable purchaseOrderNumber) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(purchaseOrderNumber, "purchaseOrderNumber"); + this.id = id; + this.purchaseOrderNumber = purchaseOrderNumber; + } + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + public JsonNullable purchaseOrderNumber() { + return purchaseOrderNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + public PurchaseOrderReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + public PurchaseOrderReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + public PurchaseOrderReference withPurchaseOrderNumber(String purchaseOrderNumber) { + Utils.checkNotNull(purchaseOrderNumber, "purchaseOrderNumber"); + this.purchaseOrderNumber = JsonNullable.of(purchaseOrderNumber); + return this; + } + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + public PurchaseOrderReference withPurchaseOrderNumber(JsonNullable purchaseOrderNumber) { + Utils.checkNotNull(purchaseOrderNumber, "purchaseOrderNumber"); + this.purchaseOrderNumber = purchaseOrderNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PurchaseOrderReference other = (PurchaseOrderReference) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.purchaseOrderNumber, other.purchaseOrderNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + purchaseOrderNumber); + } + + @Override + public String toString() { + return Utils.toString(PurchaseOrderReference.class, + "id", id, + "purchaseOrderNumber", purchaseOrderNumber); + } + + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable purchaseOrderNumber = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Identifier for the purchase order, unique for the company in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + public Builder purchaseOrderNumber(String purchaseOrderNumber) { + Utils.checkNotNull(purchaseOrderNumber, "purchaseOrderNumber"); + this.purchaseOrderNumber = JsonNullable.of(purchaseOrderNumber); + return this; + } + + /** + * Friendly reference for the purchase order, commonly generated by the accounting platform. + */ + public Builder purchaseOrderNumber(JsonNullable purchaseOrderNumber) { + Utils.checkNotNull(purchaseOrderNumber, "purchaseOrderNumber"); + this.purchaseOrderNumber = purchaseOrderNumber; + return this; + } + + public PurchaseOrderReference build() { + return new PurchaseOrderReference( + id, + purchaseOrderNumber); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushChangeType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushChangeType.java new file mode 100644 index 00000000..d4a6a184 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushChangeType.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PushChangeType - Type of change being applied to record in third party platform. + */ +public enum PushChangeType { + UNKNOWN("Unknown"), + CREATED("Created"), + MODIFIED("Modified"), + DELETED("Deleted"), + ATTACHMENT_UPLOADED("AttachmentUploaded"); + + @JsonValue + private final String value; + + private PushChangeType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushFieldValidation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushFieldValidation.java new file mode 100644 index 00000000..009e1201 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushFieldValidation.java @@ -0,0 +1,216 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushFieldValidation { + + /** + * Details on the validation issue. + */ + @JsonProperty("details") + private String details; + + /** + * Field name that resulted in the validation issue. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("field") + private Optional field; + + /** + * Unique reference identifier for the validation issue. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("ref") + private JsonNullable ref; + + public PushFieldValidation( + @JsonProperty("details") String details, + @JsonProperty("field") Optional field, + @JsonProperty("ref") JsonNullable ref) { + Utils.checkNotNull(details, "details"); + Utils.checkNotNull(field, "field"); + Utils.checkNotNull(ref, "ref"); + this.details = details; + this.field = field; + this.ref = ref; + } + + /** + * Details on the validation issue. + */ + public String details() { + return details; + } + + /** + * Field name that resulted in the validation issue. + */ + public Optional field() { + return field; + } + + /** + * Unique reference identifier for the validation issue. + */ + public JsonNullable ref() { + return ref; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Details on the validation issue. + */ + public PushFieldValidation withDetails(String details) { + Utils.checkNotNull(details, "details"); + this.details = details; + return this; + } + + /** + * Field name that resulted in the validation issue. + */ + public PushFieldValidation withField(String field) { + Utils.checkNotNull(field, "field"); + this.field = Optional.ofNullable(field); + return this; + } + + /** + * Field name that resulted in the validation issue. + */ + public PushFieldValidation withField(Optional field) { + Utils.checkNotNull(field, "field"); + this.field = field; + return this; + } + + /** + * Unique reference identifier for the validation issue. + */ + public PushFieldValidation withRef(String ref) { + Utils.checkNotNull(ref, "ref"); + this.ref = JsonNullable.of(ref); + return this; + } + + /** + * Unique reference identifier for the validation issue. + */ + public PushFieldValidation withRef(JsonNullable ref) { + Utils.checkNotNull(ref, "ref"); + this.ref = ref; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushFieldValidation other = (PushFieldValidation) o; + return + java.util.Objects.deepEquals(this.details, other.details) && + java.util.Objects.deepEquals(this.field, other.field) && + java.util.Objects.deepEquals(this.ref, other.ref); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + details, + field, + ref); + } + + @Override + public String toString() { + return Utils.toString(PushFieldValidation.class, + "details", details, + "field", field, + "ref", ref); + } + + public final static class Builder { + + private String details; + + private Optional field = Optional.empty(); + + private JsonNullable ref = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Details on the validation issue. + */ + public Builder details(String details) { + Utils.checkNotNull(details, "details"); + this.details = details; + return this; + } + + /** + * Field name that resulted in the validation issue. + */ + public Builder field(String field) { + Utils.checkNotNull(field, "field"); + this.field = Optional.ofNullable(field); + return this; + } + + /** + * Field name that resulted in the validation issue. + */ + public Builder field(Optional field) { + Utils.checkNotNull(field, "field"); + this.field = field; + return this; + } + + /** + * Unique reference identifier for the validation issue. + */ + public Builder ref(String ref) { + Utils.checkNotNull(ref, "ref"); + this.ref = JsonNullable.of(ref); + return this; + } + + /** + * Unique reference identifier for the validation issue. + */ + public Builder ref(JsonNullable ref) { + Utils.checkNotNull(ref, "ref"); + this.ref = ref; + return this; + } + + public PushFieldValidation build() { + return new PushFieldValidation( + details, + field, + ref); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperation.java new file mode 100644 index 00000000..8141db01 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperation.java @@ -0,0 +1,904 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushOperation { + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("changes") + private JsonNullable> changes; + + /** + * Unique identifier for your SMB in Codat. + */ + @JsonProperty("companyId") + private String companyId; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("completedOnUtc") + private Optional completedOnUtc; + + /** + * Unique identifier for a company's data connection. + */ + @JsonProperty("dataConnectionKey") + private String dataConnectionKey; + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * A message about the error. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errorMessage") + private JsonNullable errorMessage; + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + @JsonProperty("pushOperationKey") + private String pushOperationKey; + + /** + * In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example: + * + * ``` + * 2020-10-08T22:40:50Z + * 2021-01-01T00:00:00 + * ``` + * + * + * + * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + * + * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + * - Unqualified local time: `2021-11-15T01:00:00` + * - UTC time offsets: `2021-11-15T01:00:00-05:00` + * + * > Time zones + * > + * > Not all dates from Codat will contain information about time zones. + * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + */ + @JsonProperty("requestedOnUtc") + private String requestedOnUtc; + + /** + * The current status of the push operation. + */ + @JsonProperty("status") + private PushOperationStatus status; + + /** + * Push status code. + */ + @JsonProperty("statusCode") + private long statusCode; + + /** + * Number of minutes the push operation must complete within before it times out. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInMinutes") + private JsonNullable timeoutInMinutes; + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("timeoutInSeconds") + @Deprecated + private JsonNullable timeoutInSeconds; + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public PushOperation( + @JsonProperty("changes") JsonNullable> changes, + @JsonProperty("companyId") String companyId, + @JsonProperty("completedOnUtc") Optional completedOnUtc, + @JsonProperty("dataConnectionKey") String dataConnectionKey, + @JsonProperty("dataType") Optional dataType, + @JsonProperty("errorMessage") JsonNullable errorMessage, + @JsonProperty("pushOperationKey") String pushOperationKey, + @JsonProperty("requestedOnUtc") String requestedOnUtc, + @JsonProperty("status") PushOperationStatus status, + @JsonProperty("statusCode") long statusCode, + @JsonProperty("timeoutInMinutes") JsonNullable timeoutInMinutes, + @JsonProperty("timeoutInSeconds") JsonNullable timeoutInSeconds, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(changes, "changes"); + Utils.checkNotNull(companyId, "companyId"); + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(errorMessage, "errorMessage"); + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + Utils.checkNotNull(validation, "validation"); + this.changes = changes; + this.companyId = companyId; + this.completedOnUtc = completedOnUtc; + this.dataConnectionKey = dataConnectionKey; + this.dataType = dataType; + this.errorMessage = errorMessage; + this.pushOperationKey = pushOperationKey; + this.requestedOnUtc = requestedOnUtc; + this.status = status; + this.statusCode = statusCode; + this.timeoutInMinutes = timeoutInMinutes; + this.timeoutInSeconds = timeoutInSeconds; + this.validation = validation; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public JsonNullable> changes() { + return changes; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public String companyId() { + return companyId; + } + + /** + * 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 Optional completedOnUtc() { + return completedOnUtc; + } + + /** + * Unique identifier for a company's data connection. + */ + public String dataConnectionKey() { + return dataConnectionKey; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * A message about the error. + */ + public JsonNullable errorMessage() { + return errorMessage; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public String pushOperationKey() { + return pushOperationKey; + } + + /** + * 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 String requestedOnUtc() { + return requestedOnUtc; + } + + /** + * The current status of the push operation. + */ + public PushOperationStatus status() { + return status; + } + + /** + * Push status code. + */ + public long statusCode() { + return statusCode; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public JsonNullable timeoutInMinutes() { + return timeoutInMinutes; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public JsonNullable timeoutInSeconds() { + return timeoutInSeconds; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public PushOperation withChanges(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public PushOperation withChanges(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public PushOperation withCompanyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 PushOperation withCompletedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 PushOperation withCompletedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public PushOperation withDataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public PushOperation withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public PushOperation withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public PushOperation withErrorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public PushOperation withErrorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public PushOperation withPushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 PushOperation withRequestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public PushOperation withStatus(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public PushOperation withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public PushOperation withTimeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public PushOperation withTimeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public PushOperation withTimeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public PushOperation withTimeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public PushOperation withValidation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public PushOperation withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOperation other = (PushOperation) o; + return + java.util.Objects.deepEquals(this.changes, other.changes) && + java.util.Objects.deepEquals(this.companyId, other.companyId) && + java.util.Objects.deepEquals(this.completedOnUtc, other.completedOnUtc) && + java.util.Objects.deepEquals(this.dataConnectionKey, other.dataConnectionKey) && + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.errorMessage, other.errorMessage) && + java.util.Objects.deepEquals(this.pushOperationKey, other.pushOperationKey) && + java.util.Objects.deepEquals(this.requestedOnUtc, other.requestedOnUtc) && + java.util.Objects.deepEquals(this.status, other.status) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.timeoutInMinutes, other.timeoutInMinutes) && + java.util.Objects.deepEquals(this.timeoutInSeconds, other.timeoutInSeconds) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + changes, + companyId, + completedOnUtc, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + + @Override + public String toString() { + return Utils.toString(PushOperation.class, + "changes", changes, + "companyId", companyId, + "completedOnUtc", completedOnUtc, + "dataConnectionKey", dataConnectionKey, + "dataType", dataType, + "errorMessage", errorMessage, + "pushOperationKey", pushOperationKey, + "requestedOnUtc", requestedOnUtc, + "status", status, + "statusCode", statusCode, + "timeoutInMinutes", timeoutInMinutes, + "timeoutInSeconds", timeoutInSeconds, + "validation", validation); + } + + public final static class Builder { + + private JsonNullable> changes = JsonNullable.undefined(); + + private String companyId; + + private Optional completedOnUtc = Optional.empty(); + + private String dataConnectionKey; + + private Optional dataType = Optional.empty(); + + private JsonNullable errorMessage = JsonNullable.undefined(); + + private String pushOperationKey; + + private String requestedOnUtc; + + private PushOperationStatus status; + + private Long statusCode; + + private JsonNullable timeoutInMinutes = JsonNullable.undefined(); + + @Deprecated + private JsonNullable timeoutInSeconds = JsonNullable.undefined(); + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(java.util.List changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = JsonNullable.of(changes); + return this; + } + + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + */ + public Builder changes(JsonNullable> changes) { + Utils.checkNotNull(changes, "changes"); + this.changes = changes; + return this; + } + + /** + * Unique identifier for your SMB in Codat. + */ + public Builder companyId(String companyId) { + Utils.checkNotNull(companyId, "companyId"); + this.companyId = companyId; + 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 completedOnUtc(String completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = Optional.ofNullable(completedOnUtc); + 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 completedOnUtc(Optional completedOnUtc) { + Utils.checkNotNull(completedOnUtc, "completedOnUtc"); + this.completedOnUtc = completedOnUtc; + return this; + } + + /** + * Unique identifier for a company's data connection. + */ + public Builder dataConnectionKey(String dataConnectionKey) { + Utils.checkNotNull(dataConnectionKey, "dataConnectionKey"); + this.dataConnectionKey = dataConnectionKey; + return this; + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(String errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = JsonNullable.of(errorMessage); + return this; + } + + /** + * A message about the error. + */ + public Builder errorMessage(JsonNullable errorMessage) { + Utils.checkNotNull(errorMessage, "errorMessage"); + this.errorMessage = errorMessage; + return this; + } + + /** + * A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + */ + public Builder pushOperationKey(String pushOperationKey) { + Utils.checkNotNull(pushOperationKey, "pushOperationKey"); + this.pushOperationKey = pushOperationKey; + 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 requestedOnUtc(String requestedOnUtc) { + Utils.checkNotNull(requestedOnUtc, "requestedOnUtc"); + this.requestedOnUtc = requestedOnUtc; + return this; + } + + /** + * The current status of the push operation. + */ + public Builder status(PushOperationStatus status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Push status code. + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(int timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = JsonNullable.of(timeoutInMinutes); + return this; + } + + /** + * Number of minutes the push operation must complete within before it times out. + */ + public Builder timeoutInMinutes(JsonNullable timeoutInMinutes) { + Utils.checkNotNull(timeoutInMinutes, "timeoutInMinutes"); + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(int timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = JsonNullable.of(timeoutInSeconds); + return this; + } + + /** + * Number of seconds the push operation must complete within before it times out. + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + @Deprecated + public Builder timeoutInSeconds(JsonNullable timeoutInSeconds) { + Utils.checkNotNull(timeoutInSeconds, "timeoutInSeconds"); + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Validation validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + /** + * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public PushOperation build() { + return new PushOperation( + changes, + companyId, + completedOnUtc, + dataConnectionKey, + dataType, + errorMessage, + pushOperationKey, + requestedOnUtc, + status, + statusCode, + timeoutInMinutes, + timeoutInSeconds, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationChange.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationChange.java new file mode 100644 index 00000000..5a88504c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationChange.java @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushOperationChange { + + /** + * Unique identifier for the attachment created otherwise null. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("attachmentId") + private JsonNullable attachmentId; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("recordRef") + private Optional recordRef; + + /** + * Type of change being applied to record in third party platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public PushOperationChange( + @JsonProperty("attachmentId") JsonNullable attachmentId, + @JsonProperty("recordRef") Optional recordRef, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(attachmentId, "attachmentId"); + Utils.checkNotNull(recordRef, "recordRef"); + Utils.checkNotNull(type, "type"); + this.attachmentId = attachmentId; + this.recordRef = recordRef; + this.type = type; + } + + /** + * Unique identifier for the attachment created otherwise null. + */ + public JsonNullable attachmentId() { + return attachmentId; + } + + public Optional recordRef() { + return recordRef; + } + + /** + * Type of change being applied to record in third party platform. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for the attachment created otherwise null. + */ + public PushOperationChange withAttachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = JsonNullable.of(attachmentId); + return this; + } + + /** + * Unique identifier for the attachment created otherwise null. + */ + public PushOperationChange withAttachmentId(JsonNullable attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + public PushOperationChange withRecordRef(PushOperationRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + public PushOperationChange withRecordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + /** + * Type of change being applied to record in third party platform. + */ + public PushOperationChange withType(PushChangeType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of change being applied to record in third party platform. + */ + public PushOperationChange withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOperationChange other = (PushOperationChange) o; + return + java.util.Objects.deepEquals(this.attachmentId, other.attachmentId) && + java.util.Objects.deepEquals(this.recordRef, other.recordRef) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + attachmentId, + recordRef, + type); + } + + @Override + public String toString() { + return Utils.toString(PushOperationChange.class, + "attachmentId", attachmentId, + "recordRef", recordRef, + "type", type); + } + + public final static class Builder { + + private JsonNullable attachmentId = JsonNullable.undefined(); + + private Optional recordRef = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for the attachment created otherwise null. + */ + public Builder attachmentId(String attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = JsonNullable.of(attachmentId); + return this; + } + + /** + * Unique identifier for the attachment created otherwise null. + */ + public Builder attachmentId(JsonNullable attachmentId) { + Utils.checkNotNull(attachmentId, "attachmentId"); + this.attachmentId = attachmentId; + return this; + } + + public Builder recordRef(PushOperationRef recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = Optional.ofNullable(recordRef); + return this; + } + + public Builder recordRef(Optional recordRef) { + Utils.checkNotNull(recordRef, "recordRef"); + this.recordRef = recordRef; + return this; + } + + /** + * Type of change being applied to record in third party platform. + */ + public Builder type(PushChangeType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * Type of change being applied to record in third party platform. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PushOperationChange build() { + return new PushOperationChange( + attachmentId, + recordRef, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationRef.java new file mode 100644 index 00000000..b0a9d180 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationRef.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class PushOperationRef { + + /** + * Available Data types + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * Unique identifier for a push operation. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public PushOperationRef( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Available Data types + */ + public Optional dataType() { + return dataType; + } + + /** + * Unique identifier for a push operation. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Available Data types + */ + public PushOperationRef withDataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public PushOperationRef withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a push operation. + */ + public PushOperationRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for a push operation. + */ + public PushOperationRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOperationRef other = (PushOperationRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(PushOperationRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Available Data types + */ + public Builder dataType(DataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Available Data types + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier for a push operation. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for a push operation. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public PushOperationRef build() { + return new PushOperationRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationStatus.java new file mode 100644 index 00000000..4fc3b176 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperationStatus.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PushOperationStatus - The current status of the push operation. + */ +public enum PushOperationStatus { + PENDING("Pending"), + FAILED("Failed"), + SUCCESS("Success"), + TIMED_OUT("TimedOut"); + + @JsonValue + private final String value; + + private PushOperationStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperations.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperations.java new file mode 100644 index 00000000..0300cf73 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOperations.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class PushOperations { + + @JsonProperty("_links") + private Links links; + + /** + * Current page number. + */ + @JsonProperty("pageNumber") + private long pageNumber; + + /** + * Number of items to return in results array. + */ + @JsonProperty("pageSize") + private long pageSize; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("results") + private Optional> results; + + /** + * Total number of items. + */ + @JsonProperty("totalResults") + private long totalResults; + + public PushOperations( + @JsonProperty("_links") Links links, + @JsonProperty("pageNumber") long pageNumber, + @JsonProperty("pageSize") long pageSize, + @JsonProperty("results") Optional> results, + @JsonProperty("totalResults") long totalResults) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(results, "results"); + Utils.checkNotNull(totalResults, "totalResults"); + this.links = links; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.results = results; + this.totalResults = totalResults; + } + + public Links links() { + return links; + } + + /** + * Current page number. + */ + public long pageNumber() { + return pageNumber; + } + + /** + * Number of items to return in results array. + */ + public long pageSize() { + return pageSize; + } + + public Optional> results() { + return results; + } + + /** + * Total number of items. + */ + public long totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + public PushOperations withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public PushOperations withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public PushOperations withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public PushOperations withResults(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public PushOperations withResults(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public PushOperations withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOperations other = (PushOperations) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.results, other.results) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + pageNumber, + pageSize, + results, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(PushOperations.class, + "links", links, + "pageNumber", pageNumber, + "pageSize", pageSize, + "results", results, + "totalResults", totalResults); + } + + public final static class Builder { + + private Links links; + + private Long pageNumber; + + private Long pageSize; + + private Optional> results = Optional.empty(); + + private Long totalResults; + + private Builder() { + // force use of static builder() method + } + + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Current page number. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * Number of items to return in results array. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + public Builder results(java.util.List results) { + Utils.checkNotNull(results, "results"); + this.results = Optional.ofNullable(results); + return this; + } + + public Builder results(Optional> results) { + Utils.checkNotNull(results, "results"); + this.results = results; + return this; + } + + /** + * Total number of items. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public PushOperations build() { + return new PushOperations( + links, + pageNumber, + pageSize, + results, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOption.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOption.java new file mode 100644 index 00000000..553c1989 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOption.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushOption { + + /** + * A description of the property. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * The property's display name. + */ + @JsonProperty("displayName") + private String displayName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("options") + private JsonNullable> options; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("properties") + private JsonNullable> properties; + + /** + * The property is required if `True`. + */ + @JsonProperty("required") + private boolean required; + + /** + * The option type. + */ + @JsonProperty("type") + private PushOptionType type; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public PushOption( + @JsonProperty("description") Optional description, + @JsonProperty("displayName") String displayName, + @JsonProperty("options") JsonNullable> options, + @JsonProperty("properties") JsonNullable> properties, + @JsonProperty("required") boolean required, + @JsonProperty("type") PushOptionType type, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(options, "options"); + Utils.checkNotNull(properties, "properties"); + Utils.checkNotNull(required, "required"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(validation, "validation"); + this.description = description; + this.displayName = displayName; + this.options = options; + this.properties = properties; + this.required = required; + this.type = type; + this.validation = validation; + } + + /** + * A description of the property. + */ + public Optional description() { + return description; + } + + /** + * The property's display name. + */ + public String displayName() { + return displayName; + } + + public JsonNullable> options() { + return options; + } + + public JsonNullable> properties() { + return properties; + } + + /** + * The property is required if `True`. + */ + public boolean required() { + return required; + } + + /** + * The option type. + */ + public PushOptionType type() { + return type; + } + + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A description of the property. + */ + public PushOption withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * A description of the property. + */ + public PushOption withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public PushOption withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public PushOption withOptions(java.util.List options) { + Utils.checkNotNull(options, "options"); + this.options = JsonNullable.of(options); + return this; + } + + public PushOption withOptions(JsonNullable> options) { + Utils.checkNotNull(options, "options"); + this.options = options; + return this; + } + + public PushOption withProperties(java.util.Map properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = JsonNullable.of(properties); + return this; + } + + public PushOption withProperties(JsonNullable> properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = properties; + return this; + } + + /** + * The property is required if `True`. + */ + public PushOption withRequired(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public PushOption withType(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PushOption withValidation(PushValidationInfo validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + public PushOption withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOption other = (PushOption) o; + return + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.options, other.options) && + java.util.Objects.deepEquals(this.properties, other.properties) && + java.util.Objects.deepEquals(this.required, other.required) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + description, + displayName, + options, + properties, + required, + type, + validation); + } + + @Override + public String toString() { + return Utils.toString(PushOption.class, + "description", description, + "displayName", displayName, + "options", options, + "properties", properties, + "required", required, + "type", type, + "validation", validation); + } + + public final static class Builder { + + private Optional description = Optional.empty(); + + private String displayName; + + private JsonNullable> options = JsonNullable.undefined(); + + private JsonNullable> properties = JsonNullable.undefined(); + + private Boolean required; + + private PushOptionType type; + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A description of the property. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * A description of the property. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public Builder options(java.util.List options) { + Utils.checkNotNull(options, "options"); + this.options = JsonNullable.of(options); + return this; + } + + public Builder options(JsonNullable> options) { + Utils.checkNotNull(options, "options"); + this.options = options; + return this; + } + + public Builder properties(java.util.Map properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = JsonNullable.of(properties); + return this; + } + + public Builder properties(JsonNullable> properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = properties; + return this; + } + + /** + * The property is required if `True`. + */ + public Builder required(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public Builder type(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder validation(PushValidationInfo validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public PushOption build() { + return new PushOption( + description, + displayName, + options, + properties, + required, + type, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionChoice.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionChoice.java new file mode 100644 index 00000000..ab8f3fe8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionChoice.java @@ -0,0 +1,352 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class PushOptionChoice { + + /** + * A description of the property. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * The property's display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("displayName") + private Optional displayName; + + /** + * The property is required if `True`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("required") + private Optional required; + + /** + * The option type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * Allowed value for field. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("value") + private Optional value; + + public PushOptionChoice( + @JsonProperty("description") Optional description, + @JsonProperty("displayName") Optional displayName, + @JsonProperty("required") Optional required, + @JsonProperty("type") Optional type, + @JsonProperty("value") Optional value) { + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(required, "required"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(value, "value"); + this.description = description; + this.displayName = displayName; + this.required = required; + this.type = type; + this.value = value; + } + + /** + * A description of the property. + */ + public Optional description() { + return description; + } + + /** + * The property's display name. + */ + public Optional displayName() { + return displayName; + } + + /** + * The property is required if `True`. + */ + public Optional required() { + return required; + } + + /** + * The option type. + */ + public Optional type() { + return type; + } + + /** + * Allowed value for field. + */ + public Optional value() { + return value; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A description of the property. + */ + public PushOptionChoice withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * A description of the property. + */ + public PushOptionChoice withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public PushOptionChoice withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The property's display name. + */ + public PushOptionChoice withDisplayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The property is required if `True`. + */ + public PushOptionChoice withRequired(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = Optional.ofNullable(required); + return this; + } + + /** + * The property is required if `True`. + */ + public PushOptionChoice withRequired(Optional required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public PushOptionChoice withType(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The option type. + */ + public PushOptionChoice withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * Allowed value for field. + */ + public PushOptionChoice withValue(String value) { + Utils.checkNotNull(value, "value"); + this.value = Optional.ofNullable(value); + return this; + } + + /** + * Allowed value for field. + */ + public PushOptionChoice withValue(Optional value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOptionChoice other = (PushOptionChoice) o; + return + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.required, other.required) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.value, other.value); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + description, + displayName, + required, + type, + value); + } + + @Override + public String toString() { + return Utils.toString(PushOptionChoice.class, + "description", description, + "displayName", displayName, + "required", required, + "type", type, + "value", value); + } + + public final static class Builder { + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional required = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional value = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A description of the property. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * A description of the property. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + * The property's display name. + */ + public Builder displayName(Optional displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * The property is required if `True`. + */ + public Builder required(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = Optional.ofNullable(required); + return this; + } + + /** + * The property is required if `True`. + */ + public Builder required(Optional required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public Builder type(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The option type. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * Allowed value for field. + */ + public Builder value(String value) { + Utils.checkNotNull(value, "value"); + this.value = Optional.ofNullable(value); + return this; + } + + /** + * Allowed value for field. + */ + public Builder value(Optional value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + public PushOptionChoice build() { + return new PushOptionChoice( + description, + displayName, + required, + type, + value); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionProperty.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionProperty.java new file mode 100644 index 00000000..d28fba75 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionProperty.java @@ -0,0 +1,341 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushOptionProperty { + + /** + * A description of the property. + */ + @JsonProperty("description") + private String description; + + /** + * The property's display name. + */ + @JsonProperty("displayName") + private String displayName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("options") + private JsonNullable> options; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("properties") + private JsonNullable> properties; + + /** + * The property is required if `True`. + */ + @JsonProperty("required") + private boolean required; + + /** + * The option type. + */ + @JsonProperty("type") + private PushOptionType type; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validation") + private Optional validation; + + public PushOptionProperty( + @JsonProperty("description") String description, + @JsonProperty("displayName") String displayName, + @JsonProperty("options") JsonNullable> options, + @JsonProperty("properties") JsonNullable> properties, + @JsonProperty("required") boolean required, + @JsonProperty("type") PushOptionType type, + @JsonProperty("validation") Optional validation) { + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(options, "options"); + Utils.checkNotNull(properties, "properties"); + Utils.checkNotNull(required, "required"); + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(validation, "validation"); + this.description = description; + this.displayName = displayName; + this.options = options; + this.properties = properties; + this.required = required; + this.type = type; + this.validation = validation; + } + + /** + * A description of the property. + */ + public String description() { + return description; + } + + /** + * The property's display name. + */ + public String displayName() { + return displayName; + } + + public JsonNullable> options() { + return options; + } + + public JsonNullable> properties() { + return properties; + } + + /** + * The property is required if `True`. + */ + public boolean required() { + return required; + } + + /** + * The option type. + */ + public PushOptionType type() { + return type; + } + + public Optional validation() { + return validation; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * A description of the property. + */ + public PushOptionProperty withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public PushOptionProperty withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public PushOptionProperty withOptions(java.util.List options) { + Utils.checkNotNull(options, "options"); + this.options = JsonNullable.of(options); + return this; + } + + public PushOptionProperty withOptions(JsonNullable> options) { + Utils.checkNotNull(options, "options"); + this.options = options; + return this; + } + + public PushOptionProperty withProperties(java.util.Map properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = JsonNullable.of(properties); + return this; + } + + public PushOptionProperty withProperties(JsonNullable> properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = properties; + return this; + } + + /** + * The property is required if `True`. + */ + public PushOptionProperty withRequired(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public PushOptionProperty withType(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public PushOptionProperty withValidation(PushValidationInfo validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + public PushOptionProperty withValidation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushOptionProperty other = (PushOptionProperty) o; + return + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.displayName, other.displayName) && + java.util.Objects.deepEquals(this.options, other.options) && + java.util.Objects.deepEquals(this.properties, other.properties) && + java.util.Objects.deepEquals(this.required, other.required) && + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.validation, other.validation); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + description, + displayName, + options, + properties, + required, + type, + validation); + } + + @Override + public String toString() { + return Utils.toString(PushOptionProperty.class, + "description", description, + "displayName", displayName, + "options", options, + "properties", properties, + "required", required, + "type", type, + "validation", validation); + } + + public final static class Builder { + + private String description; + + private String displayName; + + private JsonNullable> options = JsonNullable.undefined(); + + private JsonNullable> properties = JsonNullable.undefined(); + + private Boolean required; + + private PushOptionType type; + + private Optional validation = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * A description of the property. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The property's display name. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public Builder options(java.util.List options) { + Utils.checkNotNull(options, "options"); + this.options = JsonNullable.of(options); + return this; + } + + public Builder options(JsonNullable> options) { + Utils.checkNotNull(options, "options"); + this.options = options; + return this; + } + + public Builder properties(java.util.Map properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = JsonNullable.of(properties); + return this; + } + + public Builder properties(JsonNullable> properties) { + Utils.checkNotNull(properties, "properties"); + this.properties = properties; + return this; + } + + /** + * The property is required if `True`. + */ + public Builder required(boolean required) { + Utils.checkNotNull(required, "required"); + this.required = required; + return this; + } + + /** + * The option type. + */ + public Builder type(PushOptionType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public Builder validation(PushValidationInfo validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = Optional.ofNullable(validation); + return this; + } + + public Builder validation(Optional validation) { + Utils.checkNotNull(validation, "validation"); + this.validation = validation; + return this; + } + + public PushOptionProperty build() { + return new PushOptionProperty( + description, + displayName, + options, + properties, + required, + type, + validation); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionType.java new file mode 100644 index 00000000..248b387b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushOptionType.java @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * PushOptionType - The option type. + */ +public enum PushOptionType { + ARRAY("Array"), + OBJECT("Object"), + STRING("String"), + NUMBER("Number"), + BOOLEAN_("Boolean"), + DATE_TIME("DateTime"), + FILE("File"), + MULTI_PART("MultiPart"); + + @JsonValue + private final String value; + + private PushOptionType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/PushValidationInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/PushValidationInfo.java new file mode 100644 index 00000000..9b9e682c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/PushValidationInfo.java @@ -0,0 +1,139 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class PushValidationInfo { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("information") + private JsonNullable> information; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("warnings") + private JsonNullable> warnings; + + public PushValidationInfo( + @JsonProperty("information") JsonNullable> information, + @JsonProperty("warnings") JsonNullable> warnings) { + Utils.checkNotNull(information, "information"); + Utils.checkNotNull(warnings, "warnings"); + this.information = information; + this.warnings = warnings; + } + + public JsonNullable> information() { + return information; + } + + public JsonNullable> warnings() { + return warnings; + } + + public final static Builder builder() { + return new Builder(); + } + + public PushValidationInfo withInformation(java.util.List information) { + Utils.checkNotNull(information, "information"); + this.information = JsonNullable.of(information); + return this; + } + + public PushValidationInfo withInformation(JsonNullable> information) { + Utils.checkNotNull(information, "information"); + this.information = information; + return this; + } + + public PushValidationInfo withWarnings(java.util.List warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = JsonNullable.of(warnings); + return this; + } + + public PushValidationInfo withWarnings(JsonNullable> warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = warnings; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushValidationInfo other = (PushValidationInfo) o; + return + java.util.Objects.deepEquals(this.information, other.information) && + java.util.Objects.deepEquals(this.warnings, other.warnings); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + information, + warnings); + } + + @Override + public String toString() { + return Utils.toString(PushValidationInfo.class, + "information", information, + "warnings", warnings); + } + + public final static class Builder { + + private JsonNullable> information = JsonNullable.undefined(); + + private JsonNullable> warnings = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder information(java.util.List information) { + Utils.checkNotNull(information, "information"); + this.information = JsonNullable.of(information); + return this; + } + + public Builder information(JsonNullable> information) { + Utils.checkNotNull(information, "information"); + this.information = information; + return this; + } + + public Builder warnings(java.util.List warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = JsonNullable.of(warnings); + return this; + } + + public Builder warnings(JsonNullable> warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = warnings; + return this; + } + + public PushValidationInfo build() { + return new PushValidationInfo( + information, + warnings); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/RecordLineReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordLineReference.java new file mode 100644 index 00000000..13a6a876 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordLineReference.java @@ -0,0 +1,237 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * RecordLineReference - Reference to the purchase order line this line was generated from. + */ + +public class RecordLineReference { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Line number of the underlying record. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lineNumber") + private Optional lineNumber; + + public RecordLineReference( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id, + @JsonProperty("lineNumber") Optional lineNumber) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(lineNumber, "lineNumber"); + this.dataType = dataType; + this.id = id; + this.lineNumber = lineNumber; + } + + /** + * Allowed name of the 'dataType'. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record. + */ + public Optional id() { + return id; + } + + /** + * Line number of the underlying record. + */ + public Optional lineNumber() { + return lineNumber; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordLineReference withDataType(BillLineItemDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordLineReference withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record. + */ + public RecordLineReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record. + */ + public RecordLineReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Line number of the underlying record. + */ + public RecordLineReference withLineNumber(String lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = Optional.ofNullable(lineNumber); + return this; + } + + /** + * Line number of the underlying record. + */ + public RecordLineReference withLineNumber(Optional lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = lineNumber; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecordLineReference other = (RecordLineReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.lineNumber, other.lineNumber); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id, + lineNumber); + } + + @Override + public String toString() { + return Utils.toString(RecordLineReference.class, + "dataType", dataType, + "id", id, + "lineNumber", lineNumber); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional lineNumber = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(BillLineItemDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Line number of the underlying record. + */ + public Builder lineNumber(String lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = Optional.ofNullable(lineNumber); + return this; + } + + /** + * Line number of the underlying record. + */ + public Builder lineNumber(Optional lineNumber) { + Utils.checkNotNull(lineNumber, "lineNumber"); + this.lineNumber = lineNumber; + return this; + } + + public RecordLineReference build() { + return new RecordLineReference( + dataType, + id, + lineNumber); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/RecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordRef.java new file mode 100644 index 00000000..ddc1d12b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordRef.java @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * RecordRef - Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + +public class RecordRef { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record or data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public RecordRef( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record or data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordRef withDataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordRef withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public RecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public RecordRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecordRef other = (RecordRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(RecordRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public RecordRef build() { + return new RecordRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/RecordReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordReference.java new file mode 100644 index 00000000..0447fc99 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/RecordReference.java @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * RecordReference - Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + +public class RecordReference { + + /** + * Allowed name of the 'dataType'. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record or data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public RecordReference( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Allowed name of the 'dataType'. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record or data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordReference withDataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public RecordReference withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public RecordReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public RecordReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecordReference other = (RecordReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(RecordReference.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(String dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Allowed name of the 'dataType'. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public RecordReference build() { + return new RecordReference( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportBasis.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportBasis.java new file mode 100644 index 00000000..aa00f6e0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportBasis.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ReportBasis - Accounting method used when aggregating the report data. In this case, `Cash`. + */ +public enum ReportBasis { + UNKNOWN("Unknown"), + ACCRUAL("Accrual"), + CASH("Cash"); + + @JsonValue + private final String value; + + private ReportBasis(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportComponentMeasure.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportComponentMeasure.java new file mode 100644 index 00000000..6e11ac6c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportComponentMeasure.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ReportComponentMeasure { + + /** + * The measure's index. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("index") + private Optional index; + + /** + * The measure's display name. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("measureDisplayName") + private Optional measureDisplayName; + + /** + * The measure's value. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("value") + private Optional value; + + public ReportComponentMeasure( + @JsonProperty("index") Optional index, + @JsonProperty("measureDisplayName") Optional measureDisplayName, + @JsonProperty("value") Optional value) { + Utils.checkNotNull(index, "index"); + Utils.checkNotNull(measureDisplayName, "measureDisplayName"); + Utils.checkNotNull(value, "value"); + this.index = index; + this.measureDisplayName = measureDisplayName; + this.value = value; + } + + /** + * The measure's index. + */ + public Optional index() { + return index; + } + + /** + * The measure's display name. + */ + public Optional measureDisplayName() { + return measureDisplayName; + } + + /** + * The measure's value. + */ + public Optional value() { + return value; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The measure's index. + */ + public ReportComponentMeasure withIndex(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The measure's index. + */ + public ReportComponentMeasure withIndex(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The measure's display name. + */ + public ReportComponentMeasure withMeasureDisplayName(String measureDisplayName) { + Utils.checkNotNull(measureDisplayName, "measureDisplayName"); + this.measureDisplayName = Optional.ofNullable(measureDisplayName); + return this; + } + + /** + * The measure's display name. + */ + public ReportComponentMeasure withMeasureDisplayName(Optional measureDisplayName) { + Utils.checkNotNull(measureDisplayName, "measureDisplayName"); + this.measureDisplayName = measureDisplayName; + return this; + } + + /** + * The measure's value. + */ + public ReportComponentMeasure withValue(double value) { + Utils.checkNotNull(value, "value"); + this.value = Optional.ofNullable(value); + return this; + } + + /** + * The measure's value. + */ + public ReportComponentMeasure withValue(Optional value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportComponentMeasure other = (ReportComponentMeasure) o; + return + java.util.Objects.deepEquals(this.index, other.index) && + java.util.Objects.deepEquals(this.measureDisplayName, other.measureDisplayName) && + java.util.Objects.deepEquals(this.value, other.value); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + index, + measureDisplayName, + value); + } + + @Override + public String toString() { + return Utils.toString(ReportComponentMeasure.class, + "index", index, + "measureDisplayName", measureDisplayName, + "value", value); + } + + public final static class Builder { + + private Optional index = Optional.empty(); + + private Optional measureDisplayName = Optional.empty(); + + private Optional value = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The measure's index. + */ + public Builder index(long index) { + Utils.checkNotNull(index, "index"); + this.index = Optional.ofNullable(index); + return this; + } + + /** + * The measure's index. + */ + public Builder index(Optional index) { + Utils.checkNotNull(index, "index"); + this.index = index; + return this; + } + + /** + * The measure's display name. + */ + public Builder measureDisplayName(String measureDisplayName) { + Utils.checkNotNull(measureDisplayName, "measureDisplayName"); + this.measureDisplayName = Optional.ofNullable(measureDisplayName); + return this; + } + + /** + * The measure's display name. + */ + public Builder measureDisplayName(Optional measureDisplayName) { + Utils.checkNotNull(measureDisplayName, "measureDisplayName"); + this.measureDisplayName = measureDisplayName; + return this; + } + + /** + * The measure's value. + */ + public Builder value(double value) { + Utils.checkNotNull(value, "value"); + this.value = Optional.ofNullable(value); + return this; + } + + /** + * The measure's value. + */ + public Builder value(Optional value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + public ReportComponentMeasure build() { + return new ReportComponentMeasure( + index, + measureDisplayName, + value); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInfo.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInfo.java new file mode 100644 index 00000000..490c431a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInfo.java @@ -0,0 +1,414 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * ReportInfo - Report additional information, which is specific to Lending API reports. + */ + +public class ReportInfo { + + /** + * The name of the company being queried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("companyName") + private Optional companyName; + + /** + * Date the report was generated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("generatedDate") + private Optional generatedDate; + + /** + * The number of the page queried. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pageNumber") + private Optional pageNumber; + + /** + * The number of transactions returned per page. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pageSize") + private Optional pageSize; + + /** + * Name of the report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reportName") + private Optional reportName; + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalResults") + private Optional totalResults; + + public ReportInfo( + @JsonProperty("companyName") Optional companyName, + @JsonProperty("generatedDate") Optional generatedDate, + @JsonProperty("pageNumber") Optional pageNumber, + @JsonProperty("pageSize") Optional pageSize, + @JsonProperty("reportName") Optional reportName, + @JsonProperty("totalResults") Optional totalResults) { + Utils.checkNotNull(companyName, "companyName"); + Utils.checkNotNull(generatedDate, "generatedDate"); + Utils.checkNotNull(pageNumber, "pageNumber"); + Utils.checkNotNull(pageSize, "pageSize"); + Utils.checkNotNull(reportName, "reportName"); + Utils.checkNotNull(totalResults, "totalResults"); + this.companyName = companyName; + this.generatedDate = generatedDate; + this.pageNumber = pageNumber; + this.pageSize = pageSize; + this.reportName = reportName; + this.totalResults = totalResults; + } + + /** + * The name of the company being queried. + */ + public Optional companyName() { + return companyName; + } + + /** + * Date the report was generated. + */ + public Optional generatedDate() { + return generatedDate; + } + + /** + * The number of the page queried. + */ + public Optional pageNumber() { + return pageNumber; + } + + /** + * The number of transactions returned per page. + */ + public Optional pageSize() { + return pageSize; + } + + /** + * Name of the report. + */ + public Optional reportName() { + return reportName; + } + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + public Optional totalResults() { + return totalResults; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The name of the company being queried. + */ + public ReportInfo withCompanyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * The name of the company being queried. + */ + public ReportInfo withCompanyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * Date the report was generated. + */ + public ReportInfo withGeneratedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + return this; + } + + /** + * Date the report was generated. + */ + public ReportInfo withGeneratedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The number of the page queried. + */ + public ReportInfo withPageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = Optional.ofNullable(pageNumber); + return this; + } + + /** + * The number of the page queried. + */ + public ReportInfo withPageNumber(Optional pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * The number of transactions returned per page. + */ + public ReportInfo withPageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * The number of transactions returned per page. + */ + public ReportInfo withPageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Name of the report. + */ + public ReportInfo withReportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * Name of the report. + */ + public ReportInfo withReportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + public ReportInfo withTotalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = Optional.ofNullable(totalResults); + return this; + } + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + public ReportInfo withTotalResults(Optional totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportInfo other = (ReportInfo) o; + return + java.util.Objects.deepEquals(this.companyName, other.companyName) && + java.util.Objects.deepEquals(this.generatedDate, other.generatedDate) && + java.util.Objects.deepEquals(this.pageNumber, other.pageNumber) && + java.util.Objects.deepEquals(this.pageSize, other.pageSize) && + java.util.Objects.deepEquals(this.reportName, other.reportName) && + java.util.Objects.deepEquals(this.totalResults, other.totalResults); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + companyName, + generatedDate, + pageNumber, + pageSize, + reportName, + totalResults); + } + + @Override + public String toString() { + return Utils.toString(ReportInfo.class, + "companyName", companyName, + "generatedDate", generatedDate, + "pageNumber", pageNumber, + "pageSize", pageSize, + "reportName", reportName, + "totalResults", totalResults); + } + + public final static class Builder { + + private Optional companyName = Optional.empty(); + + private Optional generatedDate = Optional.empty(); + + private Optional pageNumber = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional reportName = Optional.empty(); + + private Optional totalResults = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The name of the company being queried. + */ + public Builder companyName(String companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = Optional.ofNullable(companyName); + return this; + } + + /** + * The name of the company being queried. + */ + public Builder companyName(Optional companyName) { + Utils.checkNotNull(companyName, "companyName"); + this.companyName = companyName; + return this; + } + + /** + * Date the report was generated. + */ + public Builder generatedDate(String generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = Optional.ofNullable(generatedDate); + return this; + } + + /** + * Date the report was generated. + */ + public Builder generatedDate(Optional generatedDate) { + Utils.checkNotNull(generatedDate, "generatedDate"); + this.generatedDate = generatedDate; + return this; + } + + /** + * The number of the page queried. + */ + public Builder pageNumber(long pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = Optional.ofNullable(pageNumber); + return this; + } + + /** + * The number of the page queried. + */ + public Builder pageNumber(Optional pageNumber) { + Utils.checkNotNull(pageNumber, "pageNumber"); + this.pageNumber = pageNumber; + return this; + } + + /** + * The number of transactions returned per page. + */ + public Builder pageSize(long pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + * The number of transactions returned per page. + */ + public Builder pageSize(Optional pageSize) { + Utils.checkNotNull(pageSize, "pageSize"); + this.pageSize = pageSize; + return this; + } + + /** + * Name of the report. + */ + public Builder reportName(String reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = Optional.ofNullable(reportName); + return this; + } + + /** + * Name of the report. + */ + public Builder reportName(Optional reportName) { + Utils.checkNotNull(reportName, "reportName"); + this.reportName = reportName; + return this; + } + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + public Builder totalResults(long totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = Optional.ofNullable(totalResults); + return this; + } + + /** + * The total number of transactions available for a company for the period specified in the query string. + */ + public Builder totalResults(Optional totalResults) { + Utils.checkNotNull(totalResults, "totalResults"); + this.totalResults = totalResults; + return this; + } + + public ReportInfo build() { + return new ReportInfo( + companyName, + generatedDate, + pageNumber, + pageSize, + reportName, + totalResults); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInput.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInput.java new file mode 100644 index 00000000..eb3abc14 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportInput.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ReportInput - Accounting method used to prepare the cash flow statement. + */ +public enum ReportInput { + UNKNOWN("Unknown"), + INDIRECT("Indirect"), + DIRECT("Direct"); + + @JsonValue + private final String value; + + private ReportInput(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItem.java new file mode 100644 index 00000000..bee4da50 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItem.java @@ -0,0 +1,442 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ReportItem { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountCategory") + private Optional accountCategory; + + /** + * The unique account ID. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private Optional accountId; + + /** + * Name of the account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountName") + private Optional accountName; + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("balance") + private Optional balance; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + public ReportItem( + @JsonProperty("accountCategory") Optional accountCategory, + @JsonProperty("accountId") Optional accountId, + @JsonProperty("accountName") Optional accountName, + @JsonProperty("balance") Optional balance, + @JsonProperty("date") Optional date) { + Utils.checkNotNull(accountCategory, "accountCategory"); + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(accountName, "accountName"); + Utils.checkNotNull(balance, "balance"); + Utils.checkNotNull(date, "date"); + this.accountCategory = accountCategory; + this.accountId = accountId; + this.accountName = accountName; + this.balance = balance; + this.date = date; + } + + public Optional accountCategory() { + return accountCategory; + } + + /** + * The unique account ID. + */ + public Optional accountId() { + return accountId; + } + + /** + * Name of the account. + */ + public Optional accountName() { + return accountName; + } + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + public Optional balance() { + return balance; + } + + /** + * 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 Optional date() { + return date; + } + + public final static Builder builder() { + return new Builder(); + } + + public ReportItem withAccountCategory(EnhancedReportAccountCategory accountCategory) { + Utils.checkNotNull(accountCategory, "accountCategory"); + this.accountCategory = Optional.ofNullable(accountCategory); + return this; + } + + public ReportItem withAccountCategory(Optional accountCategory) { + Utils.checkNotNull(accountCategory, "accountCategory"); + this.accountCategory = accountCategory; + return this; + } + + /** + * The unique account ID. + */ + public ReportItem withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * The unique account ID. + */ + public ReportItem withAccountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Name of the account. + */ + public ReportItem withAccountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * Name of the account. + */ + public ReportItem withAccountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + public ReportItem withBalance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + public ReportItem withBalance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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 ReportItem 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 ReportItem withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportItem other = (ReportItem) o; + return + java.util.Objects.deepEquals(this.accountCategory, other.accountCategory) && + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.accountName, other.accountName) && + java.util.Objects.deepEquals(this.balance, other.balance) && + java.util.Objects.deepEquals(this.date, other.date); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountCategory, + accountId, + accountName, + balance, + date); + } + + @Override + public String toString() { + return Utils.toString(ReportItem.class, + "accountCategory", accountCategory, + "accountId", accountId, + "accountName", accountName, + "balance", balance, + "date", date); + } + + public final static class Builder { + + private Optional accountCategory = Optional.empty(); + + private Optional accountId = Optional.empty(); + + private Optional accountName = Optional.empty(); + + private Optional balance = Optional.empty(); + + private Optional date = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + public Builder accountCategory(EnhancedReportAccountCategory accountCategory) { + Utils.checkNotNull(accountCategory, "accountCategory"); + this.accountCategory = Optional.ofNullable(accountCategory); + return this; + } + + public Builder accountCategory(Optional accountCategory) { + Utils.checkNotNull(accountCategory, "accountCategory"); + this.accountCategory = accountCategory; + return this; + } + + /** + * The unique account ID. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.ofNullable(accountId); + return this; + } + + /** + * The unique account ID. + */ + public Builder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * Name of the account. + */ + public Builder accountName(String accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = Optional.ofNullable(accountName); + return this; + } + + /** + * Name of the account. + */ + public Builder accountName(Optional accountName) { + Utils.checkNotNull(accountName, "accountName"); + this.accountName = accountName; + return this; + } + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + public Builder balance(double balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = Optional.ofNullable(balance); + return this; + } + + /** + * Balance of the account as reported on the profit and loss or Balance sheet. + */ + public Builder balance(Optional balance) { + Utils.checkNotNull(balance, "balance"); + this.balance = balance; + 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(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; + } + + public ReportItem build() { + return new ReportItem( + accountCategory, + accountId, + accountName, + balance, + date); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItems.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItems.java new file mode 100644 index 00000000..aa921d7b --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportItems.java @@ -0,0 +1,483 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ReportItems { + + /** + * The loan transaction amount. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * 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. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("date") + private Optional date; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemRef") + private Optional itemRef; + + /** + * The name of lender providing the loan. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("lenderName") + private Optional lenderName; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("loanRef") + private Optional loanRef; + + /** + * The type of loan transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("loanTransactionType") + private Optional loanTransactionType; + + public ReportItems( + @JsonProperty("amount") Optional amount, + @JsonProperty("date") Optional date, + @JsonProperty("itemRef") Optional itemRef, + @JsonProperty("lenderName") Optional lenderName, + @JsonProperty("loanRef") Optional loanRef, + @JsonProperty("loanTransactionType") Optional loanTransactionType) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(date, "date"); + Utils.checkNotNull(itemRef, "itemRef"); + Utils.checkNotNull(lenderName, "lenderName"); + Utils.checkNotNull(loanRef, "loanRef"); + Utils.checkNotNull(loanTransactionType, "loanTransactionType"); + this.amount = amount; + this.date = date; + this.itemRef = itemRef; + this.lenderName = lenderName; + this.loanRef = loanRef; + this.loanTransactionType = loanTransactionType; + } + + /** + * The loan transaction amount. + */ + public Optional amount() { + return amount; + } + + /** + * 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 Optional date() { + return date; + } + + public Optional itemRef() { + return itemRef; + } + + /** + * The name of lender providing the loan. + */ + public Optional lenderName() { + return lenderName; + } + + public Optional loanRef() { + return loanRef; + } + + /** + * The type of loan transaction. + */ + public Optional loanTransactionType() { + return loanTransactionType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The loan transaction amount. + */ + public ReportItems withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The loan transaction amount. + */ + public ReportItems withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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 ReportItems 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 ReportItems withDate(Optional date) { + Utils.checkNotNull(date, "date"); + this.date = date; + return this; + } + + public ReportItems withItemRef(ItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + public ReportItems withItemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The name of lender providing the loan. + */ + public ReportItems withLenderName(String lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = Optional.ofNullable(lenderName); + return this; + } + + /** + * The name of lender providing the loan. + */ + public ReportItems withLenderName(Optional lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = lenderName; + return this; + } + + public ReportItems withLoanRef(LoanRef loanRef) { + Utils.checkNotNull(loanRef, "loanRef"); + this.loanRef = Optional.ofNullable(loanRef); + return this; + } + + public ReportItems withLoanRef(Optional loanRef) { + Utils.checkNotNull(loanRef, "loanRef"); + this.loanRef = loanRef; + return this; + } + + /** + * The type of loan transaction. + */ + public ReportItems withLoanTransactionType(LoanTransactionType loanTransactionType) { + Utils.checkNotNull(loanTransactionType, "loanTransactionType"); + this.loanTransactionType = Optional.ofNullable(loanTransactionType); + return this; + } + + /** + * The type of loan transaction. + */ + public ReportItems withLoanTransactionType(Optional loanTransactionType) { + Utils.checkNotNull(loanTransactionType, "loanTransactionType"); + this.loanTransactionType = loanTransactionType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportItems other = (ReportItems) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.date, other.date) && + java.util.Objects.deepEquals(this.itemRef, other.itemRef) && + java.util.Objects.deepEquals(this.lenderName, other.lenderName) && + java.util.Objects.deepEquals(this.loanRef, other.loanRef) && + java.util.Objects.deepEquals(this.loanTransactionType, other.loanTransactionType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + date, + itemRef, + lenderName, + loanRef, + loanTransactionType); + } + + @Override + public String toString() { + return Utils.toString(ReportItems.class, + "amount", amount, + "date", date, + "itemRef", itemRef, + "lenderName", lenderName, + "loanRef", loanRef, + "loanTransactionType", loanTransactionType); + } + + public final static class Builder { + + private Optional amount = Optional.empty(); + + private Optional date = Optional.empty(); + + private Optional itemRef = Optional.empty(); + + private Optional lenderName = Optional.empty(); + + private Optional loanRef = Optional.empty(); + + private Optional loanTransactionType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The loan transaction amount. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The loan transaction amount. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + 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(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; + } + + public Builder itemRef(ItemRef itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = Optional.ofNullable(itemRef); + return this; + } + + public Builder itemRef(Optional itemRef) { + Utils.checkNotNull(itemRef, "itemRef"); + this.itemRef = itemRef; + return this; + } + + /** + * The name of lender providing the loan. + */ + public Builder lenderName(String lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = Optional.ofNullable(lenderName); + return this; + } + + /** + * The name of lender providing the loan. + */ + public Builder lenderName(Optional lenderName) { + Utils.checkNotNull(lenderName, "lenderName"); + this.lenderName = lenderName; + return this; + } + + public Builder loanRef(LoanRef loanRef) { + Utils.checkNotNull(loanRef, "loanRef"); + this.loanRef = Optional.ofNullable(loanRef); + return this; + } + + public Builder loanRef(Optional loanRef) { + Utils.checkNotNull(loanRef, "loanRef"); + this.loanRef = loanRef; + return this; + } + + /** + * The type of loan transaction. + */ + public Builder loanTransactionType(LoanTransactionType loanTransactionType) { + Utils.checkNotNull(loanTransactionType, "loanTransactionType"); + this.loanTransactionType = Optional.ofNullable(loanTransactionType); + return this; + } + + /** + * The type of loan transaction. + */ + public Builder loanTransactionType(Optional loanTransactionType) { + Utils.checkNotNull(loanTransactionType, "loanTransactionType"); + this.loanTransactionType = loanTransactionType; + return this; + } + + public ReportItems build() { + return new ReportItems( + amount, + date, + itemRef, + lenderName, + loanRef, + loanTransactionType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLine.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLine.java new file mode 100644 index 00000000..768fcbb8 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLine.java @@ -0,0 +1,274 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ReportLine { + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private JsonNullable accountId; + + /** + * An array of ReportLine items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("items") + private JsonNullable> items; + + /** + * Name of the report line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Numerical value of the line item. + */ + @JsonProperty("value") + private double value; + + public ReportLine( + @JsonProperty("accountId") JsonNullable accountId, + @JsonProperty("items") JsonNullable> items, + @JsonProperty("name") JsonNullable name, + @JsonProperty("value") double value) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(items, "items"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(value, "value"); + this.accountId = accountId; + this.items = items; + this.name = name; + this.value = value; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public JsonNullable accountId() { + return accountId; + } + + /** + * An array of ReportLine items. + */ + public JsonNullable> items() { + return items; + } + + /** + * Name of the report line item. + */ + public JsonNullable name() { + return name; + } + + /** + * Numerical value of the line item. + */ + public double value() { + return value; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public ReportLine withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public ReportLine withAccountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * An array of ReportLine items. + */ + public ReportLine withItems(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = JsonNullable.of(items); + return this; + } + + /** + * An array of ReportLine items. + */ + public ReportLine withItems(JsonNullable> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * Name of the report line item. + */ + public ReportLine withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the report line item. + */ + public ReportLine withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Numerical value of the line item. + */ + public ReportLine withValue(double value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportLine other = (ReportLine) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.items, other.items) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.value, other.value); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + items, + name, + value); + } + + @Override + public String toString() { + return Utils.toString(ReportLine.class, + "accountId", accountId, + "items", items, + "name", name, + "value", value); + } + + public final static class Builder { + + private JsonNullable accountId = JsonNullable.undefined(); + + private JsonNullable> items = JsonNullable.undefined(); + + private JsonNullable name = JsonNullable.undefined(); + + private Double value; + + private Builder() { + // force use of static builder() method + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder accountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * An array of ReportLine items. + */ + public Builder items(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = JsonNullable.of(items); + return this; + } + + /** + * An array of ReportLine items. + */ + public Builder items(JsonNullable> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * Name of the report line item. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the report line item. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Numerical value of the line item. + */ + public Builder value(double value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + public ReportLine build() { + return new ReportLine( + accountId, + items, + name, + value); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLineInput.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLineInput.java new file mode 100644 index 00000000..2ca8d110 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ReportLineInput.java @@ -0,0 +1,274 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ReportLineInput { + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountId") + private JsonNullable accountId; + + /** + * An array of ReportLine items. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("items") + private JsonNullable> items; + + /** + * Name of the report line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + /** + * Numerical value of the line item. + */ + @JsonProperty("value") + private double value; + + public ReportLineInput( + @JsonProperty("accountId") JsonNullable accountId, + @JsonProperty("items") JsonNullable> items, + @JsonProperty("name") JsonNullable name, + @JsonProperty("value") double value) { + Utils.checkNotNull(accountId, "accountId"); + Utils.checkNotNull(items, "items"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(value, "value"); + this.accountId = accountId; + this.items = items; + this.name = name; + this.value = value; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public JsonNullable accountId() { + return accountId; + } + + /** + * An array of ReportLine items. + */ + public JsonNullable> items() { + return items; + } + + /** + * Name of the report line item. + */ + public JsonNullable name() { + return name; + } + + /** + * Numerical value of the line item. + */ + public double value() { + return value; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public ReportLineInput withAccountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public ReportLineInput withAccountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * An array of ReportLine items. + */ + public ReportLineInput withItems(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = JsonNullable.of(items); + return this; + } + + /** + * An array of ReportLine items. + */ + public ReportLineInput withItems(JsonNullable> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * Name of the report line item. + */ + public ReportLineInput withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the report line item. + */ + public ReportLineInput withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Numerical value of the line item. + */ + public ReportLineInput withValue(double value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportLineInput other = (ReportLineInput) o; + return + java.util.Objects.deepEquals(this.accountId, other.accountId) && + java.util.Objects.deepEquals(this.items, other.items) && + java.util.Objects.deepEquals(this.name, other.name) && + java.util.Objects.deepEquals(this.value, other.value); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountId, + items, + name, + value); + } + + @Override + public String toString() { + return Utils.toString(ReportLineInput.class, + "accountId", accountId, + "items", items, + "name", name, + "value", value); + } + + public final static class Builder { + + private JsonNullable accountId = JsonNullable.undefined(); + + private JsonNullable> items = JsonNullable.undefined(); + + private JsonNullable name = JsonNullable.undefined(); + + private Double value; + + private Builder() { + // force use of static builder() method + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder accountId(String accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = JsonNullable.of(accountId); + return this; + } + + /** + * Identifier for the account, unique for the company in the accounting platform. + */ + public Builder accountId(JsonNullable accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + /** + * An array of ReportLine items. + */ + public Builder items(java.util.List items) { + Utils.checkNotNull(items, "items"); + this.items = JsonNullable.of(items); + return this; + } + + /** + * An array of ReportLine items. + */ + public Builder items(JsonNullable> items) { + Utils.checkNotNull(items, "items"); + this.items = items; + return this; + } + + /** + * Name of the report line item. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of the report line item. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * Numerical value of the line item. + */ + public Builder value(double value) { + Utils.checkNotNull(value, "value"); + this.value = value; + return this; + } + + public ReportLineInput build() { + return new ReportLineInput( + accountId, + items, + name, + value); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SalesOrderReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SalesOrderReference.java new file mode 100644 index 00000000..21b29fe2 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SalesOrderReference.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class SalesOrderReference { + + /** + * The underlying data type associated to the reference `id`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * Unique identifier to a record in `dataType`. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public SalesOrderReference( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * The underlying data type associated to the reference `id`. + */ + public Optional dataType() { + return dataType; + } + + /** + * Unique identifier to a record in `dataType`. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The underlying data type associated to the reference `id`. + */ + public SalesOrderReference withDataType(AccountingInvoiceDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * The underlying data type associated to the reference `id`. + */ + public SalesOrderReference withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier to a record in `dataType`. + */ + public SalesOrderReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier to a record in `dataType`. + */ + public SalesOrderReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SalesOrderReference other = (SalesOrderReference) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(SalesOrderReference.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The underlying data type associated to the reference `id`. + */ + public Builder dataType(AccountingInvoiceDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * The underlying data type associated to the reference `id`. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * Unique identifier to a record in `dataType`. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier to a record in `dataType`. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public SalesOrderReference build() { + return new SalesOrderReference( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SchemaDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SchemaDataType.java new file mode 100644 index 00000000..33a3ab0d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SchemaDataType.java @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * SchemaDataType - Available Data types + */ +public enum SchemaDataType { + ACCOUNT_TRANSACTIONS("accountTransactions"), + BALANCE_SHEET("balanceSheet"), + BANK_ACCOUNTS("bankAccounts"), + BANK_TRANSACTIONS("bankTransactions"), + BILL_CREDIT_NOTES("billCreditNotes"), + BILL_PAYMENTS("billPayments"), + BILLS("bills"), + CASH_FLOW_STATEMENT("cashFlowStatement"), + CHART_OF_ACCOUNTS("chartOfAccounts"), + COMPANY("company"), + CREDIT_NOTES("creditNotes"), + CUSTOMERS("customers"), + DIRECT_COSTS("directCosts"), + DIRECT_INCOMES("directIncomes"), + INVOICES("invoices"), + ITEM_RECEIPTS("itemReceipts"), + ITEMS("items"), + JOURNAL_ENTRIES("journalEntries"), + JOURNALS("journals"), + PAYMENT_METHODS("paymentMethods"), + PAYMENTS("payments"), + PROFIT_AND_LOSS("profitAndLoss"), + PURCHASE_ORDERS("purchaseOrders"), + SALES_ORDERS("salesOrders"), + SUPPLIERS("suppliers"), + TAX_RATES("taxRates"), + TRACKING_CATEGORIES("trackingCategories"), + TRANSFERS("transfers"), + BANKING_ACCOUNT_BALANCES("banking-accountBalances"), + BANKING_ACCOUNTS("banking-accounts"), + BANKING_TRANSACTION_CATEGORIES("banking-transactionCategories"), + BANKING_TRANSACTIONS("banking-transactions"), + COMMERCE_COMPANY_INFO("commerce-companyInfo"), + COMMERCE_CUSTOMERS("commerce-customers"), + COMMERCE_DISPUTES("commerce-disputes"), + COMMERCE_LOCATIONS("commerce-locations"), + COMMERCE_ORDERS("commerce-orders"), + COMMERCE_PAYMENT_METHODS("commerce-paymentMethods"), + COMMERCE_PAYMENTS("commerce-payments"), + COMMERCE_PRODUCT_CATEGORIES("commerce-productCategories"), + COMMERCE_PRODUCTS("commerce-products"), + COMMERCE_TAX_COMPONENTS("commerce-taxComponents"), + COMMERCE_TRANSACTIONS("commerce-transactions"); + + @JsonValue + private final String value; + + private SchemaDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Security.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Security.java new file mode 100644 index 00000000..aae384f5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Security.java @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.SpeakeasyMetadata; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class Security { + + @SpeakeasyMetadata("security:scheme=true,type=apiKey,subtype=header,name=Authorization") + private String authHeader; + + public Security( + String authHeader) { + Utils.checkNotNull(authHeader, "authHeader"); + this.authHeader = authHeader; + } + + public String authHeader() { + return authHeader; + } + + public final static Builder builder() { + return new Builder(); + } + + public Security withAuthHeader(String authHeader) { + Utils.checkNotNull(authHeader, "authHeader"); + this.authHeader = authHeader; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Security other = (Security) o; + return + java.util.Objects.deepEquals(this.authHeader, other.authHeader); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + authHeader); + } + + @Override + public String toString() { + return Utils.toString(Security.class, + "authHeader", authHeader); + } + + public final static class Builder { + + private String authHeader; + + private Builder() { + // force use of static builder() method + } + + public Builder authHeader(String authHeader) { + Utils.checkNotNull(authHeader, "authHeader"); + this.authHeader = authHeader; + return this; + } + + public Security build() { + return new Security( + authHeader); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceCharge.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceCharge.java new file mode 100644 index 00000000..9e55e980 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceCharge.java @@ -0,0 +1,470 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class ServiceCharge { + + /** + * Service charges for this order. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private Optional description; + + /** + * The number of times the charge is charged. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("quantity") + private Optional quantity; + + /** + * Amount of the service charge that is tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxAmount") + private Optional taxAmount; + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxPercentage") + private Optional taxPercentage; + + /** + * Taxes breakdown as applied to service charges. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxes") + private Optional> taxes; + + /** + * Total amount of the service charge, including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("totalAmount") + private Optional totalAmount; + + /** + * The type of the service charge. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + public ServiceCharge( + @JsonProperty("description") Optional description, + @JsonProperty("quantity") Optional quantity, + @JsonProperty("taxAmount") Optional taxAmount, + @JsonProperty("taxPercentage") Optional taxPercentage, + @JsonProperty("taxes") Optional> taxes, + @JsonProperty("totalAmount") Optional totalAmount, + @JsonProperty("type") Optional type) { + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(taxPercentage, "taxPercentage"); + Utils.checkNotNull(taxes, "taxes"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(type, "type"); + this.description = description; + this.quantity = quantity; + this.taxAmount = taxAmount; + this.taxPercentage = taxPercentage; + this.taxes = taxes; + this.totalAmount = totalAmount; + this.type = type; + } + + /** + * Service charges for this order. + */ + public Optional description() { + return description; + } + + /** + * The number of times the charge is charged. + */ + public Optional quantity() { + return quantity; + } + + /** + * Amount of the service charge that is tax. + */ + public Optional taxAmount() { + return taxAmount; + } + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + public Optional taxPercentage() { + return taxPercentage; + } + + /** + * Taxes breakdown as applied to service charges. + */ + public Optional> taxes() { + return taxes; + } + + /** + * Total amount of the service charge, including tax. + */ + public Optional totalAmount() { + return totalAmount; + } + + /** + * The type of the service charge. + */ + public Optional type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Service charges for this order. + */ + public ServiceCharge withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Service charges for this order. + */ + public ServiceCharge withDescription(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The number of times the charge is charged. + */ + public ServiceCharge withQuantity(long quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * The number of times the charge is charged. + */ + public ServiceCharge withQuantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the service charge that is tax. + */ + public ServiceCharge withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + /** + * Amount of the service charge that is tax. + */ + public ServiceCharge withTaxAmount(Optional taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + public ServiceCharge withTaxPercentage(double taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = Optional.ofNullable(taxPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + public ServiceCharge withTaxPercentage(Optional taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = taxPercentage; + return this; + } + + /** + * Taxes breakdown as applied to service charges. + */ + public ServiceCharge withTaxes(java.util.List taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = Optional.ofNullable(taxes); + return this; + } + + /** + * Taxes breakdown as applied to service charges. + */ + public ServiceCharge withTaxes(Optional> taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = taxes; + return this; + } + + /** + * Total amount of the service charge, including tax. + */ + public ServiceCharge withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the service charge, including tax. + */ + public ServiceCharge withTotalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * The type of the service charge. + */ + public ServiceCharge withType(ServiceChargeType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the service charge. + */ + public ServiceCharge withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceCharge other = (ServiceCharge) o; + return + java.util.Objects.deepEquals(this.description, other.description) && + java.util.Objects.deepEquals(this.quantity, other.quantity) && + java.util.Objects.deepEquals(this.taxAmount, other.taxAmount) && + java.util.Objects.deepEquals(this.taxPercentage, other.taxPercentage) && + java.util.Objects.deepEquals(this.taxes, other.taxes) && + java.util.Objects.deepEquals(this.totalAmount, other.totalAmount) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + description, + quantity, + taxAmount, + taxPercentage, + taxes, + totalAmount, + type); + } + + @Override + public String toString() { + return Utils.toString(ServiceCharge.class, + "description", description, + "quantity", quantity, + "taxAmount", taxAmount, + "taxPercentage", taxPercentage, + "taxes", taxes, + "totalAmount", totalAmount, + "type", type); + } + + public final static class Builder { + + private Optional description = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional taxAmount = Optional.empty(); + + private Optional taxPercentage = Optional.empty(); + + private Optional> taxes = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional type = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Service charges for this order. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = Optional.ofNullable(description); + return this; + } + + /** + * Service charges for this order. + */ + public Builder description(Optional description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The number of times the charge is charged. + */ + public Builder quantity(long quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + * The number of times the charge is charged. + */ + public Builder quantity(Optional quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + /** + * Amount of the service charge that is tax. + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + /** + * Amount of the service charge that is tax. + */ + public Builder taxAmount(Optional taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + public Builder taxPercentage(double taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = Optional.ofNullable(taxPercentage); + return this; + } + + /** + * Percentage rate (from 0 to 100) of any tax applied to the service charge. + */ + public Builder taxPercentage(Optional taxPercentage) { + Utils.checkNotNull(taxPercentage, "taxPercentage"); + this.taxPercentage = taxPercentage; + return this; + } + + /** + * Taxes breakdown as applied to service charges. + */ + public Builder taxes(java.util.List taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = Optional.ofNullable(taxes); + return this; + } + + /** + * Taxes breakdown as applied to service charges. + */ + public Builder taxes(Optional> taxes) { + Utils.checkNotNull(taxes, "taxes"); + this.taxes = taxes; + return this; + } + + /** + * Total amount of the service charge, including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + * Total amount of the service charge, including tax. + */ + public Builder totalAmount(Optional totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * The type of the service charge. + */ + public Builder type(ServiceChargeType type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the service charge. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public ServiceCharge build() { + return new ServiceCharge( + description, + quantity, + taxAmount, + taxPercentage, + taxes, + totalAmount, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceChargeType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceChargeType.java new file mode 100644 index 00000000..de0cf3a4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ServiceChargeType.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * ServiceChargeType - The type of the service charge. + */ +public enum ServiceChargeType { + GENERIC("Generic"), + SHIPPING("Shipping"), + OVERPAYMENT("Overpayment"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private ServiceChargeType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SourceRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SourceRef.java new file mode 100644 index 00000000..c42e6d61 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SourceRef.java @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * SourceRef - A source reference containing the `sourceType` object "Banking". + */ + +public class SourceRef { + + /** + * The data source type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sourceType") + private Optional sourceType; + + public SourceRef( + @JsonProperty("sourceType") Optional sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + } + + /** + * The data source type. + */ + public Optional sourceType() { + return sourceType; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The data source type. + */ + public SourceRef withSourceType(String sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = Optional.ofNullable(sourceType); + return this; + } + + /** + * The data source type. + */ + public SourceRef withSourceType(Optional sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceRef other = (SourceRef) o; + return + java.util.Objects.deepEquals(this.sourceType, other.sourceType); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + sourceType); + } + + @Override + public String toString() { + return Utils.toString(SourceRef.class, + "sourceType", sourceType); + } + + public final static class Builder { + + private Optional sourceType = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The data source type. + */ + public Builder sourceType(String sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = Optional.ofNullable(sourceType); + return this; + } + + /** + * The data source type. + */ + public Builder sourceType(Optional sourceType) { + Utils.checkNotNull(sourceType, "sourceType"); + this.sourceType = sourceType; + return this; + } + + public SourceRef build() { + return new SourceRef( + sourceType); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SourceType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SourceType.java new file mode 100644 index 00000000..d6f719dc --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SourceType.java @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * SourceType - The type of platform of the connection. + */ +public enum SourceType { + ACCOUNTING("Accounting"), + BANKING("Banking"), + BANK_FEED("BankFeed"), + COMMERCE("Commerce"), + EXPENSE("Expense"), + OTHER("Other"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private SourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Status.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Status.java new file mode 100644 index 00000000..24846af6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Status.java @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * Status - The status of the account transaction. + */ +public enum Status { + UNKNOWN("Unknown"), + UNRECONCILED("Unreconciled"), + RECONCILED("Reconciled"), + VOID_("Void"); + + @JsonValue + private final String value; + + private Status(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SupplementalData.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplementalData.java new file mode 100644 index 00000000..0bcc37c7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplementalData.java @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * SupplementalData - Supplemental data is additional data you can include in our standard data types. + * + * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + */ + +public class SupplementalData { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("content") + private JsonNullable>> content; + + public SupplementalData( + @JsonProperty("content") JsonNullable>> content) { + Utils.checkNotNull(content, "content"); + this.content = content; + } + + public JsonNullable>> content() { + return content; + } + + public final static Builder builder() { + return new Builder(); + } + + public SupplementalData withContent(java.util.Map> content) { + Utils.checkNotNull(content, "content"); + this.content = JsonNullable.of(content); + return this; + } + + public SupplementalData withContent(JsonNullable>> content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SupplementalData other = (SupplementalData) o; + return + java.util.Objects.deepEquals(this.content, other.content); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + content); + } + + @Override + public String toString() { + return Utils.toString(SupplementalData.class, + "content", content); + } + + public final static class Builder { + + private JsonNullable>> content = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder content(java.util.Map> content) { + Utils.checkNotNull(content, "content"); + this.content = JsonNullable.of(content); + return this; + } + + public Builder content(JsonNullable>> content) { + Utils.checkNotNull(content, "content"); + this.content = content; + return this; + } + + public SupplementalData build() { + return new SupplementalData( + content); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierRef.java new file mode 100644 index 00000000..65d3442d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * SupplierRef - Reference to the supplier the record relates to. + */ + +public class SupplierRef { + + /** + * The supplier's unique ID + */ + @JsonProperty("id") + private String id; + + /** + * The supplier's name + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("supplierName") + private JsonNullable supplierName; + + public SupplierRef( + @JsonProperty("id") String id, + @JsonProperty("supplierName") JsonNullable supplierName) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(supplierName, "supplierName"); + this.id = id; + this.supplierName = supplierName; + } + + /** + * The supplier's unique ID + */ + public String id() { + return id; + } + + /** + * The supplier's name + */ + public JsonNullable supplierName() { + return supplierName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The supplier's unique ID + */ + public SupplierRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The supplier's name + */ + public SupplierRef withSupplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * The supplier's name + */ + public SupplierRef withSupplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SupplierRef other = (SupplierRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.supplierName, other.supplierName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + supplierName); + } + + @Override + public String toString() { + return Utils.toString(SupplierRef.class, + "id", id, + "supplierName", supplierName); + } + + public final static class Builder { + + private String id; + + private JsonNullable supplierName = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The supplier's unique ID + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The supplier's name + */ + public Builder supplierName(String supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = JsonNullable.of(supplierName); + return this; + } + + /** + * The supplier's name + */ + public Builder supplierName(JsonNullable supplierName) { + Utils.checkNotNull(supplierName, "supplierName"); + this.supplierName = supplierName; + return this; + } + + public SupplierRef build() { + return new SupplierRef( + id, + supplierName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierStatus.java new file mode 100644 index 00000000..248f6981 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/SupplierStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * SupplierStatus - Status of the supplier. + */ +public enum SupplierStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"); + + @JsonValue + private final String value; + + private SupplierStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentAllocation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentAllocation.java new file mode 100644 index 00000000..a9a7ab07 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentAllocation.java @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class TaxComponentAllocation { + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("rate") + private JsonNullable rate; + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("taxComponentRef") + private Optional taxComponentRef; + + public TaxComponentAllocation( + @JsonProperty("rate") JsonNullable rate, + @JsonProperty("taxComponentRef") Optional taxComponentRef) { + Utils.checkNotNull(rate, "rate"); + Utils.checkNotNull(taxComponentRef, "taxComponentRef"); + this.rate = rate; + this.taxComponentRef = taxComponentRef; + } + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + public JsonNullable rate() { + return rate; + } + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + public Optional taxComponentRef() { + return taxComponentRef; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + public TaxComponentAllocation withRate(double rate) { + Utils.checkNotNull(rate, "rate"); + this.rate = JsonNullable.of(rate); + return this; + } + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + public TaxComponentAllocation withRate(JsonNullable rate) { + Utils.checkNotNull(rate, "rate"); + this.rate = rate; + return this; + } + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + public TaxComponentAllocation withTaxComponentRef(TaxComponentRef taxComponentRef) { + Utils.checkNotNull(taxComponentRef, "taxComponentRef"); + this.taxComponentRef = Optional.ofNullable(taxComponentRef); + return this; + } + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + public TaxComponentAllocation withTaxComponentRef(Optional taxComponentRef) { + Utils.checkNotNull(taxComponentRef, "taxComponentRef"); + this.taxComponentRef = taxComponentRef; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxComponentAllocation other = (TaxComponentAllocation) o; + return + java.util.Objects.deepEquals(this.rate, other.rate) && + java.util.Objects.deepEquals(this.taxComponentRef, other.taxComponentRef); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + rate, + taxComponentRef); + } + + @Override + public String toString() { + return Utils.toString(TaxComponentAllocation.class, + "rate", rate, + "taxComponentRef", taxComponentRef); + } + + public final static class Builder { + + private JsonNullable rate = JsonNullable.undefined(); + + private Optional taxComponentRef = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + public Builder rate(double rate) { + Utils.checkNotNull(rate, "rate"); + this.rate = JsonNullable.of(rate); + return this; + } + + /** + * Tax amount on order line sale as available from source commerce platform. + */ + public Builder rate(JsonNullable rate) { + Utils.checkNotNull(rate, "rate"); + this.rate = rate; + return this; + } + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + public Builder taxComponentRef(TaxComponentRef taxComponentRef) { + Utils.checkNotNull(taxComponentRef, "taxComponentRef"); + this.taxComponentRef = Optional.ofNullable(taxComponentRef); + return this; + } + + /** + * Taxes rates reference object depending on the rates being available on source commerce package. + */ + public Builder taxComponentRef(Optional taxComponentRef) { + Utils.checkNotNull(taxComponentRef, "taxComponentRef"); + this.taxComponentRef = taxComponentRef; + return this; + } + + public TaxComponentAllocation build() { + return new TaxComponentAllocation( + rate, + taxComponentRef); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentRef.java new file mode 100644 index 00000000..cb93eb6d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxComponentRef.java @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TaxComponentRef - Taxes rates reference object depending on the rates being available on source commerce package. + */ + +public class TaxComponentRef { + + /** + * The unique identitifer of the tax component being referenced. + */ + @JsonProperty("id") + private String id; + + /** + * Name of the tax component being referenced. + */ + @JsonProperty("name") + private String name; + + public TaxComponentRef( + @JsonProperty("id") String id, + @JsonProperty("name") String name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique identitifer of the tax component being referenced. + */ + public String id() { + return id; + } + + /** + * Name of the tax component being referenced. + */ + public String name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identitifer of the tax component being referenced. + */ + public TaxComponentRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax component being referenced. + */ + public TaxComponentRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxComponentRef other = (TaxComponentRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(TaxComponentRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private String name; + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identitifer of the tax component being referenced. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax component being referenced. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public TaxComponentRef build() { + return new TaxComponentRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateRef.java new file mode 100644 index 00000000..7d2c74f5 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateRef.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * TaxRateRef - Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + +public class TaxRateRef { + + /** + * Applicable tax rate. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("effectiveTaxRate") + private Optional effectiveTaxRate; + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Name of the tax rate in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public TaxRateRef( + @JsonProperty("effectiveTaxRate") Optional effectiveTaxRate, + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.effectiveTaxRate = effectiveTaxRate; + this.id = id; + this.name = name; + } + + /** + * Applicable tax rate. + */ + public Optional effectiveTaxRate() { + return effectiveTaxRate; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applicable tax rate. + */ + public TaxRateRef withEffectiveTaxRate(double effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate); + return this; + } + + /** + * Applicable tax rate. + */ + public TaxRateRef withEffectiveTaxRate(Optional effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = effectiveTaxRate; + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public TaxRateRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public TaxRateRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public TaxRateRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public TaxRateRef withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxRateRef other = (TaxRateRef) o; + return + java.util.Objects.deepEquals(this.effectiveTaxRate, other.effectiveTaxRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + effectiveTaxRate, + id, + name); + } + + @Override + public String toString() { + return Utils.toString(TaxRateRef.class, + "effectiveTaxRate", effectiveTaxRate, + "id", id, + "name", name); + } + + public final static class Builder { + + private Optional effectiveTaxRate = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Applicable tax rate. + */ + public Builder effectiveTaxRate(double effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate); + return this; + } + + /** + * Applicable tax rate. + */ + public Builder effectiveTaxRate(Optional effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = effectiveTaxRate; + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public TaxRateRef build() { + return new TaxRateRef( + effectiveTaxRate, + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateReference.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateReference.java new file mode 100644 index 00000000..46317a07 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TaxRateReference.java @@ -0,0 +1,246 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * TaxRateReference - Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + * + * Found on: + * + * - Bill line items + * - Bill Credit Note line items + * - Credit Note line items + * - Direct incomes line items + * - Invoice line items + * - Items + */ + +public class TaxRateReference { + + /** + * Applicable tax rate. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("effectiveTaxRate") + private Optional effectiveTaxRate; + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Name of the tax rate in the accounting platform. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private Optional name; + + public TaxRateReference( + @JsonProperty("effectiveTaxRate") Optional effectiveTaxRate, + @JsonProperty("id") Optional id, + @JsonProperty("name") Optional name) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.effectiveTaxRate = effectiveTaxRate; + this.id = id; + this.name = name; + } + + /** + * Applicable tax rate. + */ + public Optional effectiveTaxRate() { + return effectiveTaxRate; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Optional id() { + return id; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Optional name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Applicable tax rate. + */ + public TaxRateReference withEffectiveTaxRate(double effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate); + return this; + } + + /** + * Applicable tax rate. + */ + public TaxRateReference withEffectiveTaxRate(Optional effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = effectiveTaxRate; + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public TaxRateReference withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public TaxRateReference withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public TaxRateReference withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public TaxRateReference withName(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TaxRateReference other = (TaxRateReference) o; + return + java.util.Objects.deepEquals(this.effectiveTaxRate, other.effectiveTaxRate) && + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + effectiveTaxRate, + id, + name); + } + + @Override + public String toString() { + return Utils.toString(TaxRateReference.class, + "effectiveTaxRate", effectiveTaxRate, + "id", id, + "name", name); + } + + public final static class Builder { + + private Optional effectiveTaxRate = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional name = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Applicable tax rate. + */ + public Builder effectiveTaxRate(double effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate); + return this; + } + + /** + * Applicable tax rate. + */ + public Builder effectiveTaxRate(Optional effectiveTaxRate) { + Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + this.effectiveTaxRate = effectiveTaxRate; + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * Unique identifier for the tax rate in the accounting platform. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = Optional.ofNullable(name); + return this; + } + + /** + * Name of the tax rate in the accounting platform. + */ + public Builder name(Optional name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public TaxRateReference build() { + return new TaxRateReference( + effectiveTaxRate, + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Tracking.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Tracking.java new file mode 100644 index 00000000..8cd8e97d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Tracking.java @@ -0,0 +1,156 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class Tracking { + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("invoiceTo") + private Optional invoiceTo; + + @JsonProperty("recordRefs") + private java.util.List recordRefs; + + public Tracking( + @JsonProperty("invoiceTo") Optional invoiceTo, + @JsonProperty("recordRefs") java.util.List recordRefs) { + Utils.checkNotNull(invoiceTo, "invoiceTo"); + Utils.checkNotNull(recordRefs, "recordRefs"); + this.invoiceTo = invoiceTo; + this.recordRefs = recordRefs; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Optional invoiceTo() { + return invoiceTo; + } + + public java.util.List recordRefs() { + return recordRefs; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Tracking withInvoiceTo(RecordRef invoiceTo) { + Utils.checkNotNull(invoiceTo, "invoiceTo"); + this.invoiceTo = Optional.ofNullable(invoiceTo); + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Tracking withInvoiceTo(Optional invoiceTo) { + Utils.checkNotNull(invoiceTo, "invoiceTo"); + this.invoiceTo = invoiceTo; + return this; + } + + public Tracking withRecordRefs(java.util.List recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = recordRefs; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tracking other = (Tracking) o; + return + java.util.Objects.deepEquals(this.invoiceTo, other.invoiceTo) && + java.util.Objects.deepEquals(this.recordRefs, other.recordRefs); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + invoiceTo, + recordRefs); + } + + @Override + public String toString() { + return Utils.toString(Tracking.class, + "invoiceTo", invoiceTo, + "recordRefs", recordRefs); + } + + public final static class Builder { + + private Optional invoiceTo = Optional.empty(); + + private java.util.List recordRefs; + + private Builder() { + // force use of static builder() method + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Builder invoiceTo(RecordRef invoiceTo) { + Utils.checkNotNull(invoiceTo, "invoiceTo"); + this.invoiceTo = Optional.ofNullable(invoiceTo); + return this; + } + + /** + * Links the current record to the underlying record or data type that created it. + * + * For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + */ + public Builder invoiceTo(Optional invoiceTo) { + Utils.checkNotNull(invoiceTo, "invoiceTo"); + this.invoiceTo = invoiceTo; + return this; + } + + public Builder recordRefs(java.util.List recordRefs) { + Utils.checkNotNull(recordRefs, "recordRefs"); + this.recordRefs = recordRefs; + return this; + } + + public Tracking build() { + return new Tracking( + invoiceTo, + recordRefs); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingCategoryRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingCategoryRef.java new file mode 100644 index 00000000..d0d9d24c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingCategoryRef.java @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * TrackingCategoryRef - References a category against which the item is tracked. + * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + */ +@Deprecated +public class TrackingCategoryRef { + + /** + * Unique identifier to the tracking category. + */ + @JsonProperty("id") + private String id; + + /** + * Name of tracking category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public TrackingCategoryRef( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * Unique identifier to the tracking category. + */ + public String id() { + return id; + } + + /** + * Name of tracking category. + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier to the tracking category. + */ + public TrackingCategoryRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of tracking category. + */ + public TrackingCategoryRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of tracking category. + */ + public TrackingCategoryRef withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingCategoryRef other = (TrackingCategoryRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(TrackingCategoryRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier to the tracking category. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Name of tracking category. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * Name of tracking category. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public TrackingCategoryRef build() { + return new TrackingCategoryRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRef.java new file mode 100644 index 00000000..8de31855 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRef.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * TrackingRecordRef - Links to the customer or tracking category. + */ + +public class TrackingRecordRef { + + /** + * Name of underlying data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("dataType") + private Optional dataType; + + /** + * 'id' of the underlying record or data type. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + public TrackingRecordRef( + @JsonProperty("dataType") Optional dataType, + @JsonProperty("id") Optional id) { + Utils.checkNotNull(dataType, "dataType"); + Utils.checkNotNull(id, "id"); + this.dataType = dataType; + this.id = id; + } + + /** + * Name of underlying data type. + */ + public Optional dataType() { + return dataType; + } + + /** + * 'id' of the underlying record or data type. + */ + public Optional id() { + return id; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Name of underlying data type. + */ + public TrackingRecordRef withDataType(TrackingRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public TrackingRecordRef withDataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public TrackingRecordRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public TrackingRecordRef withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingRecordRef other = (TrackingRecordRef) o; + return + java.util.Objects.deepEquals(this.dataType, other.dataType) && + java.util.Objects.deepEquals(this.id, other.id); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + dataType, + id); + } + + @Override + public String toString() { + return Utils.toString(TrackingRecordRef.class, + "dataType", dataType, + "id", id); + } + + public final static class Builder { + + private Optional dataType = Optional.empty(); + + private Optional id = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Name of underlying data type. + */ + public Builder dataType(TrackingRecordRefDataType dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = Optional.ofNullable(dataType); + return this; + } + + /** + * Name of underlying data type. + */ + public Builder dataType(Optional dataType) { + Utils.checkNotNull(dataType, "dataType"); + this.dataType = dataType; + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * 'id' of the underlying record or data type. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + public TrackingRecordRef build() { + return new TrackingRecordRef( + dataType, + id); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRefDataType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRefDataType.java new file mode 100644 index 00000000..a36fd18a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TrackingRecordRefDataType.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TrackingRecordRefDataType - Name of underlying data type. + */ +public enum TrackingRecordRefDataType { + CUSTOMERS("customers"), + SUPPLIERS("suppliers"), + TRACKING_CATEGORIES("trackingCategories"); + + @JsonValue + private final String value; + + private TrackingRecordRefDataType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategory.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategory.java new file mode 100644 index 00000000..dc3d6f0d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategory.java @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + + +public class TransactionCategory { + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("confidence") + private Optional confidence; + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("levels") + private Optional> levels; + + public TransactionCategory( + @JsonProperty("confidence") Optional confidence, + @JsonProperty("levels") Optional> levels) { + Utils.checkNotNull(confidence, "confidence"); + Utils.checkNotNull(levels, "levels"); + this.confidence = confidence; + this.levels = levels; + } + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + public Optional confidence() { + return confidence; + } + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + public Optional> levels() { + return levels; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + public TransactionCategory withConfidence(double confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = Optional.ofNullable(confidence); + return this; + } + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + public TransactionCategory withConfidence(Optional confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = confidence; + return this; + } + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + public TransactionCategory withLevels(java.util.List levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = Optional.ofNullable(levels); + return this; + } + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + public TransactionCategory withLevels(Optional> levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = levels; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionCategory other = (TransactionCategory) o; + return + java.util.Objects.deepEquals(this.confidence, other.confidence) && + java.util.Objects.deepEquals(this.levels, other.levels); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + confidence, + levels); + } + + @Override + public String toString() { + return Utils.toString(TransactionCategory.class, + "confidence", confidence, + "levels", levels); + } + + public final static class Builder { + + private Optional confidence = Optional.empty(); + + private Optional> levels = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + public Builder confidence(double confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = Optional.ofNullable(confidence); + return this; + } + + /** + * Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. + */ + public Builder confidence(Optional confidence) { + Utils.checkNotNull(confidence, "confidence"); + this.confidence = confidence; + return this; + } + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + public Builder levels(java.util.List levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = Optional.ofNullable(levels); + return this; + } + + /** + * The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). + */ + public Builder levels(Optional> levels) { + Utils.checkNotNull(levels, "levels"); + this.levels = levels; + return this; + } + + public TransactionCategory build() { + return new TransactionCategory( + confidence, + levels); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryRef.java new file mode 100644 index 00000000..0e74431e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryRef.java @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * TransactionCategoryRef - An object of bank transaction category reference data. + */ + +public class TransactionCategoryRef { + + /** + * The unique category reference id for the bank transaction. + */ + @JsonProperty("id") + private String id; + + /** + * The category name reference for the bank transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + public TransactionCategoryRef( + @JsonProperty("id") String id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + /** + * The unique category reference id for the bank transaction. + */ + public String id() { + return id; + } + + /** + * The category name reference for the bank transaction. + */ + public JsonNullable name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique category reference id for the bank transaction. + */ + public TransactionCategoryRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The category name reference for the bank transaction. + */ + public TransactionCategoryRef withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The category name reference for the bank transaction. + */ + public TransactionCategoryRef withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionCategoryRef other = (TransactionCategoryRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + name); + } + + @Override + public String toString() { + return Utils.toString(TransactionCategoryRef.class, + "id", id, + "name", name); + } + + public final static class Builder { + + private String id; + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * The unique category reference id for the bank transaction. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The category name reference for the bank transaction. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The category name reference for the bank transaction. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public TransactionCategoryRef build() { + return new TransactionCategoryRef( + id, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryStatus.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryStatus.java new file mode 100644 index 00000000..fd2fe81c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCategoryStatus.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TransactionCategoryStatus - The status of the transaction category. + */ +public enum TransactionCategoryStatus { + UNKNOWN("Unknown"), + ACTIVE("Active"), + ARCHIVED("Archived"); + + @JsonValue + private final String value; + + private TransactionCategoryStatus(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCode.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCode.java new file mode 100644 index 00000000..9d7cdf69 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionCode.java @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TransactionCode - Code to identify the underlying transaction. + */ +public enum TransactionCode { + UNKNOWN("Unknown"), + FEE("Fee"), + PAYMENT("Payment"), + CASH("Cash"), + TRANSFER("Transfer"), + INTEREST("Interest"), + CASHBACK("Cashback"), + CHEQUE("Cheque"), + DIRECT_DEBIT("DirectDebit"), + PURCHASE("Purchase"), + STANDING_ORDER("StandingOrder"), + ADJUSTMENT("Adjustment"), + CREDIT("Credit"), + OTHER("Other"), + NOT_SUPPORTED("NotSupported"); + + @JsonValue + private final String value; + + private TransactionCode(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceRef.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceRef.java new file mode 100644 index 00000000..08336446 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceRef.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class TransactionSourceRef { + + /** + * The unique identitifer of the record being referenced + */ + @JsonProperty("id") + private String id; + + /** + * The type of source the transaction arose. + */ + @JsonProperty("type") + private TransactionSourceType type; + + public TransactionSourceRef( + @JsonProperty("id") String id, + @JsonProperty("type") TransactionSourceType type) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(type, "type"); + this.id = id; + this.type = type; + } + + /** + * The unique identitifer of the record being referenced + */ + public String id() { + return id; + } + + /** + * The type of source the transaction arose. + */ + public TransactionSourceType type() { + return type; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The unique identitifer of the record being referenced + */ + public TransactionSourceRef withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of source the transaction arose. + */ + public TransactionSourceRef withType(TransactionSourceType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionSourceRef other = (TransactionSourceRef) o; + return + java.util.Objects.deepEquals(this.id, other.id) && + java.util.Objects.deepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + id, + type); + } + + @Override + public String toString() { + return Utils.toString(TransactionSourceRef.class, + "id", id, + "type", type); + } + + public final static class Builder { + + private String id; + + private TransactionSourceType type; + + private Builder() { + // force use of static builder() method + } + + /** + * The unique identitifer of the record being referenced + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The type of source the transaction arose. + */ + public Builder type(TransactionSourceType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public TransactionSourceRef build() { + return new TransactionSourceRef( + id, + type); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceType.java new file mode 100644 index 00000000..d5fd232d --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionSourceType.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TransactionSourceType - The type of source the transaction arose. + */ +public enum TransactionSourceType { + FEE("Fee"), + ORDER("Order"), + PAYMENT("Payment"), + SERVICE_CHARGE("ServiceCharge"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private TransactionSourceType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionType.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionType.java new file mode 100644 index 00000000..b24916fe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransactionType.java @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * TransactionType - The type of the platform transaction: + * - `Unknown` + * - `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account. + * - `Payment` — Credit and debit card payments. + * - `PaymentFee` — Payment provider's fee on each card payment. + * - `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller. + * - `Payout` — Transfer of funds from the seller's merchant account to their bank account. + * - `Refund` — Refunds to a customer's credit or debit card. + * - `Transfer` — Secure transfer of funds to the seller's bank account. + */ +public enum TransactionType { + PAYMENT("Payment"), + REFUND("Refund"), + PAYOUT("Payout"), + FAILED_PAYOUT("FailedPayout"), + TRANSFER("Transfer"), + PAYMENT_FEE("PaymentFee"), + PAYMENT_FEE_REFUND("PaymentFeeRefund"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private TransactionType(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/TransferAccount.java b/lending/lib/src/main/java/io/codat/lending/models/shared/TransferAccount.java new file mode 100644 index 00000000..76f292d9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/TransferAccount.java @@ -0,0 +1,273 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * TransferAccount - Account details of the account sending or receiving the transfer. + */ + +public class TransferAccount { + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accountRef") + private Optional accountRef; + + /** + * The amount transferred between accounts. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("amount") + private Optional amount; + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private Optional currency; + + public TransferAccount( + @JsonProperty("accountRef") Optional accountRef, + @JsonProperty("amount") Optional amount, + @JsonProperty("currency") Optional currency) { + Utils.checkNotNull(accountRef, "accountRef"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(currency, "currency"); + this.accountRef = accountRef; + this.amount = amount; + this.currency = currency; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Optional accountRef() { + return accountRef; + } + + /** + * The amount transferred between accounts. + */ + public Optional amount() { + return amount; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Optional currency() { + return currency; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public TransferAccount withAccountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public TransferAccount withAccountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The amount transferred between accounts. + */ + public TransferAccount withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transferred between accounts. + */ + public TransferAccount withAmount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public TransferAccount withCurrency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public TransferAccount withCurrency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferAccount other = (TransferAccount) o; + return + java.util.Objects.deepEquals(this.accountRef, other.accountRef) && + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.currency, other.currency); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + accountRef, + amount, + currency); + } + + @Override + public String toString() { + return Utils.toString(TransferAccount.class, + "accountRef", accountRef, + "amount", amount, + "currency", currency); + } + + public final static class Builder { + + private Optional accountRef = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(AccountRef accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = Optional.ofNullable(accountRef); + return this; + } + + /** + * Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. + */ + public Builder accountRef(Optional accountRef) { + Utils.checkNotNull(accountRef, "accountRef"); + this.accountRef = accountRef; + return this; + } + + /** + * The amount transferred between accounts. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + * The amount transferred between accounts. + */ + public Builder amount(Optional amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(String currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + * + * ## Unknown currencies + * + * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + * + * There are only a very small number of edge cases where this currency code is returned by the Codat system. + */ + public Builder currency(Optional currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public TransferAccount build() { + return new TransferAccount( + accountRef, + amount, + currency); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Type.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Type.java new file mode 100644 index 00000000..6f691d2a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Type.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonValue; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + +/** + * Type - The type of the weblink. + */ +public enum Type { + WEBSITE("Website"), + SOCIAL("Social"), + UNKNOWN("Unknown"); + + @JsonValue + private final String value; + + private Type(String value) { + this.value = value; + } + + public String value() { + return value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ValidDataTypeLinks.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ValidDataTypeLinks.java new file mode 100644 index 00000000..ed115d49 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ValidDataTypeLinks.java @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ValidDataTypeLinks - When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + * + * For example, `validDatatypeLinks` might indicate the following references: + * + * - Which tax rates are valid to use on the line item of a bill. + * - Which items can be used when creating an invoice. + * + * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + * + * ## `validDatatypeLinks` example + * + * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + * + * ```json validDatatypeLinks for an account + * { + * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + * "nominalCode": "090", + * "name": "Business Bank Account", + * #... + * "validDatatypeLinks": [ + * { + * "property": "Id", + * "links": [ + * "Payment.AccountRef.Id", + * "BillPayment.AccountRef.Id", + * "DirectIncome.LineItems.AccountRef.Id", + * "DirectCost.LineItems.AccountRef.Id" + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Support for `validDatatypeLinks` + * + * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + * + * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our <a href="https://portal.productboard.com/codat/5-product-roadmap">Product Roadmap</a>. + */ + +public class ValidDataTypeLinks { + + /** + * Supported `dataTypes` that the record can be linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private JsonNullable> links; + + /** + * The property from the account that can be linked. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("property") + private JsonNullable property; + + public ValidDataTypeLinks( + @JsonProperty("links") JsonNullable> links, + @JsonProperty("property") JsonNullable property) { + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(property, "property"); + this.links = links; + this.property = property; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public JsonNullable> links() { + return links; + } + + /** + * The property from the account that can be linked. + */ + public JsonNullable property() { + return property; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public ValidDataTypeLinks withLinks(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public ValidDataTypeLinks withLinks(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public ValidDataTypeLinks withProperty(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public ValidDataTypeLinks withProperty(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidDataTypeLinks other = (ValidDataTypeLinks) o; + return + java.util.Objects.deepEquals(this.links, other.links) && + java.util.Objects.deepEquals(this.property, other.property); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + links, + property); + } + + @Override + public String toString() { + return Utils.toString(ValidDataTypeLinks.class, + "links", links, + "property", property); + } + + public final static class Builder { + + private JsonNullable> links = JsonNullable.undefined(); + + private JsonNullable property = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(java.util.List links) { + Utils.checkNotNull(links, "links"); + this.links = JsonNullable.of(links); + return this; + } + + /** + * Supported `dataTypes` that the record can be linked to. + */ + public Builder links(JsonNullable> links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(String property) { + Utils.checkNotNull(property, "property"); + this.property = JsonNullable.of(property); + return this; + } + + /** + * The property from the account that can be linked. + */ + public Builder property(JsonNullable property) { + Utils.checkNotNull(property, "property"); + this.property = property; + return this; + } + + public ValidDataTypeLinks build() { + return new ValidDataTypeLinks( + links, + property); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/Validation.java b/lending/lib/src/main/java/io/codat/lending/models/shared/Validation.java new file mode 100644 index 00000000..b77cd87c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/Validation.java @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Validation - A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + */ + +public class Validation { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private JsonNullable> errors; + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("warnings") + private JsonNullable> warnings; + + public Validation( + @JsonProperty("errors") JsonNullable> errors, + @JsonProperty("warnings") JsonNullable> warnings) { + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(warnings, "warnings"); + this.errors = errors; + this.warnings = warnings; + } + + public JsonNullable> errors() { + return errors; + } + + public JsonNullable> warnings() { + return warnings; + } + + public final static Builder builder() { + return new Builder(); + } + + public Validation withErrors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = JsonNullable.of(errors); + return this; + } + + public Validation withErrors(JsonNullable> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public Validation withWarnings(java.util.List warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = JsonNullable.of(warnings); + return this; + } + + public Validation withWarnings(JsonNullable> warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = warnings; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Validation other = (Validation) o; + return + java.util.Objects.deepEquals(this.errors, other.errors) && + java.util.Objects.deepEquals(this.warnings, other.warnings); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + errors, + warnings); + } + + @Override + public String toString() { + return Utils.toString(Validation.class, + "errors", errors, + "warnings", warnings); + } + + public final static class Builder { + + private JsonNullable> errors = JsonNullable.undefined(); + + private JsonNullable> warnings = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + public Builder errors(java.util.List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = JsonNullable.of(errors); + return this; + } + + public Builder errors(JsonNullable> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + public Builder warnings(java.util.List warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = JsonNullable.of(warnings); + return this; + } + + public Builder warnings(JsonNullable> warnings) { + Utils.checkNotNull(warnings, "warnings"); + this.warnings = warnings; + return this; + } + + public Validation build() { + return new Validation( + errors, + warnings); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/ValidationItem.java b/lending/lib/src/main/java/io/codat/lending/models/shared/ValidationItem.java new file mode 100644 index 00000000..31e70132 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/ValidationItem.java @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ValidationItem { + + /** + * Unique identifier for a validation item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("itemId") + private JsonNullable itemId; + + /** + * A message outlining validation item's issue. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private JsonNullable message; + + /** + * Name of validator. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("validatorName") + private JsonNullable validatorName; + + public ValidationItem( + @JsonProperty("itemId") JsonNullable itemId, + @JsonProperty("message") JsonNullable message, + @JsonProperty("validatorName") JsonNullable validatorName) { + Utils.checkNotNull(itemId, "itemId"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(validatorName, "validatorName"); + this.itemId = itemId; + this.message = message; + this.validatorName = validatorName; + } + + /** + * Unique identifier for a validation item. + */ + public JsonNullable itemId() { + return itemId; + } + + /** + * A message outlining validation item's issue. + */ + public JsonNullable message() { + return message; + } + + /** + * Name of validator. + */ + public JsonNullable validatorName() { + return validatorName; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Unique identifier for a validation item. + */ + public ValidationItem withItemId(String itemId) { + Utils.checkNotNull(itemId, "itemId"); + this.itemId = JsonNullable.of(itemId); + return this; + } + + /** + * Unique identifier for a validation item. + */ + public ValidationItem withItemId(JsonNullable itemId) { + Utils.checkNotNull(itemId, "itemId"); + this.itemId = itemId; + return this; + } + + /** + * A message outlining validation item's issue. + */ + public ValidationItem withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = JsonNullable.of(message); + return this; + } + + /** + * A message outlining validation item's issue. + */ + public ValidationItem withMessage(JsonNullable message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Name of validator. + */ + public ValidationItem withValidatorName(String validatorName) { + Utils.checkNotNull(validatorName, "validatorName"); + this.validatorName = JsonNullable.of(validatorName); + return this; + } + + /** + * Name of validator. + */ + public ValidationItem withValidatorName(JsonNullable validatorName) { + Utils.checkNotNull(validatorName, "validatorName"); + this.validatorName = validatorName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationItem other = (ValidationItem) o; + return + java.util.Objects.deepEquals(this.itemId, other.itemId) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.validatorName, other.validatorName); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + itemId, + message, + validatorName); + } + + @Override + public String toString() { + return Utils.toString(ValidationItem.class, + "itemId", itemId, + "message", message, + "validatorName", validatorName); + } + + public final static class Builder { + + private JsonNullable itemId = JsonNullable.undefined(); + + private JsonNullable message = JsonNullable.undefined(); + + private JsonNullable validatorName = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + /** + * Unique identifier for a validation item. + */ + public Builder itemId(String itemId) { + Utils.checkNotNull(itemId, "itemId"); + this.itemId = JsonNullable.of(itemId); + return this; + } + + /** + * Unique identifier for a validation item. + */ + public Builder itemId(JsonNullable itemId) { + Utils.checkNotNull(itemId, "itemId"); + this.itemId = itemId; + return this; + } + + /** + * A message outlining validation item's issue. + */ + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = JsonNullable.of(message); + return this; + } + + /** + * A message outlining validation item's issue. + */ + public Builder message(JsonNullable message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Name of validator. + */ + public Builder validatorName(String validatorName) { + Utils.checkNotNull(validatorName, "validatorName"); + this.validatorName = JsonNullable.of(validatorName); + return this; + } + + /** + * Name of validator. + */ + public Builder validatorName(JsonNullable validatorName) { + Utils.checkNotNull(validatorName, "validatorName"); + this.validatorName = validatorName; + return this; + } + + public ValidationItem build() { + return new ValidationItem( + itemId, + message, + validatorName); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/WebLink.java b/lending/lib/src/main/java/io/codat/lending/models/shared/WebLink.java new file mode 100644 index 00000000..cfa51618 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/WebLink.java @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.util.Optional; + +/** + * WebLink - Weblink associated with the company. + */ + +public class WebLink { + + /** + * The type of the weblink. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private Optional type; + + /** + * The full URL for the weblink. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("url") + private Optional url; + + public WebLink( + @JsonProperty("type") Optional type, + @JsonProperty("url") Optional url) { + Utils.checkNotNull(type, "type"); + Utils.checkNotNull(url, "url"); + this.type = type; + this.url = url; + } + + /** + * The type of the weblink. + */ + public Optional type() { + return type; + } + + /** + * The full URL for the weblink. + */ + public Optional url() { + return url; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * The type of the weblink. + */ + public WebLink withType(Type type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the weblink. + */ + public WebLink withType(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The full URL for the weblink. + */ + public WebLink withUrl(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + return this; + } + + /** + * The full URL for the weblink. + */ + public WebLink withUrl(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebLink other = (WebLink) o; + return + java.util.Objects.deepEquals(this.type, other.type) && + java.util.Objects.deepEquals(this.url, other.url); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + type, + url); + } + + @Override + public String toString() { + return Utils.toString(WebLink.class, + "type", type, + "url", url); + } + + public final static class Builder { + + private Optional type = Optional.empty(); + + private Optional url = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + /** + * The type of the weblink. + */ + public Builder type(Type type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.ofNullable(type); + return this; + } + + /** + * The type of the weblink. + */ + public Builder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + /** + * The full URL for the weblink. + */ + public Builder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.ofNullable(url); + return this; + } + + /** + * The full URL for the weblink. + */ + public Builder url(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public WebLink build() { + return new WebLink( + type, + url); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTax.java b/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTax.java new file mode 100644 index 00000000..e73dcc86 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTax.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class WithholdingTax { + + /** + * Amount of tax withheld. + */ + @JsonProperty("amount") + private double amount; + + /** + * Name assigned to withheld tax. + */ + @JsonProperty("name") + private String name; + + public WithholdingTax( + @JsonProperty("amount") double amount, + @JsonProperty("name") String name) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(name, "name"); + this.amount = amount; + this.name = name; + } + + /** + * Amount of tax withheld. + */ + public double amount() { + return amount; + } + + /** + * Name assigned to withheld tax. + */ + public String name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount of tax withheld. + */ + public WithholdingTax withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name assigned to withheld tax. + */ + public WithholdingTax withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithholdingTax other = (WithholdingTax) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + name); + } + + @Override + public String toString() { + return Utils.toString(WithholdingTax.class, + "amount", amount, + "name", name); + } + + public final static class Builder { + + private Double amount; + + private String name; + + private Builder() { + // force use of static builder() method + } + + /** + * Amount of tax withheld. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name assigned to withheld tax. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public WithholdingTax build() { + return new WithholdingTax( + amount, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTaxItems.java b/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTaxItems.java new file mode 100644 index 00000000..95cf3610 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/shared/WithholdingTaxItems.java @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.shared; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.codat.lending.utils.Utils; +import java.io.InputStream; + + +public class WithholdingTaxItems { + + /** + * Amount of tax withheld. + */ + @JsonProperty("amount") + private double amount; + + /** + * Name assigned to withheld tax. + */ + @JsonProperty("name") + private String name; + + public WithholdingTaxItems( + @JsonProperty("amount") double amount, + @JsonProperty("name") String name) { + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(name, "name"); + this.amount = amount; + this.name = name; + } + + /** + * Amount of tax withheld. + */ + public double amount() { + return amount; + } + + /** + * Name assigned to withheld tax. + */ + public String name() { + return name; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * Amount of tax withheld. + */ + public WithholdingTaxItems withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name assigned to withheld tax. + */ + public WithholdingTaxItems withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithholdingTaxItems other = (WithholdingTaxItems) o; + return + java.util.Objects.deepEquals(this.amount, other.amount) && + java.util.Objects.deepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + amount, + name); + } + + @Override + public String toString() { + return Utils.toString(WithholdingTaxItems.class, + "amount", amount, + "name", name); + } + + public final static class Builder { + + private Double amount; + + private String name; + + private Builder() { + // force use of static builder() method + } + + /** + * Amount of tax withheld. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + /** + * Name assigned to withheld tax. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public WithholdingTaxItems build() { + return new WithholdingTaxItems( + amount, + name); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/webhooks/AccountCategoriesUpdatedResponse.java b/lending/lib/src/main/java/io/codat/lending/models/webhooks/AccountCategoriesUpdatedResponse.java new file mode 100644 index 00000000..0dfb8768 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/webhooks/AccountCategoriesUpdatedResponse.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.webhooks; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; + + +public class AccountCategoriesUpdatedResponse { + + /** + * 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; + + public AccountCategoriesUpdatedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public AccountCategoriesUpdatedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountCategoriesUpdatedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountCategoriesUpdatedResponse 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; + } + AccountCategoriesUpdatedResponse other = (AccountCategoriesUpdatedResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountCategoriesUpdatedResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + 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; + } + + /** + * 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 AccountCategoriesUpdatedResponse build() { + return new AccountCategoriesUpdatedResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitReachedResponse.java b/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitReachedResponse.java new file mode 100644 index 00000000..2cfcbb04 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitReachedResponse.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.webhooks; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; + + +public class ClientRateLimitReachedResponse { + + /** + * 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; + + public ClientRateLimitReachedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ClientRateLimitReachedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ClientRateLimitReachedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClientRateLimitReachedResponse 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; + } + ClientRateLimitReachedResponse other = (ClientRateLimitReachedResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitReachedResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + 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; + } + + /** + * 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 ClientRateLimitReachedResponse build() { + return new ClientRateLimitReachedResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitResetResponse.java b/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitResetResponse.java new file mode 100644 index 00000000..46b4d6a0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/models/webhooks/ClientRateLimitResetResponse.java @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.models.webhooks; + +import io.codat.lending.utils.Utils; +import java.io.InputStream; +import java.net.http.HttpResponse; + + +public class ClientRateLimitResetResponse { + + /** + * 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; + + public ClientRateLimitResetResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public HttpResponse rawResponse() { + return rawResponse; + } + + public final static Builder builder() { + return new Builder(); + } + + /** + * HTTP response content type for this operation + */ + public ClientRateLimitResetResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ClientRateLimitResetResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClientRateLimitResetResponse 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; + } + ClientRateLimitResetResponse other = (ClientRateLimitResetResponse) o; + return + java.util.Objects.deepEquals(this.contentType, other.contentType) && + java.util.Objects.deepEquals(this.statusCode, other.statusCode) && + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + contentType, + statusCode, + rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ClientRateLimitResetResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + public final static class Builder { + + private String contentType; + + 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; + } + + /** + * 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 ClientRateLimitResetResponse build() { + return new ClientRateLimitResetResponse( + contentType, + statusCode, + rawResponse); + } + } +} + diff --git a/lending/lib/src/main/java/io/codat/lending/utils/FormMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/FormMetadata.java new file mode 100644 index 00000000..1b99dabe --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/FormMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class FormMetadata { + + String style = "form"; + boolean explode = true; + boolean json; + String name; + + private FormMetadata() { + } + + // form:name=propName,style=spaceDelimited,explode=true + static FormMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("form", new FormMetadata(), field); + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/HTTPClient.java b/lending/lib/src/main/java/io/codat/lending/utils/HTTPClient.java new file mode 100644 index 00000000..e6b4ebb0 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/HTTPClient.java @@ -0,0 +1,15 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.net.http.HttpResponse; + +public interface HTTPClient { + public HttpResponse send(HTTPRequest request) + throws IOException, InterruptedException, URISyntaxException; +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/HTTPRequest.java b/lending/lib/src/main/java/io/codat/lending/utils/HTTPRequest.java new file mode 100644 index 00000000..475147f4 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/HTTPRequest.java @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.net.URI; +import java.net.http.HttpRequest; +import java.net.http.HttpRequest.BodyPublisher; +import java.net.http.HttpRequest.BodyPublishers; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; + +public class HTTPRequest { + private String baseURL; + private String method; + private SerializedBody body; + + private List queryParams = new ArrayList<>(); + private Map> headers = new HashMap<>(); + + public HTTPRequest setMethod(String method) { + this.method = method; + return this; + } + + public HTTPRequest setURL(String url) { + this.baseURL = url; + return this; + } + + public HTTPRequest setBody(SerializedBody body) { + this.body = body; + return this; + } + + public HTTPRequest addHeader(String key, String value) { + List headerValues = this.headers.get(key); + if (headerValues == null) { + headerValues = new ArrayList<>(); + } + + headerValues.add(value); + this.headers.put(key, headerValues); + return this; + } + + public HTTPRequest addQueryParam(NameValuePair param) { + this.queryParams.add(param); + return this; + } + + public HttpRequest build() { + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(); + + BodyPublisher bodyPublisher = BodyPublishers.noBody(); + if (this.body != null) { + bodyPublisher = this.body.body; + requestBuilder.header("Content-Type", this.body.contentType); + } + + requestBuilder.method(this.method, bodyPublisher); + requestBuilder.uri(resolveURL()); + + for (Map.Entry> entry : this.headers.entrySet()) { + for (String value : entry.getValue()) { + requestBuilder.header(entry.getKey(), value); + } + } + + return requestBuilder.build(); + } + + private URI resolveURL() { + String url = this.baseURL; + if (this.queryParams != null && this.queryParams.size() > 0) { + url += "?" + URLEncodedUtils.format(this.queryParams, StandardCharsets.UTF_8); + } + return URI.create(url); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/HeaderMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/HeaderMetadata.java new file mode 100644 index 00000000..1042800c --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/HeaderMetadata.java @@ -0,0 +1,22 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class HeaderMetadata { + + String style = "simple"; + boolean explode; + String name; + + private HeaderMetadata() { + } + + // headerParam:style=simple,explode=false,name=apiID + static HeaderMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("header", new HeaderMetadata(), field); + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/JSON.java b/lending/lib/src/main/java/io/codat/lending/utils/JSON.java new file mode 100644 index 00000000..052e9f18 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/JSON.java @@ -0,0 +1,20 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class JSON { + public static ObjectMapper getMapper() { + return new ObjectMapper() + .findAndRegisterModules() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES); + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/LazySingletonValue.java b/lending/lib/src/main/java/io/codat/lending/utils/LazySingletonValue.java new file mode 100644 index 00000000..05d5e850 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/LazySingletonValue.java @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import com.fasterxml.jackson.core.type.TypeReference; + +public final class LazySingletonValue { + + private static final Object NOT_SET = new Object(); + + private final String name; + private final String json; + private final TypeReference typeReference; + private Object value = NOT_SET; + + public LazySingletonValue(String name, String json, TypeReference typeReference) { + this.name = name; + this.json = json; + this.typeReference = typeReference; + } + + @SuppressWarnings("unchecked") + public T value() { + if (value == NOT_SET) { + value = Utils.readDefaultOrConstValue(name, json, typeReference); + } + return (T) value; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/Metadata.java b/lending/lib/src/main/java/io/codat/lending/utils/Metadata.java new file mode 100644 index 00000000..daa22883 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/Metadata.java @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +final class Metadata { + + private Metadata() { + // prevent instantiation + } + + static T parse(String name, T metadata, Field field) + throws IllegalArgumentException, IllegalAccessException { + SpeakeasyMetadata md = field.getAnnotation(SpeakeasyMetadata.class); + if (md == null) { + return null; + } + + String mdValue = md.value(); + + if (mdValue == null || mdValue.isBlank()) { + return null; + } + + String[] groups = mdValue.split(" "); + + boolean handled = false; + + for (String group : groups) { + String[] parts = group.split(":"); + if (parts.length != 2) { + return null; + } + + if (!parts[0].equals(name)) { + continue; + } + + Map values = new HashMap<>(); + + String[] pairs = parts[1].split(","); + for (String pair : pairs) { + String[] keyVal = pair.split("="); + String key = keyVal[0]; + + String val = ""; + if (keyVal.length > 1) { + val = keyVal[1]; + } + + values.put(key, val); + } + + Field[] fields = metadata.getClass().getDeclaredFields(); + + for (Field f : fields) { + f.setAccessible(true); + if (values.containsKey(f.getName())) { + String val = values.get(f.getName()); + + if (f.getType().equals(boolean.class) || f.getType().equals(Boolean.class)) { + f.set(metadata, val.equals("true") || val.isBlank()); + } else { + f.set(metadata, val); + } + } + } + + handled = true; + } + + if (!handled) { + return null; + } + + return (T) metadata; + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/MultipartFormMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/MultipartFormMetadata.java new file mode 100644 index 00000000..b1e0e979 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/MultipartFormMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class MultipartFormMetadata { + + boolean file; + boolean content; + boolean json; + String name; + + private MultipartFormMetadata() { + } + + // multipartForm:name=file + static MultipartFormMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("multipartForm", new MultipartFormMetadata(), field); + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/OneOfDeserializer.java b/lending/lib/src/main/java/io/codat/lending/utils/OneOfDeserializer.java new file mode 100644 index 00000000..37e064c7 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/OneOfDeserializer.java @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Type; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.TreeNode; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DatabindException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +public class OneOfDeserializer extends StdDeserializer { + + private static final long serialVersionUID = -1; + + private final List> typeReferences; // oneOf subschemas + private final Class cls; + private final ObjectMapper mapper; + + protected OneOfDeserializer(Class cls, TypeReference... typeReferences) { + super(cls); + this.typeReferences= Arrays.asList(typeReferences); + this.cls = cls; + this.mapper = JSON.getMapper(); + } + + @Override + public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + return deserializeOneOf(mapper, p, ctxt, typeReferences, cls); + } + + private static T deserializeOneOf(ObjectMapper mapper, JsonParser p, DeserializationContext ctxt, + List> typeReferences, Class cls) throws IOException { + TreeNode tree = p.getCodec().readTree(p); + // TODO don't have to generate json because can use tree.traverse to get a + // parser to read value, perf advantage and can stop plugging in ObjectMapper + String json = mapper.writeValueAsString(tree); + return deserializeOneOf(mapper, json, typeReferences, cls, ctxt); + } + + private static T deserializeOneOf(ObjectMapper mapper, String json, List> typeReferences, Class cls, + DeserializationContext ctxt) throws JsonProcessingException { + List> matches = new ArrayList<>(); + for (TypeReference c : typeReferences) { + // try to deserialize with each of the member classes + // @formatter:off + try { + // Jackson very permissive with readValue so we will tighten things up a bit + if (matchPossible(c.getType(), json)) { + Object o = mapper.readValue(json, c); + T v = newInstance(cls, o); + matches.add(new Match<>(c, v)); + } + } catch (DatabindException e) {} // NOPMD + // @formatter:on + } + matches = applyMatchPreferences(matches, json); + if (matches.size() == 1) { + return matches.get(0).value; + } else if (matches.size() > 1) { + throw JsonMappingException.from(ctxt, + "json matched more than one of the possible type references, matches are: " + typeNames(matches) + " - json=\n" + json); + } else { + throw JsonMappingException.from(ctxt, + "json did not match any of the possible type references: " + typeReferenceNames(typeReferences) + ", json=\n" + json); + } + } + + private static final class Match { + final TypeReference typeReference; + final T value; + + Match(TypeReference typeReference, T value) { + this.typeReference = typeReference; + this.value = value; + } + } + + private static final Set NUMERIC_CLASSES = Set.of( + Integer.class.getCanonicalName(), + Long.class.getCanonicalName(), + BigInteger.class.getCanonicalName(), + Float.class.getCanonicalName(), + Double.class.getCanonicalName(), + BigDecimal.class.getCanonicalName()); + + private static final Set DECIMAL_CLASSES = Set.of( + Float.class.getCanonicalName(), + Double.class.getCanonicalName(), + BigDecimal.class.getCanonicalName()); + + private static final Set INTEGER_CLASSES = Set.of( + Integer.class.getCanonicalName(), + Long.class.getCanonicalName(), + BigInteger.class.getCanonicalName()); + + private static final Set DATE_TIME_CLASSES = Set.of( + OffsetDateTime.class.getCanonicalName(), + LocalDate.class.getCanonicalName()); + + // VisibleForTesting + public static boolean matchPossible(Type type, String json) { + // situations we want to AVOID that can happen with Jackson ObjectMapper: + // * json numeric considered as valid for deserialization to OffsetDateTime, LocalDate + // * non-double-quoted json string considered as valid string + // * json numeric can be parsed as a Boolean + // * double-quoted numerics can be parsed as numerics + + // We make important assumptions about matching json with types + if (typeIs(type, String.class)) { + // string must be double quoted + return isDoubleQuoted(json); + } else if (typeIs(type, Boolean.class)) { + // boolean can only have false or true values + return json.equals("true") || json.equals("false"); + } else if (NUMERIC_CLASSES.contains(type.getTypeName())) { + return !json.contains("\""); + } else if (typeIs(type, OffsetDateTime.class) || typeIs(type, LocalDate.class)) { + // only json schema datetime format accepted, not epoch ms/s etc. + return isDoubleQuoted(json) && !isNumeric(json.substring(1, json.length() - 1)); + } else { + return true; + } + } + + private static boolean isDoubleQuoted(String s) { + return s.length() >=2 && s.startsWith("\"") && s.endsWith("\""); + } + + // VisibleForTesting + public static List> applyMatchPreferences(List> matches, String json) { + if (matches.size() <= 1) { + return matches; + } else if (allNumeric(matches)) { + List> decimalMatches = decimalMatches(matches); + List> integerMatches = integerMatches(matches); + if (!decimalMatches.isEmpty() && !integerMatches.isEmpty()) { + if (json.contains("e")|| json.contains(".")) { + return decimalMatches; + } else { + return integerMatches; + } + } else if (!decimalMatches.isEmpty()) { + return decimalMatches; + } else { + return integerMatches; + } + } if (allDateTime(matches)) { + if (json.contains("T")) { + return filter(matches, OffsetDateTime.class); + } else { + return filter(matches, LocalDate.class); + } + } else { + return matches; + } + } + + private static List> filter(List> matches, Class filterByClass) { + return matches // + .stream() // + .filter(x -> x.typeReference.getType().getTypeName().equals(filterByClass.getCanonicalName())) // + .collect(Collectors.toList()); + } + + private static boolean allDateTime(List> matches) { + return matches.stream().allMatch(x -> DATE_TIME_CLASSES.contains(x.typeReference.getType().getTypeName())); + } + + private static boolean allNumeric(List> matches) { + return matches.stream().allMatch(x -> NUMERIC_CLASSES.contains(x.typeReference.getType().getTypeName())); + } + + private static List> decimalMatches(List> matches) { + return matches // + .stream() // + .filter(x -> DECIMAL_CLASSES.contains(x.typeReference.getType().getTypeName())) // + .collect(Collectors.toList()); + } + + private static List> integerMatches(List> matches) { + return matches // + .stream() // + .filter(x -> INTEGER_CLASSES.contains(x.typeReference.getType().getTypeName())) // + .collect(Collectors.toList()); + } + + private static boolean isNumeric(String s) { + try { + Double.parseDouble(s); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + private static boolean typeIs(Type type, Class cls) { + return type.getTypeName().equals(cls.getCanonicalName()); + } + + private static String typeNames(List> matches) { + return "[" + matches + .stream() + .map(x -> x.typeReference.getType().getTypeName()) + .collect(Collectors.joining(", ")) + "]"; + } + + private static String typeReferenceNames(List> list) { + return "[" + list + .stream() + .map(x -> x.getType().getTypeName()) + .collect(Collectors.joining(", ")) + "]"; + } + + private static T newInstance(Class cls, Object parameter) { + try { + Constructor con = cls.getDeclaredConstructor(Object.class); + con.setAccessible(true); + return con.newInstance(parameter); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException + | NoSuchMethodException | SecurityException e) { + throw new RuntimeException(e); + } + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/PathParamsMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/PathParamsMetadata.java new file mode 100644 index 00000000..ff01d606 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/PathParamsMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class PathParamsMetadata { + + String style = "simple"; + boolean explode; + String name; + String serialization; + + 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/lending/lib/src/main/java/io/codat/lending/utils/QueryParameters.java b/lending/lib/src/main/java/io/codat/lending/utils/QueryParameters.java new file mode 100644 index 00000000..7115c1b6 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/QueryParameters.java @@ -0,0 +1,226 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +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, + Map>> globals) throws Exception { + List allParams = new ArrayList<>(); + + Field[] fields = type.getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object value = queryParams != null ? field.get(queryParams) : null; + value = Utils.resolveOptionals(value); + + value = Utils.populateGlobal(value, field.getName(), "queryParam", globals); + if (value == null) { + continue; + } + + QueryParamsMetadata queryParamsMetadata = QueryParamsMetadata.parse(field); + if (queryParamsMetadata == null) { + continue; + } + + if (queryParamsMetadata.serialization != null && !queryParamsMetadata.serialization.isBlank()) { + List params = parseSerializedParams(queryParamsMetadata, value); + allParams.addAll(params); + } else { + switch (queryParamsMetadata.style) { + case "form": + List formParams = parseDelimitedParams(queryParamsMetadata, value, ","); + allParams.addAll(formParams); + break; + case "deepObject": + List deepObjectParams = parseDeepObjectParams(queryParamsMetadata, value); + allParams.addAll(deepObjectParams); + break; + case "pipeDelimited": + List pipeDelimitedParams = parseDelimitedParams(queryParamsMetadata, value, "|"); + allParams.addAll(pipeDelimitedParams); + break; + } + } + } + + return allParams; + } + + private static List parseSerializedParams(QueryParamsMetadata queryParamsMetadata, Object value) + throws JsonProcessingException { + 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)); + break; + } + + return params; + } + + private static List parseDelimitedParams(QueryParamsMetadata queryParamsMetadata, Object value, String delimiter) + throws IllegalArgumentException, IllegalAccessException { + List params = new ArrayList<>(); + + switch (Types.getType(value.getClass())) { + case ARRAY: { + final List array = Utils.toList(value); + List values = new ArrayList<>(); + List items = new ArrayList<>(); + + for (Object v : array) { + if (queryParamsMetadata.explode) { + values.add(Utils.valToString(v)); + } else { + items.add(Utils.valToString(v)); + } + } + + if (items.size() > 0) { + values.add(String.join(delimiter, items)); + } + + params.addAll(values.stream().map(v -> new BasicNameValuePair(queryParamsMetadata.name, v)) + .collect(Collectors.toList())); + break; + } + case MAP: { + Map map = (Map) value; + + List items = new ArrayList<>(); + + for (Map.Entry entry : map.entrySet()) { + String key = Utils.valToString(entry.getKey()); + String val = Utils.valToString(entry.getValue()); + + if (queryParamsMetadata.explode) { + params.add(new BasicNameValuePair(key, val)); + } 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))); + } + break; + } + case OBJECT: { + Field[] fields = value.getClass().getDeclaredFields(); + + List items = new ArrayList<>(); + + for (Field field : fields) { + field.setAccessible(true); + Object val = field.get(value); + val = Utils.resolveOptionals(val); + if (val == null) { + continue; + } + + QueryParamsMetadata metadata = QueryParamsMetadata.parse(field); + if (metadata == null) { + continue; + } + + if (queryParamsMetadata.explode) { + params.add(new BasicNameValuePair(metadata.name, Utils.valToString(val))); + } 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))); + } + break; + } + default: + params.add(new BasicNameValuePair(queryParamsMetadata.name, Utils.valToString(value))); + break; + } + + return params; + } + + private static List parseDeepObjectParams(QueryParamsMetadata queryParamsMetadata, Object value) + throws Exception { + List params = new ArrayList<>(); + + switch (Types.getType(value.getClass())) { + case MAP: { + Map map = (Map) value; + + for (Map.Entry entry : map.entrySet()) { + String key = Utils.valToString(entry.getKey()); + Object val = Utils.resolveOptionals(entry.getValue()); + + 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))); + } + } else { + params.add(new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, key), + Utils.valToString(val))); + } + } + + return params; + } + case OBJECT: { + Field[] fields = value.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object val = field.get(value); + val = Utils.resolveOptionals(val); + if (val == null) { + continue; + } + + QueryParamsMetadata metadata = QueryParamsMetadata.parse(field); + if (metadata == null) { + continue; + } + + if (val instanceof List || val.getClass().isArray()) { + for (Object v : Utils.toList(val)) { + params.add(new BasicNameValuePair( + String.format("%s[%s]", queryParamsMetadata.name, metadata.name), + Utils.valToString(v))); + } + } else { + params.add( + new BasicNameValuePair(String.format("%s[%s]", queryParamsMetadata.name, metadata.name), + Utils.valToString(val))); + } + } + + return params; + } + default: + throw new Exception("DeepObject style only supports Map and Object types"); + } + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/QueryParamsMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/QueryParamsMetadata.java new file mode 100644 index 00000000..2098a1ce --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/QueryParamsMetadata.java @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class QueryParamsMetadata { + + String style = "form"; + boolean explode = true; + String name; + String serialization; + + // queryParam:style=simple,explode=false,name=apiID + static QueryParamsMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("queryParam", new QueryParamsMetadata(), field); + } + + private QueryParamsMetadata() { + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/RequestBody.java b/lending/lib/src/main/java/io/codat/lending/utils/RequestBody.java new file mode 100644 index 00000000..905e826a --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/RequestBody.java @@ -0,0 +1,352 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.net.http.HttpRequest.BodyPublishers; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.Optional; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public class RequestBody { + private static final Map SERIALIZATION_METHOD_TO_CONTENT_TYPE = Map.of( + "json", "application/json", + "form", "application/x-www-form-urlencoded", + "multipart", "multipart/form-data", + "raw", "application/octet-stream", + "string", "text/plain"); + + public static SerializedBody serialize(Object request, String requestField, String serializationMethod, boolean nullable) + throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, + UnsupportedOperationException, IOException { + if (request == null) { + return null; + } + + if (!nullable && (request instanceof Optional) && ((Optional) request).isEmpty()) { + request = JsonNullable.undefined(); + } + + if (Types.getType(request.getClass()) != Types.OBJECT) { + return serializeContentType(requestField, SERIALIZATION_METHOD_TO_CONTENT_TYPE.get(serializationMethod), + request); + } + + Field reqField = null; + + try { + reqField = request.getClass().getDeclaredField(requestField); + reqField.setAccessible(true); + } catch (NoSuchFieldException e) { + // ignore + } + if (reqField == null) { + return serializeContentType(requestField, SERIALIZATION_METHOD_TO_CONTENT_TYPE.get(serializationMethod), + request); + } + + Object requestValue = reqField.get(request); + requestValue = Utils.resolveOptionals(requestValue); + if (requestValue == null) { + return null; + } + + RequestMetadata requestMetadata = RequestMetadata.parse(reqField); + if (requestMetadata == null) { + throw new Error("Missing request metadata on request field"); + } + + return serializeContentType(requestField, requestMetadata.mediaType, requestValue); + } + + private static SerializedBody serializeContentType(String fieldName, String contentType, Object value) + throws IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { + Pattern jsonPattern = Pattern.compile("(application|text)\\/.*?\\+*json.*"); + Pattern multipartPattern = Pattern.compile("multipart\\/.*"); + Pattern formPattern = Pattern.compile("application\\/x-www-form-urlencoded.*"); + Pattern textPattern = Pattern.compile("text\\/plain"); + + SerializedBody body = new SerializedBody(); + + if (textPattern.matcher(contentType).matches()) { + body.contentType = contentType; + body.body = BodyPublishers.ofString(value.toString()); + } else if (jsonPattern.matcher(contentType).matches()) { + ObjectMapper mapper = JSON.getMapper(); + body.contentType = contentType; + if (value instanceof JsonNullable && !((JsonNullable) value).isPresent()) { + body.body = BodyPublishers.noBody(); + } else { + body.body = BodyPublishers.ofString(mapper.writeValueAsString(value)); + } + } else if (multipartPattern.matcher(contentType).matches()) { + body = serializeMultipart(value); + } else if (formPattern.matcher(contentType).matches()) { + body = serializeFormData(value); + } else { + if (value instanceof String) { + body.contentType = contentType; + body.body = BodyPublishers.ofString((String) value); + } else if (value instanceof byte[]) { + body.contentType = contentType; + body.body = BodyPublishers.ofByteArray((byte[]) value); + } else { + throw new Error("Unsupported content type " + contentType + " for field " + fieldName); + } + } + + return body; + } + + private static SerializedBody serializeMultipart(Object value) + throws IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + String boundary = "-------------" + System.currentTimeMillis(); + builder.setBoundary(boundary); + + Field[] fields = value.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object val = Utils.resolveOptionals(field.get(value)); + + if (val == null) { + continue; + } + + MultipartFormMetadata metadata = MultipartFormMetadata.parse(field); + if (metadata == null) { + throw new Error("Missing multipart form metadata on field " + field.getName()); + } + + if (metadata.file) { + serializeMultipartFile(builder, val); + } else if (metadata.json) { + ObjectMapper mapper = JSON.getMapper(); + String json = mapper.writeValueAsString(val); + builder.addTextBody(metadata.name, json, ContentType.APPLICATION_JSON); + } else { + if (val instanceof List || val.getClass().isArray()) { + List arr = Utils.toList(val); + for (Object item : arr) { + builder.addTextBody(metadata.name + "[]", Utils.valToString(item)); + } + } else { + builder.addTextBody(metadata.name, Utils.valToString(val)); + } + } + } + + HttpEntity entity = builder.build(); + + SerializedBody body = new SerializedBody(); + body.contentType = builder.build().getContentType().getValue(); + + InputStream stream = entity.getContent(); + + body.body = BodyPublishers.ofInputStream(() -> stream); + + return body; + } + + private static void serializeMultipartFile(MultipartEntityBuilder builder, Object file) + throws IllegalArgumentException, IllegalAccessException { + if (Types.getType(file.getClass()) != Types.OBJECT) { + throw new Error("Invalid type for multipart file"); + } + + String fieldName = ""; + String fileName = ""; + byte[] content = null; + + Field[] fields = file.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object val = field.get(file); + + if (val == null) { + continue; + } + + MultipartFormMetadata metadata = MultipartFormMetadata.parse(field); + if (metadata == null || (!metadata.content && (metadata.name == null || metadata.name.isBlank()))) { + continue; + } + + if (metadata.content) { + content = (byte[]) val; + } else { + fieldName = metadata.name; + fileName = Utils.valToString(val); + } + } + + if (fieldName.isBlank() || fileName.isBlank() || content == null) { + throw new Error("Invalid multipart file"); + } + + builder.addBinaryBody(fieldName, content, ContentType.APPLICATION_OCTET_STREAM, fileName); + } + + private static SerializedBody serializeFormData(Object value) + throws IOException, IllegalArgumentException, IllegalAccessException { + List params = new ArrayList<>(); + + switch (Types.getType(value.getClass())) { + case MAP: + Map map = (Map) value; + + for (Map.Entry entry : map.entrySet()) { + params.add( + new BasicNameValuePair(Utils.valToString(entry.getKey()), + Utils.valToString(entry.getValue()))); + } + break; + case OBJECT: + Field[] fields = value.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object val = Utils.resolveOptionals(field.get(value)); + + if (val == null) { + continue; + } + + FormMetadata metadata = FormMetadata.parse(field); + if (metadata == null) { + continue; + } + + if (metadata.json) { + ObjectMapper mapper = JSON.getMapper(); + String json = mapper.writeValueAsString(val); + params.add(new BasicNameValuePair(metadata.name, json)); + } else { + switch (Types.getType(val.getClass())) { + case OBJECT: { + if (val.getClass() == LocalDate.class) { + params.add(new BasicNameValuePair(metadata.name, String.valueOf(val))); + } else if (val.getClass() == OffsetDateTime.class) { + params.add(new BasicNameValuePair(metadata.name, String.valueOf(val))); + } else { + + Field[] valFields = val.getClass().getDeclaredFields(); + + List items = new ArrayList<>(); + + for (Field valField : valFields) { + valField.setAccessible(true); + Object v = Utils.resolveOptionals(valField.get(val)); + if (v == null) { + continue; + } + + FormMetadata valMetadata = FormMetadata.parse(valField); + if (valMetadata == null) { + continue; + } + + if (metadata.explode) { + params.add(new BasicNameValuePair(valMetadata.name, + Utils.valToString(v))); + } else { + items.add(String.format("%s,%s", valMetadata.name, + Utils.valToString(v))); + } + } + + if (items.size() > 0) { + params.add(new BasicNameValuePair(metadata.name, String.join(",", items))); + } + } + break; + } + case MAP: { + Map valMap = (Map) val; + + List items = new ArrayList<>(); + + for (Map.Entry entry : valMap.entrySet()) { + if (metadata.explode) { + params.add(new BasicNameValuePair(Utils.valToString(entry.getKey()), + Utils.valToString(entry.getValue()))); + } else { + items.add(String.format("%s,%s", entry.getKey(), entry.getValue())); + } + } + + if (items.size() > 0) { + params.add(new BasicNameValuePair(metadata.name, String.join(",", items))); + } + + break; + } + case ARRAY: { + final List array = Utils.toList(val); + + List items = new ArrayList<>(); + + for (Object item : array) { + if (metadata.explode) { + params.add(new BasicNameValuePair(metadata.name, Utils.valToString(item))); + } else { + items.add(Utils.valToString(item)); + } + } + + if (items.size() > 0) { + params.add(new BasicNameValuePair(metadata.name, String.join(",", items))); + } + + break; + } + default: + params.add(new BasicNameValuePair(metadata.name, Utils.valToString(val))); + break; + } + } + } + break; + default: + throw new Error("Invalid type for form data"); + } + + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params); + + SerializedBody body = new SerializedBody(); + body.contentType = entity.getContentType().getValue(); + + InputStream stream = entity.getContent(); + + body.body = BodyPublishers.ofInputStream(() -> stream); + + return body; + } + + private RequestBody() { + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/RequestMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/RequestMetadata.java new file mode 100644 index 00000000..32311227 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/RequestMetadata.java @@ -0,0 +1,20 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class RequestMetadata { + + String mediaType = "application/octet-stream"; + + private RequestMetadata() { + } + + // request:mediaType=multipart/form-data + static RequestMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("request", new RequestMetadata(), field); + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/Security.java b/lending/lib/src/main/java/io/codat/lending/utils/Security.java new file mode 100644 index 00000000..ac7e352e --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/Security.java @@ -0,0 +1,183 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; +import java.util.Base64; + +import org.apache.http.message.BasicNameValuePair; + +public class Security { + public static SpeakeasyHTTPSecurityClient createClient(HTTPClient client, Object security) + throws Exception { + + SpeakeasyHTTPSecurityClient securityClient = new SpeakeasyHTTPSecurityClient(client); + + if (security != null) { + Field[] fields = security.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object value = Utils.resolveOptionals(field.get(security)); + if (value == null) { + continue; + } + + SecurityMetadata securityMetadata = SecurityMetadata.parse(field); + if (securityMetadata == null) { + continue; + } + + if (securityMetadata.option) { + parseSecurityOption(securityClient, value); + return securityClient; + } else if (securityMetadata.scheme) { + if ((securityMetadata.subtype != null && securityMetadata.subtype.equals("basic")) + && Types.getType(value.getClass()) != Types.OBJECT) { + parseSecurityScheme(securityClient, securityMetadata, security); + return securityClient; + } else { + parseSecurityScheme(securityClient, securityMetadata, value); + } + } + } + } + + return securityClient; + } + + private static void parseSecurityOption(SpeakeasyHTTPSecurityClient client, Object option) + throws Exception { + Field[] fields = option.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object value = Utils.resolveOptionals(field.get(option)); + + if (value == null) { + continue; + } + + SecurityMetadata securityMetadata = SecurityMetadata.parse(field); + if (securityMetadata == null || !securityMetadata.scheme) { + continue; + } + + parseSecurityScheme(client, securityMetadata, value); + } + } + + private static void parseSecurityScheme(SpeakeasyHTTPSecurityClient client, SecurityMetadata schemeMetadata, + Object scheme) throws Exception { + + if (Types.getType(scheme.getClass()) == Types.OBJECT) { + if (schemeMetadata.type.equals("http") && schemeMetadata.subtype.equals("basic")) { + parseBasicAuthScheme(client, scheme); + return; + } + + Field[] fields = scheme.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + Object value = Utils.resolveOptionals(field.get(scheme)); + + if (value == null) { + continue; + } + + SecurityMetadata securityMetadata = SecurityMetadata.parse(field); + if (securityMetadata == null || securityMetadata.name.isEmpty()) { + continue; + } + + parseSecuritySchemeValue(client, schemeMetadata, securityMetadata, value); + } + } else { + parseSecuritySchemeValue(client, schemeMetadata, schemeMetadata, scheme); + } + } + + private static void parseSecuritySchemeValue(SpeakeasyHTTPSecurityClient client, SecurityMetadata schemeMetadata, + SecurityMetadata securityMetadata, + Object value) throws Exception { + switch (schemeMetadata.type) { + case "apiKey": + switch (schemeMetadata.subtype) { + case "header": + client.addHeader(securityMetadata.name, Utils.valToString(value)); + break; + case "query": + client.addQueryParam( + new BasicNameValuePair(securityMetadata.name, Utils.valToString(value))); + break; + case "cookie": + client.addHeader("Cookie", + String.format("%s=%s", securityMetadata.name, Utils.valToString(value))); + break; + default: + throw new Error( + "Unsupported security scheme subtype for apiKey: " + securityMetadata.subtype); + } + break; + case "openIdConnect": + client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + break; + case "oauth2": + client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + break; + case "http": + switch (schemeMetadata.subtype) { + case "bearer": + client.addHeader(securityMetadata.name, Utils.prefixBearer(Utils.valToString(value))); + break; + default: + throw new Error("Unsupported security scheme subtype for bearer"); + } + break; + default: + throw new Error("Unsupported security scheme type"); + } + } + + private static void parseBasicAuthScheme(SpeakeasyHTTPSecurityClient client, Object scheme) + throws IllegalAccessException { + Field[] fields = scheme.getClass().getDeclaredFields(); + + String username = ""; + String password = ""; + + for (Field field : fields) { + field.setAccessible(true); + Object value = Utils.resolveOptionals(field.get(scheme)); + + if (value == null) { + continue; + } + + SecurityMetadata securityMetadata = SecurityMetadata.parse(field); + if (securityMetadata == null || securityMetadata.name.isEmpty()) { + continue; + } + + switch (securityMetadata.name) { + case "username": + username = Utils.valToString(value); + break; + case "password": + password = Utils.valToString(value); + break; + default: + throw new Error("Unsupported security scheme field for basic auth: " + securityMetadata.name); + } + } + + client.addHeader("Authorization", + "Basic " + Base64.getEncoder().encodeToString(String.format("%s:%s", username, password).getBytes())); + } + + private Security() { + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/SecurityMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/SecurityMetadata.java new file mode 100644 index 00000000..e289c926 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/SecurityMetadata.java @@ -0,0 +1,24 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.reflect.Field; + +class SecurityMetadata { + + String type; + String subtype; + boolean option; + boolean scheme; + String name; + + private SecurityMetadata() { + } + + // security:scheme=true,type=apiKey,subtype=header + static SecurityMetadata parse(Field field) throws IllegalArgumentException, IllegalAccessException { + return Metadata.parse("security", new SecurityMetadata(), field); + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/SerializedBody.java b/lending/lib/src/main/java/io/codat/lending/utils/SerializedBody.java new file mode 100644 index 00000000..84b484dd --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/SerializedBody.java @@ -0,0 +1,12 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.net.http.HttpRequest.BodyPublisher; + +public class SerializedBody { + public String contentType; + public BodyPublisher body; +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPClient.java b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPClient.java new file mode 100644 index 00000000..706d5edb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPClient.java @@ -0,0 +1,25 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.io.InputStream; + +public class SpeakeasyHTTPClient implements HTTPClient { + @Override + public HttpResponse send(HTTPRequest request) + throws IOException, InterruptedException, URISyntaxException { + HttpClient client = HttpClient.newHttpClient(); + + HttpRequest req = request.build(); + + HttpResponse response = client.send(req, HttpResponse.BodyHandlers.ofInputStream()); + return response; + } +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPSecurityClient.java b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPSecurityClient.java new file mode 100644 index 00000000..7d35c4e9 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyHTTPSecurityClient.java @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.net.http.HttpResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.http.NameValuePair; + +public class SpeakeasyHTTPSecurityClient + implements HTTPClient { + + private HTTPClient client; + + private List queryParams = new ArrayList<>(); + private Map> headers = new HashMap<>(); + + public SpeakeasyHTTPSecurityClient(HTTPClient client) { + this.client = client; + } + + @Override + public HttpResponse send(HTTPRequest request) + throws IOException, InterruptedException, URISyntaxException { + + for (Map.Entry> entry : this.headers.entrySet()) { + for (String value : entry.getValue()) { + request.addHeader(entry.getKey(), value); + } + } + + for (NameValuePair param : this.queryParams) { + request.addQueryParam(param); + } + + return this.client.send(request); + } + + public void addHeader(String key, String value) { + List headerValues = this.headers.get(key); + if (headerValues == null) { + headerValues = new ArrayList<>(); + } + + headerValues.add(value); + this.headers.put(key, headerValues); + } + + public void addQueryParam(NameValuePair param) { + this.queryParams.add(param); + } + +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyMetadata.java b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyMetadata.java new file mode 100644 index 00000000..08aa3fdb --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/SpeakeasyMetadata.java @@ -0,0 +1,16 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface SpeakeasyMetadata { + public String value() default ""; +} diff --git a/lending/lib/src/main/java/io/codat/lending/utils/Types.java b/lending/lib/src/main/java/io/codat/lending/utils/Types.java new file mode 100644 index 00000000..1684ed87 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/Types.java @@ -0,0 +1,52 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public enum Types { + PRIMITIVE, + ARRAY, + MAP, + OBJECT, + ENUM; + + private static final Set> PRIMITIVE_TYPES = getPrimitiveWrapperTypes(); + + public static Types getType(Class clazz) { + if (clazz.isArray() || List.class.isAssignableFrom(clazz)) { + return Types.ARRAY; + } else if (Map.class.isAssignableFrom(clazz)) { + return Types.MAP; + } else if (clazz.isEnum()) { + return Types.ENUM; + } else if (isPrimitiveWrapperTypes(clazz) || clazz.isPrimitive() || String.class.isAssignableFrom(clazz)) { + return Types.PRIMITIVE; + } else { + return Types.OBJECT; + } + } + + private static boolean isPrimitiveWrapperTypes(Class clazz) { + return PRIMITIVE_TYPES.contains(clazz); + } + + private static Set> getPrimitiveWrapperTypes() { + Set> ret = new HashSet>(); + ret.add(Boolean.class); + ret.add(Character.class); + ret.add(Byte.class); + ret.add(Short.class); + ret.add(Integer.class); + ret.add(Long.class); + ret.add(Float.class); + ret.add(Double.class); + ret.add(Void.class); + return ret; + } +} \ No newline at end of file diff --git a/lending/lib/src/main/java/io/codat/lending/utils/Utils.java b/lending/lib/src/main/java/io/codat/lending/utils/Utils.java new file mode 100644 index 00000000..cc9181c3 --- /dev/null +++ b/lending/lib/src/main/java/io/codat/lending/utils/Utils.java @@ -0,0 +1,502 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +package io.codat.lending.utils; + +import java.io.InputStream; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.apache.commons.io.IOUtils; +import org.apache.http.NameValuePair; + +import org.openapitools.jackson.nullable.JsonNullable; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +public final class Utils { + + private Utils() { + // prevent instantiation + } + + public static String generateURL(String baseURL, String path) + throws IllegalArgumentException, IllegalAccessException { + if (baseURL != null && baseURL.endsWith("/")) { + baseURL = baseURL.substring(0, baseURL.length() - 1); + } + + return baseURL + path; + } + + public static String generateURL(Class type, String baseURL, String path, JsonNullable params, + Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + if (params.isPresent() && params.get() != null) { + return generateURL(type, baseURL, path, params.get(), globals); + } else { + return baseURL; + } + } + + public static String generateURL(Class type, String baseURL, String path, Optional params, + Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + if (params.isPresent()) { + return generateURL(type, baseURL, path, params.get(), globals); + } else { + return baseURL; + } + } + + public static String generateURL(Class type, String baseURL, String path, T params, + Map>> globals) + throws IllegalArgumentException, IllegalAccessException, JsonProcessingException { + if (baseURL != null && baseURL.endsWith("/")) { + baseURL = baseURL.substring(0, baseURL.length() - 1); + } + + Map pathParams = new HashMap<>(); + + Field[] fields = type.getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + PathParamsMetadata pathParamsMetadata = PathParamsMetadata.parse(field); + if (pathParamsMetadata == null) { + continue; + } + + Object value = params != null ? field.get(params) : null; + value = resolveOptionals(value); + value = Utils.populateGlobal(value, field.getName(), "pathParam", globals); + if (value == null) { + continue; + } + + if (pathParamsMetadata.serialization != null && !pathParamsMetadata.serialization.isBlank()) { + Map serialized = parseSerializedParams(pathParamsMetadata, value); + pathParams.putAll(serialized); + } else { + switch (pathParamsMetadata.style) { + case "simple": + switch (Types.getType(value.getClass())) { + case ARRAY: + final List array = toList(value); + if (array.isEmpty()) { + continue; + } + + pathParams.put(pathParamsMetadata.name, + String.join(",", + array.stream().map(v -> Utils.valToString(v)) + .collect(Collectors.toList()))); + break; + case MAP: + Map map = (Map) value; + if (map.size() == 0) { + continue; + } + + pathParams.put(pathParamsMetadata.name, + String.join(",", map.entrySet().stream().map(e -> { + if (pathParamsMetadata.explode) { + return String.format("%s=%s", Utils.valToString(e.getKey()), + Utils.valToString(e.getValue())); + } else { + return String.format("%s,%s", Utils.valToString(e.getKey()), + Utils.valToString(e.getValue())); + } + }).collect(Collectors.toList()))); + break; + case OBJECT: + List values = new ArrayList<>(); + + Field[] valueFields = value.getClass().getDeclaredFields(); + for (Field valueField : valueFields) { + valueField.setAccessible(true); + PathParamsMetadata valuePathParamsMetadata = PathParamsMetadata.parse(valueField); + if (valuePathParamsMetadata == null) { + continue; + } + + Object val = valueField.get(value); + val = resolveOptionals(val); + if (val == null) { + continue; + } + + if (pathParamsMetadata.explode) { + values.add(String.format("%s=%s", valuePathParamsMetadata.name, + Utils.valToString(val))); + } else { + values.add(String.format("%s,%s", valuePathParamsMetadata.name, + Utils.valToString(val))); + } + } + + pathParams.put(pathParamsMetadata.name, String.join(",", values)); + break; + default: + pathParams.put(pathParamsMetadata.name, Utils.valToString(value)); + break; + } + } + } + } + + return baseURL + templateUrl(path, pathParams); + } + + public static boolean matchContentType(String contentType, String pattern) { + if (contentType == null || contentType.isBlank()) { + return false; + } + + if (contentType.equals(pattern) || pattern.equals("*") || pattern.equals("*/*")) { + return true; + } + + String[] contentTypeParts = contentType.split(";"); + if (contentTypeParts.length == 0) { + return false; + } + String mediaType = contentTypeParts[0]; + + if (mediaType.equals(pattern)) { + return true; + } + + String[] mediaTypeParts = mediaType.split("/"); + if (mediaTypeParts.length == 2) { + if (String.format("%s/*", mediaTypeParts[0]).equals(pattern) + || String.format("*/%s", mediaTypeParts[1]).equals(pattern)) { + return true; + } + } + + return false; + } + + public static SerializedBody serializeRequestBody(Object request, String requestField, String serializationMethod, boolean nullable) + throws NoSuchFieldException, + IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { + return RequestBody.serialize(request, requestField, serializationMethod, nullable); + } + + public static List getQueryParams(Class type, Optional params, + Map>> globals) throws Exception { + if (params.isEmpty()) { + return Collections.emptyList(); + } else { + return getQueryParams(type, params.get(), globals); + } + } + + public static List getQueryParams(Class type, JsonNullable params, + Map>> globals) throws Exception { + if (!params.isPresent() || params.get() == null) { + return Collections.emptyList(); + } else { + return getQueryParams(type, params.get(), globals); + } + } + + public static List getQueryParams(Class type, T params, + Map>> globals) throws Exception { + return QueryParameters.parseQueryParams(type, params, globals); + } + + public static HTTPClient configureSecurityClient(HTTPClient client, Object security) throws Exception { + return Security.createClient(client, security); + } + + public static String templateUrl(String url, Map params) { + StringBuilder sb = new StringBuilder(); + + Pattern p = Pattern.compile("(\\{.*?\\})"); + Matcher m = p.matcher(url); + + while (m.find()) { + String match = m.group(1); + String key = match.substring(1, match.length() - 1); + String value = params.get(key); + if (value != null) { + m.appendReplacement(sb, value); + } + } + m.appendTail(sb); + + return sb.toString(); + } + + public static Map> getHeaders(Object headers) throws Exception { + if (headers == null) { + return null; + } + + Map> result = new HashMap<>(); + + Field[] fields = headers.getClass().getDeclaredFields(); + + for (Field field : fields) { + field.setAccessible(true); + HeaderMetadata headerMetadata = HeaderMetadata.parse(field); + if (headerMetadata == null) { + continue; + } + + Object value = field.get(headers); + value = resolveOptionals(value); + if (value == null) { + continue; + } + + switch (Types.getType(value.getClass())) { + case OBJECT: { + List items = new ArrayList<>(); + + Field[] valueFields = value.getClass().getDeclaredFields(); + for (Field valueField : valueFields) { + valueField.setAccessible(true); + HeaderMetadata valueHeaderMetadata = HeaderMetadata.parse(valueField); + if (valueHeaderMetadata == null || valueHeaderMetadata.name == null + || valueHeaderMetadata.name.isBlank()) { + continue; + } + + Object valueFieldValue = valueField.get(value); + valueFieldValue = resolveOptionals(valueFieldValue); + if (valueFieldValue == null) { + continue; + } + + if (headerMetadata.explode) { + items.add( + String.format("%s=%s", valueHeaderMetadata.name, + Utils.valToString(valueFieldValue))); + } else { + items.add(valueHeaderMetadata.name); + items.add(Utils.valToString(valueFieldValue)); + } + } + + if (!result.containsKey(headerMetadata.name)) { + result.put(headerMetadata.name, new ArrayList<>()); + } + + List values = result.get(headerMetadata.name); + values.add(String.join(",", items)); + + break; + } + case MAP: { + Map map = (Map) value; + if (map.size() == 0) { + continue; + } + + List items = new ArrayList<>(); + + for (Map.Entry entry : map.entrySet()) { + if (headerMetadata.explode) { + items.add(String.format("%s=%s", Utils.valToString(entry.getKey()), + Utils.valToString(entry.getValue()))); + } else { + items.add(Utils.valToString(entry.getKey())); + items.add(Utils.valToString(entry.getValue())); + } + } + + if (!result.containsKey(headerMetadata.name)) { + result.put(headerMetadata.name, new ArrayList<>()); + } + + List values = result.get(headerMetadata.name); + values.add(String.join(",", items)); + + break; + } + case ARRAY: { + final List array = toList(value); + + if (array.isEmpty()) { + continue; + } + + List items = new ArrayList<>(); + + for (Object item : array) { + items.add(Utils.valToString(item)); + } + + if (!result.containsKey(headerMetadata.name)) { + result.put(headerMetadata.name, new ArrayList<>()); + } + + List values = result.get(headerMetadata.name); + values.add(String.join(",", items)); + + break; + } + default: { + if (!result.containsKey(headerMetadata.name)) { + result.put(headerMetadata.name, new ArrayList<>()); + } + + List values = result.get(headerMetadata.name); + values.add(Utils.valToString(value)); + break; + } + } + } + + return result; + } + + public static String valToString(Object value) { + switch (Types.getType(value.getClass())) { + case ENUM: + try { + Field field = value.getClass().getDeclaredField("value"); + field.setAccessible(true); + return String.valueOf(field.get(value)); + } catch (Exception e) { + return "ERROR_UNKNOWN_VALUE"; + } + default: + return String.valueOf(resolveOptionals(value)); + } + } + + public static String prefixBearer(String authHeaderValue) { + if (authHeaderValue.toLowerCase().startsWith("bearer ")) { + return authHeaderValue; + } + return "Bearer " + authHeaderValue; + } + + public static Object populateGlobal(Object value, String fieldName, String paramType, + Map>> globals) { + if (value == null && + globals != null && + globals.containsKey("parameters") && + globals.get("parameters").containsKey(paramType)) { + Object globalVal = globals.get("parameters").get(paramType).get(fieldName); + if (globalVal != null) { + value = globalVal; + } + } + + return value; + } + + private static Map parseSerializedParams(PathParamsMetadata pathParamsMetadata, Object value) + throws JsonProcessingException { + Map params = new HashMap<>(); + + switch (pathParamsMetadata.serialization) { + case "json": + ObjectMapper mapper = JSON.getMapper(); + String json = mapper.writeValueAsString(value); + + params.put(pathParamsMetadata.name, URLEncoder.encode(json, StandardCharsets.UTF_8)); + break; + } + + return params; + } + + public static T checkNotNull(T object, String name) { + if (object == null) { + // IAE better than NPE in this use-case (NPE can suggest internal troubles) + throw new IllegalArgumentException(name + " cannot be null"); + } + return object; + } + + public static Map emptyMapIfNull(Map map) { + return map == null ? java.util.Collections.emptyMap() : map; + } + + public static String toString(Class cls, Object... items) { + if (items.length % 2 != 0) { + throw new IllegalArgumentException("items must have an even length"); + } + StringBuilder s = new StringBuilder(); + int i = 0; + while (i < items.length) { + if (i > 0) { + s.append(", "); + } + s.append(items[i]); + s.append("="); + s.append(items[i + 1]); + i += 2; + } + return cls.getSimpleName() + "[" + s + "]"; + } + + public static Object resolveOptionals(Object o) { + if (o instanceof Optional) { + return ((Optional) o).orElse(null); + } else if (o instanceof JsonNullable) { + // TODO if JsonNullable.of(null) then we probably want an explicit null + // to be used by the caller of this so should probably return an EXPLICIT_NULL + // (a singleton constant object that represents this scenario without us being + // coupled to JsonNullable). + return ((JsonNullable) o).orElse(null); + } else { + return o; + } + } + + public static List toList(Object o) { + if (o == null) { + return null; + } else if (o instanceof List) { + return (List) o; + } else if (o.getClass().isArray()) { + return Arrays.asList((Object[]) o); + } else { + throw new IllegalArgumentException("argument must be List or array"); + } + } + + public static T readDefaultOrConstValue(String name, String json, TypeReference typeReference) { + try { + return readValue(json, typeReference); + } catch (JsonProcessingException e) { + throw new IllegalArgumentException("default/const value did not match the expected type, name=" + name + ",json=\n" + json, e); + } + } + + private static T readValue(String json, TypeReference typeReference) throws JsonProcessingException { + return JSON.getMapper().readValue(json, typeReference); + } + + public static byte[] toByteArrayAndClose(InputStream in) throws IOException { + try { + return IOUtils.toByteArray(in); + } finally { + in.close(); + } + } + + public static String toUtf8AndClose(InputStream in) throws IOException { + return new String(toByteArrayAndClose(in), StandardCharsets.UTF_8); + } +} \ No newline at end of file diff --git a/lending/settings.gradle b/lending/settings.gradle new file mode 100644 index 00000000..6cb58bba --- /dev/null +++ b/lending/settings.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user manual at https://docs.gradle.org/7.5.1/userguide/multi_project_builds.html + */ + +rootProject.name = 'openapi' +include('lib')