From c1256e27418f883779231de9964a024c527a8016 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 20 Sep 2023 21:31:51 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.0, Speakeay CLI 1.88.1 --- lending/README.md | 48 +- lending/RELEASES.md | 12 +- lending/USAGE.md | 12 +- lending/accountingbankdata.go | 14 +- lending/accountingbankdataaccounts.go | 26 +- lending/accountspayable.go | 2 +- lending/accountspayablebillcreditnotes.go | 26 +- lending/accountspayablebillpayments.go | 26 +- lending/accountspayablebills.go | 56 +- lending/accountspayablesuppliers.go | 56 +- lending/accountsreceivable.go | 2 +- lending/accountsreceivablecreditnotes.go | 26 +- lending/accountsreceivablecustomers.go | 56 +- lending/accountsreceivabledirectincomes.go | 56 +- lending/accountsreceivableinvoices.go | 68 +-- lending/accountsreceivablepayments.go | 26 +- lending/accountsreceivablereports.go | 38 +- lending/banking.go | 2 +- lending/bankingaccountbalances.go | 14 +- lending/bankingaccounts.go | 20 +- lending/bankingcategorizedstatement.go | 14 +- lending/bankingtransactioncategories.go | 20 +- lending/bankingtransactions.go | 20 +- lending/codatlending.go | 9 +- lending/companies.go | 62 +- lending/companyinfo.go | 26 +- lending/connections.go | 60 +- lending/dataintegrity.go | 38 +- .../models/operations/createaccountrequest.md | 13 + .../operations/createaccountresponse.md | 12 + .../operations/createbankaccountrequest.md | 13 + .../operations/createbankaccountresponse.md | 12 + .../createbanktransactionsrequest.md | 14 + .../createbanktransactionsresponse.md | 12 + .../operations/createdirectcostrequest.md | 13 + .../operations/createdirectcostresponse.md | 12 + .../operations/createsupplierrequest.md | 13 + .../operations/createsupplierresponse.md | 12 + .../operations/createtransferrequest.md | 13 + .../operations/createtransferresponse.md | 12 + .../getcreatebanktransactionsmodelrequest.md | 10 + .../getcreatebanktransactionsmodelresponse.md | 12 + .../getcreatechartofaccountsmodelrequest.md | 9 + .../getcreatechartofaccountsmodelresponse.md | 12 + .../getcreatedirectcostsmodelrequest.md | 9 + .../getcreatedirectcostsmodelresponse.md | 12 + .../operations/getcreateoperationrequest.md | 9 + .../operations/getcreateoperationresponse.md | 12 + .../getcreatetransfersmodelrequest.md | 9 + .../getcreatetransfersmodelresponse.md | 12 + ...getcreateupdatebankaccountsmodelrequest.md | 9 + ...etcreateupdatebankaccountsmodelresponse.md | 12 + .../getcreateupdatesuppliersmodelrequest.md | 9 + .../getcreateupdatesuppliersmodelresponse.md | 12 + .../operations/listcreateoperationsrequest.md | 12 + .../listcreateoperationsresponse.md | 12 + lending/docs/models/shared/accountbalance.md | 12 +- .../models/shared/accountbalanceamounts.md | 6 +- .../models/shared/accountcategorylevel.md | 2 +- .../docs/models/shared/accountingaccount.md | 2 +- .../shared/accountingaccounttransaction.md | 4 +- .../models/shared/accountingbankaccount.md | 6 +- .../shared/accountingbanktransaction.md | 4 +- lending/docs/models/shared/accountingbill.md | 10 +- .../models/shared/accountingbillcreditnote.md | 14 +- .../models/shared/accountingbillpayment.md | 4 +- .../shared/accountingbillwithholdingtax.md | 8 +- .../shared/accountingcreateaccountresponse.md | 21 + .../accountingcreatebankaccountresponse.md | 21 + .../accountingcreatebanktransactions.md | 9 + ...ccountingcreatebanktransactionsresponse.md | 21 + .../accountingcreatedirectcostresponse.md | 21 + .../accountingcreatesupplierresponse.md | 21 + .../accountingcreatetransferresponse.md | 21 + .../models/shared/accountingcreditnote.md | 18 +- .../models/shared/accountingdirectcost.md | 8 +- .../models/shared/accountingdirectincome.md | 8 +- .../docs/models/shared/accountinginvoice.md | 18 +- .../docs/models/shared/accountingpayment.md | 4 +- .../accountingpaymentallocationallocation.md | 4 +- lending/docs/models/shared/accounts.md | 2 +- .../models/shared/accounttransactionline.md | 2 +- .../models/shared/agedoutstandingamount.md | 2 +- .../shared/agedoutstandingamountdetail.md | 8 +- lending/docs/models/shared/balancesheet.md | 2 +- .../docs/models/shared/bankingtransaction.md | 2 +- .../models/shared/bankingtransactionref.md | 2 +- .../models/shared/billcreditnotelineitem.md | 14 +- .../billcreditnotelineitemtaxratereference.md | 10 +- lending/docs/models/shared/billlineitem.md | 14 +- lending/docs/models/shared/billpaymentline.md | 2 +- .../docs/models/shared/billpaymentlinelink.md | 4 +- lending/docs/models/shared/commerceorder.md | 10 +- lending/docs/models/shared/commercepayment.md | 2 +- .../docs/models/shared/commercetransaction.md | 2 +- .../shared/createbankaccounttransaction.md | 12 + .../docs/models/shared/creditnotelineitem.md | 14 +- .../models/shared/dataintegrityamounts.md | 4 +- .../models/shared/dataintegritybyamount.md | 8 +- .../models/shared/dataintegritybycount.md | 8 +- .../docs/models/shared/dataintegritydetail.md | 2 +- .../docs/models/shared/directcostlineitem.md | 14 +- .../models/shared/directincomelineitem.md | 14 +- .../shared/enhancedcashflowtransaction.md | 2 +- .../enhancedfinancialreportreportitem.md | 2 +- .../shared/enhancedinvoicereportitem.md | 4 +- lending/docs/models/shared/invoicelineitem.md | 14 +- lending/docs/models/shared/items.md | 8 +- lending/docs/models/shared/journalline.md | 2 +- .../models/shared/loansummaryreportitem.md | 6 +- .../models/shared/orderdiscountallocation.md | 8 +- lending/docs/models/shared/orderlineitem.md | 10 +- lending/docs/models/shared/payment.md | 4 +- .../models/shared/paymentallocationpayment.md | 4 +- lending/docs/models/shared/paymentline.md | 2 +- lending/docs/models/shared/paymentlinelink.md | 4 +- lending/docs/models/shared/paymentref.md | 2 +- .../docs/models/shared/productinventory.md | 2 +- .../models/shared/productinventorylocation.md | 8 +- lending/docs/models/shared/productprice.md | 2 +- lending/docs/models/shared/productvariant.md | 2 +- .../docs/models/shared/profitandlossreport.md | 8 +- lending/docs/models/shared/pushchangetype.md | 12 + .../docs/models/shared/pushfieldvalidation.md | 10 + lending/docs/models/shared/pushoperation.md | 20 + .../docs/models/shared/pushoperationchange.md | 10 + .../docs/models/shared/pushoperationref.md | 9 + lending/docs/models/shared/pushoperations.md | 12 + .../docs/models/shared/pushoperationstatus.md | 13 + lending/docs/models/shared/pushoption.md | 14 + .../docs/models/shared/pushoptionchoice.md | 12 + .../docs/models/shared/pushoptionproperty.md | 14 + lending/docs/models/shared/pushoptiontype.md | 15 + .../docs/models/shared/pushvalidationinfo.md | 9 + .../models/shared/reportcomponentmeasure.md | 10 +- lending/docs/models/shared/reportitems.md | 2 +- lending/docs/models/shared/reportline.md | 2 +- lending/docs/models/shared/servicecharge.md | 6 +- .../models/shared/taxcomponentallocation.md | 2 +- lending/docs/models/shared/taxrateref.md | 10 +- .../docs/models/shared/transactioncategory.md | 2 +- lending/docs/models/shared/transferaccount.md | 2 +- lending/docs/models/shared/validation.md | 11 + lending/docs/models/shared/validationitem.md | 10 + .../docs/sdks/accountingbankdata/README.md | 12 +- .../sdks/accountingbankdataaccounts/README.md | 16 +- .../accountspayablebillcreditnotes/README.md | 16 +- .../accountspayablebillpayments/README.md | 16 +- .../docs/sdks/accountspayablebills/README.md | 28 +- .../sdks/accountspayablesuppliers/README.md | 28 +- .../accountsreceivablecreditnotes/README.md | 16 +- .../accountsreceivablecustomers/README.md | 28 +- .../accountsreceivabledirectincomes/README.md | 30 +- .../sdks/accountsreceivableinvoices/README.md | 42 +- .../sdks/accountsreceivablepayments/README.md | 16 +- .../sdks/accountsreceivablereports/README.md | 24 +- .../sdks/bankingaccountbalances/README.md | 12 +- lending/docs/sdks/bankingaccounts/README.md | 16 +- .../bankingcategorizedstatement/README.md | 10 +- .../bankingtransactioncategories/README.md | 16 +- .../docs/sdks/bankingtransactions/README.md | 16 +- lending/docs/sdks/companies/README.md | 32 +- lending/docs/sdks/companyinfo/README.md | 8 +- lending/docs/sdks/connections/README.md | 30 +- lending/docs/sdks/dataintegrity/README.md | 22 +- lending/docs/sdks/excelreports/README.md | 12 +- lending/docs/sdks/fileupload/README.md | 14 +- .../financialstatementsaccounts/README.md | 16 +- .../financialstatementsbalancesheet/README.md | 12 +- .../financialstatementscashflow/README.md | 6 +- .../README.md | 12 +- lending/docs/sdks/liabilities/README.md | 8 +- lending/docs/sdks/loanwriteback/README.md | 4 + .../docs/sdks/loanwritebackaccounts/README.md | 160 +++++ .../sdks/loanwritebackbankaccounts/README.md | 152 +++++ .../loanwritebackbanktransactions/README.md | 148 +++++ .../loanwritebackcreateoperations/README.md | 115 ++++ .../sdks/loanwritebackdirectcosts/README.md | 227 +++++++ .../sdks/loanwritebacksuppliers/README.md | 167 +++++ .../sdks/loanwritebacktransfers/README.md | 183 ++++++ lending/docs/sdks/managedata/README.md | 4 +- .../sdks/managedatapulloperations/README.md | 16 +- lending/docs/sdks/managedatarefresh/README.md | 10 +- lending/docs/sdks/salescustomers/README.md | 18 +- lending/docs/sdks/salesdisputes/README.md | 18 +- lending/docs/sdks/saleslocations/README.md | 10 +- lending/docs/sdks/salesmetrics/README.md | 36 +- lending/docs/sdks/salesorders/README.md | 18 +- .../docs/sdks/salespaymentmethods/README.md | 18 +- lending/docs/sdks/salespayments/README.md | 18 +- .../sdks/salesproductcategories/README.md | 18 +- lending/docs/sdks/salesproducts/README.md | 18 +- lending/docs/sdks/salesreports/README.md | 22 +- lending/docs/sdks/salestransactions/README.md | 18 +- .../transactionsaccounttransactions/README.md | 18 +- .../sdks/transactionsdirectcosts/README.md | 36 +- .../sdks/transactionsjournalentries/README.md | 18 +- .../docs/sdks/transactionsjournals/README.md | 18 +- .../docs/sdks/transactionstransfers/README.md | 18 +- lending/excelreports.go | 32 +- lending/files.gen | 133 +++- lending/fileupload.go | 24 +- lending/financialstatements.go | 2 +- lending/financialstatementsaccounts.go | 26 +- lending/financialstatementsbalancesheet.go | 26 +- lending/financialstatementscashflow.go | 14 +- lending/financialstatementsprofitandloss.go | 26 +- lending/gen.yaml | 11 +- lending/go.mod | 3 +- lending/go.sum | 2 + lending/liabilities.go | 26 +- lending/loanwriteback.go | 28 + lending/loanwritebackaccounts.go | 278 +++++++++ lending/loanwritebackbankaccounts.go | 278 +++++++++ lending/loanwritebackbanktransactions.go | 276 +++++++++ lending/loanwritebackcreateoperations.go | 255 ++++++++ lending/loanwritebackdirectcosts.go | 278 +++++++++ lending/loanwritebacksuppliers.go | 278 +++++++++ lending/loanwritebacktransfers.go | 278 +++++++++ lending/managedata.go | 10 +- lending/managedatapulloperations.go | 26 +- lending/managedatarefresh.go | 20 +- .../pkg/models/operations/createaccount.go | 117 ++++ .../models/operations/createbankaccount.go | 117 ++++ .../operations/createbanktransactions.go | 126 ++++ .../pkg/models/operations/createdirectcost.go | 117 ++++ .../pkg/models/operations/createsupplier.go | 117 ++++ .../pkg/models/operations/createtransfer.go | 117 ++++ .../getaccountingagedcreditorsreport.go | 12 + .../getaccountingageddebtorsreport.go | 12 + .../operations/getcategorizedbankstatement.go | 16 +- .../getcreatebanktransactionsmodel.go | 81 +++ .../getcreatechartofaccountsmodel.go | 72 +++ .../operations/getcreatedirectcostsmodel.go | 72 +++ .../models/operations/getcreateoperation.go | 73 +++ .../operations/getcreatetransfersmodel.go | 72 +++ .../getcreateupdatebankaccountsmodel.go | 72 +++ .../getcreateupdatesuppliersmodel.go | 72 +++ .../operations/listaccountingaccounts.go | 16 +- .../listaccountingaccounttransactions.go | 16 +- .../operations/listaccountingbankaccounts.go | 16 +- .../listaccountingbankaccounttransactions.go | 16 +- .../listaccountingbillcreditnotes.go | 16 +- .../operations/listaccountingbillpayments.go | 16 +- .../models/operations/listaccountingbills.go | 16 +- .../operations/listaccountingcreditnotes.go | 16 +- .../operations/listaccountingcustomers.go | 16 +- .../operations/listaccountingdirectcosts.go | 16 +- .../operations/listaccountingdirectincomes.go | 16 +- .../operations/listaccountinginvoices.go | 16 +- .../listaccountingjournalentries.go | 16 +- .../operations/listaccountingjournals.go | 16 +- .../operations/listaccountingpayments.go | 16 +- .../operations/listaccountingsuppliers.go | 16 +- .../operations/listaccountingtransfers.go | 16 +- .../operations/listbankingaccountbalances.go | 16 +- .../models/operations/listbankingaccounts.go | 16 +- .../listbankingtransactioncategories.go | 16 +- .../operations/listbankingtransactions.go | 16 +- .../operations/listcommercecustomers.go | 16 +- .../models/operations/listcommercedisputes.go | 16 +- .../models/operations/listcommerceorders.go | 16 +- .../operations/listcommercepaymentmethods.go | 16 +- .../models/operations/listcommercepayments.go | 16 +- .../listcommerceproductcategories.go | 16 +- .../models/operations/listcommerceproducts.go | 16 +- .../operations/listcommercetransactions.go | 16 +- .../pkg/models/operations/listcompanies.go | 16 +- .../pkg/models/operations/listconnections.go | 16 +- .../models/operations/listcreateoperations.go | 112 ++++ .../operations/listdataintegritydetails.go | 16 +- .../models/operations/listpulloperations.go | 16 +- .../operations/listreconciledinvoices.go | 16 +- lending/pkg/models/shared/accountbalance.go | 22 +- .../models/shared/accountbalanceamounts.go | 26 +- .../pkg/models/shared/accountcategorylevel.go | 18 +- .../pkg/models/shared/accountingaccount.go | 18 +- .../shared/accountingaccounttransaction.go | 22 +- .../models/shared/accountingbankaccount.go | 26 +- .../shared/accountingbanktransaction.go | 24 +- lending/pkg/models/shared/accountingbill.go | 60 +- .../models/shared/accountingbillcreditnote.go | 55 +- .../models/shared/accountingbillpayment.go | 24 +- .../shared/accountingcreateaccountresponse.go | 192 ++++++ .../accountingcreatebankaccountresponse.go | 180 ++++++ .../accountingcreatebanktransactions.go | 22 + ...ccountingcreatebanktransactionsresponse.go | 164 +++++ .../accountingcreatedirectcostresponse.go | 179 ++++++ .../accountingcreatesupplierresponse.go | 169 ++++++ .../accountingcreatetransferresponse.go | 167 +++++ .../pkg/models/shared/accountingcreditnote.go | 63 +- .../pkg/models/shared/accountingdirectcost.go | 35 +- .../models/shared/accountingdirectincome.go | 35 +- .../pkg/models/shared/accountinginvoice.go | 57 +- .../pkg/models/shared/accountingpayment.go | 22 +- .../shared/accountingpaymentallocation.go | 22 +- lending/pkg/models/shared/accounts.go | 18 +- .../models/shared/accounttransactionline.go | 18 +- .../models/shared/agedoutstandingamount.go | 18 +- .../shared/agedoutstandingamountdetail.go | 18 +- lending/pkg/models/shared/balancesheet.go | 19 +- .../pkg/models/shared/bankingtransaction.go | 18 +- .../models/shared/bankingtransactionref.go | 24 +- .../models/shared/billcreditnotelineitem.go | 60 +- lending/pkg/models/shared/billlineitem.go | 47 +- lending/pkg/models/shared/billpaymentline.go | 19 +- .../pkg/models/shared/billpaymentlinelink.go | 22 +- lending/pkg/models/shared/commerceorder.go | 34 +- lending/pkg/models/shared/commercepayment.go | 18 +- .../pkg/models/shared/commercetransaction.go | 18 +- .../shared/createbankaccounttransaction.go | 81 +++ .../pkg/models/shared/creditnotelineitem.go | 47 +- .../pkg/models/shared/dataintegrityamounts.go | 22 +- .../models/shared/dataintegritybyamount.go | 30 +- .../pkg/models/shared/dataintegritybycount.go | 30 +- .../pkg/models/shared/dataintegritydetail.go | 18 +- .../pkg/models/shared/directcostlineitem.go | 47 +- .../pkg/models/shared/directincomelineitem.go | 45 +- .../shared/enhancedcashflowtransaction.go | 20 +- .../models/shared/enhancedfinancialreport.go | 18 +- .../shared/enhancedinvoicereportitem.go | 22 +- lending/pkg/models/shared/invoicelineitem.go | 47 +- lending/pkg/models/shared/items.go | 21 +- lending/pkg/models/shared/journalline.go | 19 +- .../models/shared/loansummaryreportitem.go | 26 +- .../models/shared/orderdiscountallocation.go | 18 +- lending/pkg/models/shared/orderlineitem.go | 34 +- lending/pkg/models/shared/payment.go | 22 +- .../models/shared/paymentallocationpayment.go | 22 +- lending/pkg/models/shared/paymentline.go | 19 +- lending/pkg/models/shared/paymentlinelink.go | 22 +- lending/pkg/models/shared/paymentref.go | 18 +- lending/pkg/models/shared/productinventory.go | 18 +- .../models/shared/productinventorylocation.go | 20 +- lending/pkg/models/shared/productprice.go | 20 +- lending/pkg/models/shared/productvariant.go | 18 +- .../pkg/models/shared/profitandlossreport.go | 43 +- lending/pkg/models/shared/pushchangetype.go | 44 ++ .../pkg/models/shared/pushfieldvalidation.go | 30 + lending/pkg/models/shared/pushoperation.go | 156 +++++ .../pkg/models/shared/pushoperationchange.go | 30 + lending/pkg/models/shared/pushoperationref.go | 23 + lending/pkg/models/shared/pushoperations.go | 46 ++ .../pkg/models/shared/pushoperationstatus.go | 42 ++ lending/pkg/models/shared/pushoption.go | 62 ++ lending/pkg/models/shared/pushoptionchoice.go | 47 ++ .../pkg/models/shared/pushoptionproperty.go | 62 ++ lending/pkg/models/shared/pushoptiontype.go | 53 ++ .../pkg/models/shared/pushvalidationinfo.go | 22 + .../models/shared/reportcomponentmeasure.go | 22 +- lending/pkg/models/shared/reportitems.go | 18 +- lending/pkg/models/shared/reportline.go | 19 +- lending/pkg/models/shared/servicecharge.go | 26 +- .../models/shared/taxcomponentallocation.go | 18 +- lending/pkg/models/shared/taxrateref.go | 18 +- .../pkg/models/shared/transactioncategory.go | 18 +- lending/pkg/models/shared/transferaccount.go | 18 +- lending/pkg/models/shared/validation.go | 23 + lending/pkg/models/shared/validationitem.go | 30 + lending/pkg/types/bigint.go | 77 +-- lending/pkg/types/date.go | 4 + lending/pkg/types/decimal.go | 64 +- lending/pkg/utils/form.go | 4 - lending/pkg/utils/json.go | 573 ++++++++++++++++++ lending/pkg/utils/pathparams.go | 4 - lending/pkg/utils/requestbody.go | 45 +- lending/pkg/utils/utils.go | 11 +- lending/sales.go | 2 +- lending/salescustomers.go | 26 +- lending/salesdisputes.go | 26 +- lending/saleslocations.go | 26 +- lending/salesmetrics.go | 38 +- lending/salesorders.go | 26 +- lending/salespaymentmethods.go | 26 +- lending/salespayments.go | 26 +- lending/salesproductcategories.go | 26 +- lending/salesproducts.go | 26 +- lending/salesreports.go | 26 +- lending/salestransactions.go | 26 +- lending/transactions.go | 2 +- lending/transactionsaccounttransactions.go | 26 +- lending/transactionsdirectcosts.go | 56 +- lending/transactionsjournalentries.go | 26 +- lending/transactionsjournals.go | 26 +- lending/transactionstransfers.go | 26 +- 385 files changed, 10841 insertions(+), 2101 deletions(-) create mode 100755 lending/docs/models/operations/createaccountrequest.md create mode 100755 lending/docs/models/operations/createaccountresponse.md create mode 100755 lending/docs/models/operations/createbankaccountrequest.md create mode 100755 lending/docs/models/operations/createbankaccountresponse.md create mode 100755 lending/docs/models/operations/createbanktransactionsrequest.md create mode 100755 lending/docs/models/operations/createbanktransactionsresponse.md create mode 100755 lending/docs/models/operations/createdirectcostrequest.md create mode 100755 lending/docs/models/operations/createdirectcostresponse.md create mode 100755 lending/docs/models/operations/createsupplierrequest.md create mode 100755 lending/docs/models/operations/createsupplierresponse.md create mode 100755 lending/docs/models/operations/createtransferrequest.md create mode 100755 lending/docs/models/operations/createtransferresponse.md create mode 100755 lending/docs/models/operations/getcreatebanktransactionsmodelrequest.md create mode 100755 lending/docs/models/operations/getcreatebanktransactionsmodelresponse.md create mode 100755 lending/docs/models/operations/getcreatechartofaccountsmodelrequest.md create mode 100755 lending/docs/models/operations/getcreatechartofaccountsmodelresponse.md create mode 100755 lending/docs/models/operations/getcreatedirectcostsmodelrequest.md create mode 100755 lending/docs/models/operations/getcreatedirectcostsmodelresponse.md create mode 100755 lending/docs/models/operations/getcreateoperationrequest.md create mode 100755 lending/docs/models/operations/getcreateoperationresponse.md create mode 100755 lending/docs/models/operations/getcreatetransfersmodelrequest.md create mode 100755 lending/docs/models/operations/getcreatetransfersmodelresponse.md create mode 100755 lending/docs/models/operations/getcreateupdatebankaccountsmodelrequest.md create mode 100755 lending/docs/models/operations/getcreateupdatebankaccountsmodelresponse.md create mode 100755 lending/docs/models/operations/getcreateupdatesuppliersmodelrequest.md create mode 100755 lending/docs/models/operations/getcreateupdatesuppliersmodelresponse.md create mode 100755 lending/docs/models/operations/listcreateoperationsrequest.md create mode 100755 lending/docs/models/operations/listcreateoperationsresponse.md create mode 100755 lending/docs/models/shared/accountingcreateaccountresponse.md create mode 100755 lending/docs/models/shared/accountingcreatebankaccountresponse.md create mode 100755 lending/docs/models/shared/accountingcreatebanktransactions.md create mode 100755 lending/docs/models/shared/accountingcreatebanktransactionsresponse.md create mode 100755 lending/docs/models/shared/accountingcreatedirectcostresponse.md create mode 100755 lending/docs/models/shared/accountingcreatesupplierresponse.md create mode 100755 lending/docs/models/shared/accountingcreatetransferresponse.md create mode 100755 lending/docs/models/shared/createbankaccounttransaction.md create mode 100755 lending/docs/models/shared/pushchangetype.md create mode 100755 lending/docs/models/shared/pushfieldvalidation.md create mode 100755 lending/docs/models/shared/pushoperation.md create mode 100755 lending/docs/models/shared/pushoperationchange.md create mode 100755 lending/docs/models/shared/pushoperationref.md create mode 100755 lending/docs/models/shared/pushoperations.md create mode 100755 lending/docs/models/shared/pushoperationstatus.md create mode 100755 lending/docs/models/shared/pushoption.md create mode 100755 lending/docs/models/shared/pushoptionchoice.md create mode 100755 lending/docs/models/shared/pushoptionproperty.md create mode 100755 lending/docs/models/shared/pushoptiontype.md create mode 100755 lending/docs/models/shared/pushvalidationinfo.md create mode 100755 lending/docs/models/shared/validation.md create mode 100755 lending/docs/models/shared/validationitem.md create mode 100755 lending/docs/sdks/loanwriteback/README.md create mode 100755 lending/docs/sdks/loanwritebackaccounts/README.md create mode 100755 lending/docs/sdks/loanwritebackbankaccounts/README.md create mode 100755 lending/docs/sdks/loanwritebackbanktransactions/README.md create mode 100755 lending/docs/sdks/loanwritebackcreateoperations/README.md create mode 100755 lending/docs/sdks/loanwritebackdirectcosts/README.md create mode 100755 lending/docs/sdks/loanwritebacksuppliers/README.md create mode 100755 lending/docs/sdks/loanwritebacktransfers/README.md create mode 100755 lending/loanwriteback.go create mode 100755 lending/loanwritebackaccounts.go create mode 100755 lending/loanwritebackbankaccounts.go create mode 100755 lending/loanwritebackbanktransactions.go create mode 100755 lending/loanwritebackcreateoperations.go create mode 100755 lending/loanwritebackdirectcosts.go create mode 100755 lending/loanwritebacksuppliers.go create mode 100755 lending/loanwritebacktransfers.go create mode 100755 lending/pkg/models/operations/createaccount.go create mode 100755 lending/pkg/models/operations/createbankaccount.go create mode 100755 lending/pkg/models/operations/createbanktransactions.go create mode 100755 lending/pkg/models/operations/createdirectcost.go create mode 100755 lending/pkg/models/operations/createsupplier.go create mode 100755 lending/pkg/models/operations/createtransfer.go create mode 100755 lending/pkg/models/operations/getcreatebanktransactionsmodel.go create mode 100755 lending/pkg/models/operations/getcreatechartofaccountsmodel.go create mode 100755 lending/pkg/models/operations/getcreatedirectcostsmodel.go create mode 100755 lending/pkg/models/operations/getcreateoperation.go create mode 100755 lending/pkg/models/operations/getcreatetransfersmodel.go create mode 100755 lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go create mode 100755 lending/pkg/models/operations/getcreateupdatesuppliersmodel.go create mode 100755 lending/pkg/models/operations/listcreateoperations.go create mode 100755 lending/pkg/models/shared/accountingcreateaccountresponse.go create mode 100755 lending/pkg/models/shared/accountingcreatebankaccountresponse.go create mode 100755 lending/pkg/models/shared/accountingcreatebanktransactions.go create mode 100755 lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go create mode 100755 lending/pkg/models/shared/accountingcreatedirectcostresponse.go create mode 100755 lending/pkg/models/shared/accountingcreatesupplierresponse.go create mode 100755 lending/pkg/models/shared/accountingcreatetransferresponse.go create mode 100755 lending/pkg/models/shared/createbankaccounttransaction.go create mode 100755 lending/pkg/models/shared/pushchangetype.go create mode 100755 lending/pkg/models/shared/pushfieldvalidation.go create mode 100755 lending/pkg/models/shared/pushoperation.go create mode 100755 lending/pkg/models/shared/pushoperationchange.go create mode 100755 lending/pkg/models/shared/pushoperationref.go create mode 100755 lending/pkg/models/shared/pushoperations.go create mode 100755 lending/pkg/models/shared/pushoperationstatus.go create mode 100755 lending/pkg/models/shared/pushoption.go create mode 100755 lending/pkg/models/shared/pushoptionchoice.go create mode 100755 lending/pkg/models/shared/pushoptionproperty.go create mode 100755 lending/pkg/models/shared/pushoptiontype.go create mode 100755 lending/pkg/models/shared/pushvalidationinfo.go create mode 100755 lending/pkg/models/shared/validation.go create mode 100755 lending/pkg/models/shared/validationitem.go create mode 100755 lending/pkg/utils/json.go diff --git a/lending/README.md b/lending/README.md index 8c082a8fb..a8dfd20f5 100644 --- a/lending/README.md +++ b/lending/README.md @@ -26,8 +26,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -37,10 +37,10 @@ func main() { AccountID: "corrupti", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("provident"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("provident"), }) if err != nil { log.Fatal(err) @@ -225,6 +225,42 @@ func main() { * [Get](docs/sdks/financialstatementsprofitandloss/README.md#get) - Get profit and loss * [GetCategorizedAccounts](docs/sdks/financialstatementsprofitandloss/README.md#getcategorizedaccounts) - Get categorized profit and loss statement + +### [LoanWriteback.Accounts](docs/sdks/loanwritebackaccounts/README.md) + +* [Create](docs/sdks/loanwritebackaccounts/README.md#create) - Create account +* [GetCreateModel](docs/sdks/loanwritebackaccounts/README.md#getcreatemodel) - Get create account model + +### [LoanWriteback.BankAccounts](docs/sdks/loanwritebackbankaccounts/README.md) + +* [Create](docs/sdks/loanwritebackbankaccounts/README.md#create) - Create bank account +* [GetCreateUpdateModel](docs/sdks/loanwritebackbankaccounts/README.md#getcreateupdatemodel) - Get create/update bank account model + +### [LoanWriteback.BankTransactions](docs/sdks/loanwritebackbanktransactions/README.md) + +* [Create](docs/sdks/loanwritebackbanktransactions/README.md#create) - Create bank account transactions +* [GetCreateModel](docs/sdks/loanwritebackbanktransactions/README.md#getcreatemodel) - Get create bank account transactions model + +### [LoanWriteback.CreateOperations](docs/sdks/loanwritebackcreateoperations/README.md) + +* [Get](docs/sdks/loanwritebackcreateoperations/README.md#get) - Get create operation +* [List](docs/sdks/loanwritebackcreateoperations/README.md#list) - List create operations + +### [LoanWriteback.DirectCosts](docs/sdks/loanwritebackdirectcosts/README.md) + +* [Create](docs/sdks/loanwritebackdirectcosts/README.md#create) - Create direct cost +* [GetCreateModel](docs/sdks/loanwritebackdirectcosts/README.md#getcreatemodel) - Get create direct cost model + +### [LoanWriteback.Suppliers](docs/sdks/loanwritebacksuppliers/README.md) + +* [Create](docs/sdks/loanwritebacksuppliers/README.md#create) - Create supplier +* [GetCreateUpdateModel](docs/sdks/loanwritebacksuppliers/README.md#getcreateupdatemodel) - Get create/update supplier model + +### [LoanWriteback.Transfers](docs/sdks/loanwritebacktransfers/README.md) + +* [Create](docs/sdks/loanwritebacktransfers/README.md#create) - Create transfer +* [GetCreateModel](docs/sdks/loanwritebacktransfers/README.md#getcreatemodel) - Get create transfer model + ### [ManageData](docs/sdks/managedata/README.md) * [GetStatus](docs/sdks/managedata/README.md#getstatus) - Get data status diff --git a/lending/RELEASES.md b/lending/RELEASES.md index 8572ef91f..65cd9e454 100644 --- a/lending/RELEASES.md +++ b/lending/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### Generated - [go v4.1.0] lending ### Releases -- [Go v4.1.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v4.1.0 - lending \ No newline at end of file +- [Go v4.1.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v4.1.0 - lending + +## 2023-09-20 21:31:15 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Lending.yaml +- Speakeasy CLI 1.88.1 (2.122.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v4.2.0] lending +### Releases +- [Go v4.2.0] https://github.com/codatio/client-sdk-go/releases/tag/lending/v4.2.0 - lending \ No newline at end of file diff --git a/lending/USAGE.md b/lending/USAGE.md index 02db67574..2cb4dd67c 100755 --- a/lending/USAGE.md +++ b/lending/USAGE.md @@ -13,8 +13,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -24,10 +24,10 @@ func main() { AccountID: "corrupti", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("provident"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("provident"), }) if err != nil { log.Fatal(err) diff --git a/lending/accountingbankdata.go b/lending/accountingbankdata.go index 024ead45e..0fde115ca 100755 --- a/lending/accountingbankdata.go +++ b/lending/accountingbankdata.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -120,12 +120,12 @@ func (s *accountingBankData) ListTransactions(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBankTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBankTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBankTransactions = out + res.AccountingBankTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -140,12 +140,12 @@ func (s *accountingBankData) ListTransactions(ctx context.Context, request opera case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountingbankdataaccounts.go b/lending/accountingbankdataaccounts.go index 317bf5dc9..ede7438c1 100755 --- a/lending/accountingbankdataaccounts.go +++ b/lending/accountingbankdataaccounts.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *accountingBankDataAccounts) Get(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBankAccount - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBankAccount + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBankAccount = out + res.AccountingBankAccount = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *accountingBankDataAccounts) Get(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *accountingBankDataAccounts) List(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBankAccounts - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBankAccounts + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBankAccounts = out + res.AccountingBankAccounts = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *accountingBankDataAccounts) List(ctx context.Context, request operation case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountspayable.go b/lending/accountspayable.go index 4e8485a51..9fc15a0b2 100755 --- a/lending/accountspayable.go +++ b/lending/accountspayable.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type accountsPayable struct { BillCreditNotes *accountsPayableBillCreditNotes diff --git a/lending/accountspayablebillcreditnotes.go b/lending/accountspayablebillcreditnotes.go index 4e48719bd..6f8b073b0 100755 --- a/lending/accountspayablebillcreditnotes.go +++ b/lending/accountspayablebillcreditnotes.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *accountsPayableBillCreditNotes) Get(ctx context.Context, request operat case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBillCreditNote - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBillCreditNote + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBillCreditNote = out + res.AccountingBillCreditNote = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *accountsPayableBillCreditNotes) Get(ctx context.Context, request operat case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *accountsPayableBillCreditNotes) List(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBillCreditNotes - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBillCreditNotes + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBillCreditNotes = out + res.AccountingBillCreditNotes = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *accountsPayableBillCreditNotes) List(ctx context.Context, request opera case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountspayablebillpayments.go b/lending/accountspayablebillpayments.go index fd03cb38e..3f7fe5a1f 100755 --- a/lending/accountspayablebillpayments.go +++ b/lending/accountspayablebillpayments.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *accountsPayableBillPayments) Get(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBillPayment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBillPayment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBillPayment = out + res.AccountingBillPayment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *accountsPayableBillPayments) Get(ctx context.Context, request operation case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *accountsPayableBillPayments) List(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBillPayments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBillPayments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBillPayments = out + res.AccountingBillPayments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *accountsPayableBillPayments) List(ctx context.Context, request operatio case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountspayablebills.go b/lending/accountspayablebills.go index be7276a4f..49167b582 100755 --- a/lending/accountspayablebills.go +++ b/lending/accountspayablebills.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *accountsPayableBills) DownloadAttachment(ctx context.Context, request o case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *accountsPayableBills) Get(ctx context.Context, request operations.GetAc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBill - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBill + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBill = out + res.AccountingBill = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -247,12 +247,12 @@ func (s *accountsPayableBills) Get(ctx context.Context, request operations.GetAc case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -347,12 +347,12 @@ func (s *accountsPayableBills) GetAttachment(ctx context.Context, request operat case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -363,12 +363,12 @@ func (s *accountsPayableBills) GetAttachment(ctx context.Context, request operat case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -467,12 +467,12 @@ func (s *accountsPayableBills) List(ctx context.Context, request operations.List case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBills - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBills + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBills = out + res.AccountingBills = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -485,12 +485,12 @@ func (s *accountsPayableBills) List(ctx context.Context, request operations.List case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -585,12 +585,12 @@ func (s *accountsPayableBills) ListAttachments(ctx context.Context, request oper case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -601,12 +601,12 @@ func (s *accountsPayableBills) ListAttachments(ctx context.Context, request oper case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountspayablesuppliers.go b/lending/accountspayablesuppliers.go index 9d7ff96f6..3f13f262d 100755 --- a/lending/accountspayablesuppliers.go +++ b/lending/accountspayablesuppliers.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *accountsPayableSuppliers) DownloadAttachment(ctx context.Context, reque case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *accountsPayableSuppliers) Get(ctx context.Context, request operations.G case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingSupplier - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingSupplier + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingSupplier = out + res.AccountingSupplier = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -247,12 +247,12 @@ func (s *accountsPayableSuppliers) Get(ctx context.Context, request operations.G case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -347,12 +347,12 @@ func (s *accountsPayableSuppliers) GetAttachment(ctx context.Context, request op case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -363,12 +363,12 @@ func (s *accountsPayableSuppliers) GetAttachment(ctx context.Context, request op case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -467,12 +467,12 @@ func (s *accountsPayableSuppliers) List(ctx context.Context, request operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingSuppliers - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingSuppliers + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingSuppliers = out + res.AccountingSuppliers = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -485,12 +485,12 @@ func (s *accountsPayableSuppliers) List(ctx context.Context, request operations. case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -585,12 +585,12 @@ func (s *accountsPayableSuppliers) ListAttachments(ctx context.Context, request case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -601,12 +601,12 @@ func (s *accountsPayableSuppliers) ListAttachments(ctx context.Context, request case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivable.go b/lending/accountsreceivable.go index f8e59bbc0..9ba6d407b 100755 --- a/lending/accountsreceivable.go +++ b/lending/accountsreceivable.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type accountsReceivable struct { CreditNotes *accountsReceivableCreditNotes diff --git a/lending/accountsreceivablecreditnotes.go b/lending/accountsreceivablecreditnotes.go index ec22041b6..b52080ff0 100755 --- a/lending/accountsreceivablecreditnotes.go +++ b/lending/accountsreceivablecreditnotes.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *accountsReceivableCreditNotes) Get(ctx context.Context, request operati case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCreditNote - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCreditNote + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCreditNote = out + res.AccountingCreditNote = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *accountsReceivableCreditNotes) Get(ctx context.Context, request operati case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *accountsReceivableCreditNotes) List(ctx context.Context, request operat case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCreditNotes - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCreditNotes + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCreditNotes = out + res.AccountingCreditNotes = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *accountsReceivableCreditNotes) List(ctx context.Context, request operat case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivablecustomers.go b/lending/accountsreceivablecustomers.go index 3e10f703a..f9d535f9f 100755 --- a/lending/accountsreceivablecustomers.go +++ b/lending/accountsreceivablecustomers.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *accountsReceivableCustomers) DownloadAttachment(ctx context.Context, re case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *accountsReceivableCustomers) Get(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCustomer - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCustomer + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCustomer = out + res.AccountingCustomer = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -247,12 +247,12 @@ func (s *accountsReceivableCustomers) Get(ctx context.Context, request operation case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -347,12 +347,12 @@ func (s *accountsReceivableCustomers) GetAttachment(ctx context.Context, request case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -363,12 +363,12 @@ func (s *accountsReceivableCustomers) GetAttachment(ctx context.Context, request case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -467,12 +467,12 @@ func (s *accountsReceivableCustomers) List(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCustomers - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCustomers + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCustomers = out + res.AccountingCustomers = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -485,12 +485,12 @@ func (s *accountsReceivableCustomers) List(ctx context.Context, request operatio case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -585,12 +585,12 @@ func (s *accountsReceivableCustomers) ListAttachments(ctx context.Context, reque case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -601,12 +601,12 @@ func (s *accountsReceivableCustomers) ListAttachments(ctx context.Context, reque case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivabledirectincomes.go b/lending/accountsreceivabledirectincomes.go index e18830efb..5fb129c51 100755 --- a/lending/accountsreceivabledirectincomes.go +++ b/lending/accountsreceivabledirectincomes.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *accountsReceivableDirectIncomes) DownloadAttachment(ctx context.Context case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *accountsReceivableDirectIncomes) Get(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingDirectIncome - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingDirectIncome + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingDirectIncome = out + res.AccountingDirectIncome = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -247,12 +247,12 @@ func (s *accountsReceivableDirectIncomes) Get(ctx context.Context, request opera case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -351,12 +351,12 @@ func (s *accountsReceivableDirectIncomes) GetAttachment(ctx context.Context, req case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -367,12 +367,12 @@ func (s *accountsReceivableDirectIncomes) GetAttachment(ctx context.Context, req case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -471,12 +471,12 @@ func (s *accountsReceivableDirectIncomes) List(ctx context.Context, request oper case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingDirectIncomes - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingDirectIncomes + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingDirectIncomes = out + res.AccountingDirectIncomes = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -489,12 +489,12 @@ func (s *accountsReceivableDirectIncomes) List(ctx context.Context, request oper case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -589,12 +589,12 @@ func (s *accountsReceivableDirectIncomes) ListAttachments(ctx context.Context, r case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -605,12 +605,12 @@ func (s *accountsReceivableDirectIncomes) ListAttachments(ctx context.Context, r case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivableinvoices.go b/lending/accountsreceivableinvoices.go index e455a27db..26fbbed04 100755 --- a/lending/accountsreceivableinvoices.go +++ b/lending/accountsreceivableinvoices.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *accountsReceivableInvoices) DownloadAttachment(ctx context.Context, req case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -320,12 +320,12 @@ func (s *accountsReceivableInvoices) Get(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingInvoice - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingInvoice + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingInvoice = out + res.AccountingInvoice = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -338,12 +338,12 @@ func (s *accountsReceivableInvoices) Get(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -438,12 +438,12 @@ func (s *accountsReceivableInvoices) GetAttachment(ctx context.Context, request case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -454,12 +454,12 @@ func (s *accountsReceivableInvoices) GetAttachment(ctx context.Context, request case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -565,12 +565,12 @@ func (s *accountsReceivableInvoices) List(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingInvoices - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingInvoices + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingInvoices = out + res.AccountingInvoices = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -583,12 +583,12 @@ func (s *accountsReceivableInvoices) List(ctx context.Context, request operation case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -683,12 +683,12 @@ func (s *accountsReceivableInvoices) ListAttachments(ctx context.Context, reques case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -699,12 +699,12 @@ func (s *accountsReceivableInvoices) ListAttachments(ctx context.Context, reques case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -799,12 +799,12 @@ func (s *accountsReceivableInvoices) ListReconciled(ctx context.Context, request case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.EnhancedInvoicesReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.EnhancedInvoicesReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.EnhancedInvoicesReport = out + res.EnhancedInvoicesReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -813,12 +813,12 @@ func (s *accountsReceivableInvoices) ListReconciled(ctx context.Context, request case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivablepayments.go b/lending/accountsreceivablepayments.go index 0f55ff449..902d73425 100755 --- a/lending/accountsreceivablepayments.go +++ b/lending/accountsreceivablepayments.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *accountsReceivablePayments) Get(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingPayment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingPayment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingPayment = out + res.AccountingPayment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *accountsReceivablePayments) Get(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *accountsReceivablePayments) List(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingPayments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingPayments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingPayments = out + res.AccountingPayments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *accountsReceivablePayments) List(ctx context.Context, request operation case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/accountsreceivablereports.go b/lending/accountsreceivablereports.go index 159e52515..ea82103ee 100755 --- a/lending/accountsreceivablereports.go +++ b/lending/accountsreceivablereports.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -110,12 +110,12 @@ func (s *accountsReceivableReports) GetAgedCreditors(ctx context.Context, reques case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAgedCreditorReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAgedCreditorReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAgedCreditorReport = out + res.AccountingAgedCreditorReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -126,12 +126,12 @@ func (s *accountsReceivableReports) GetAgedCreditors(ctx context.Context, reques case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -226,12 +226,12 @@ func (s *accountsReceivableReports) GetAgedDebtors(ctx context.Context, request case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAgedDebtorReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAgedDebtorReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAgedDebtorReport = out + res.AccountingAgedDebtorReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -242,12 +242,12 @@ func (s *accountsReceivableReports) GetAgedDebtors(ctx context.Context, request case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -338,12 +338,12 @@ func (s *accountsReceivableReports) IsAgedCreditorsAvailable(ctx context.Context case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *bool - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out bool + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.IsAgedCreditorsReportAvailable200ApplicationJSONBoolean = out + res.IsAgedCreditorsReportAvailable200ApplicationJSONBoolean = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -434,12 +434,12 @@ func (s *accountsReceivableReports) IsAgedDebtorsAvailable(ctx context.Context, case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *bool - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out bool + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.IsAgedDebtorsReportAvailable200ApplicationJSONBoolean = out + res.IsAgedDebtorsReportAvailable200ApplicationJSONBoolean = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/banking.go b/lending/banking.go index dab638cbe..e7ede0f83 100755 --- a/lending/banking.go +++ b/lending/banking.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type banking struct { AccountBalances *bankingAccountBalances diff --git a/lending/bankingaccountbalances.go b/lending/bankingaccountbalances.go index 08f41ef59..391573bf8 100755 --- a/lending/bankingaccountbalances.go +++ b/lending/bankingaccountbalances.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -114,12 +114,12 @@ func (s *bankingAccountBalances) List(ctx context.Context, request operations.Li case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingAccountBalances - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingAccountBalances + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingAccountBalances = out + res.BankingAccountBalances = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -132,12 +132,12 @@ func (s *bankingAccountBalances) List(ctx context.Context, request operations.Li case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/bankingaccounts.go b/lending/bankingaccounts.go index fadd94a7b..c91700b8b 100755 --- a/lending/bankingaccounts.go +++ b/lending/bankingaccounts.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *bankingAccounts) Get(ctx context.Context, request operations.GetBanking case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingAccount - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingAccount + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingAccount = out + res.BankingAccount = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -216,12 +216,12 @@ func (s *bankingAccounts) List(ctx context.Context, request operations.ListBanki case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingAccounts - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingAccounts + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingAccounts = out + res.BankingAccounts = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *bankingAccounts) List(ctx context.Context, request operations.ListBanki case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/bankingcategorizedstatement.go b/lending/bankingcategorizedstatement.go index 3f881411d..359e35ad7 100755 --- a/lending/bankingcategorizedstatement.go +++ b/lending/bankingcategorizedstatement.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -114,12 +114,12 @@ func (s *bankingCategorizedStatement) Get(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.EnhancedCashFlowTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.EnhancedCashFlowTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.EnhancedCashFlowTransactions = out + res.EnhancedCashFlowTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -128,12 +128,12 @@ func (s *bankingCategorizedStatement) Get(ctx context.Context, request operation case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/bankingtransactioncategories.go b/lending/bankingtransactioncategories.go index 6c64cb3fd..7c1113a87 100755 --- a/lending/bankingtransactioncategories.go +++ b/lending/bankingtransactioncategories.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *bankingTransactionCategories) Get(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingTransactionCategory - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingTransactionCategory + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingTransactionCategory = out + res.BankingTransactionCategory = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -216,12 +216,12 @@ func (s *bankingTransactionCategories) List(ctx context.Context, request operati case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingTransactionCategories - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingTransactionCategories + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingTransactionCategories = out + res.BankingTransactionCategories = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *bankingTransactionCategories) List(ctx context.Context, request operati case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/bankingtransactions.go b/lending/bankingtransactions.go index c5a410785..1cb831f82 100755 --- a/lending/bankingtransactions.go +++ b/lending/bankingtransactions.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *bankingTransactions) Get(ctx context.Context, request operations.GetBan case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingTransaction - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingTransaction + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingTransaction = out + res.BankingTransaction = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -216,12 +216,12 @@ func (s *bankingTransactions) List(ctx context.Context, request operations.ListB case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.BankingTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.BankingTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.BankingTransactions = out + res.BankingTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *bankingTransactions) List(ctx context.Context, request operations.ListB case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/codatlending.go b/lending/codatlending.go index 6e804f33a..a79214e9b 100755 --- a/lending/codatlending.go +++ b/lending/codatlending.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "fmt" @@ -108,6 +108,7 @@ type CodatLending struct { AccountsReceivable *accountsReceivable Banking *banking FinancialStatements *financialStatements + LoanWriteback *loanWriteback ManageData *manageData Sales *sales Transactions *transactions @@ -172,8 +173,8 @@ func New(opts ...SDKOption) *CodatLending { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "3.0.0", - SDKVersion: "4.1.0", - GenVersion: "2.116.0", + SDKVersion: "4.2.0", + GenVersion: "2.122.1", }, } for _, opt := range opts { @@ -216,6 +217,8 @@ func New(opts ...SDKOption) *CodatLending { sdk.FinancialStatements = newFinancialStatements(sdk.sdkConfiguration) + sdk.LoanWriteback = newLoanWriteback(sdk.sdkConfiguration) + sdk.ManageData = newManageData(sdk.sdkConfiguration) sdk.Sales = newSales(sdk.sdkConfiguration) diff --git a/lending/companies.go b/lending/companies.go index 0bb2393ad..ddafddb72 100755 --- a/lending/companies.go +++ b/lending/companies.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -30,7 +30,7 @@ func newCompanies(sdkConfig sdkConfiguration) *companies { // Creates a new company that can be used to assign connections to. // // 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`. -func (s *companies) Create(ctx context.Context, request shared.CompanyRequestBody, opts ...operations.Option) (*operations.CreateCompanyResponse, error) { +func (s *companies) Create(ctx context.Context, request *shared.CompanyRequestBody, opts ...operations.Option) (*operations.CreateCompanyResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -44,7 +44,7 @@ func (s *companies) Create(ctx context.Context, request shared.CompanyRequestBod baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) url := strings.TrimSuffix(baseURL, "/") + "/companies" - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -114,12 +114,12 @@ func (s *companies) Create(ctx context.Context, request shared.CompanyRequestBod case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Company - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Company + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Company = out + res.Company = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *companies) Create(ctx context.Context, request shared.CompanyRequestBod case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -232,12 +232,12 @@ func (s *companies) Delete(ctx context.Context, request operations.DeleteCompany case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -328,12 +328,12 @@ func (s *companies) Get(ctx context.Context, request operations.GetCompanyReques case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Company - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Company + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Company = out + res.Company = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -344,12 +344,12 @@ func (s *companies) Get(ctx context.Context, request operations.GetCompanyReques case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -441,12 +441,12 @@ func (s *companies) List(ctx context.Context, request operations.ListCompaniesRe case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Companies - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Companies + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Companies = out + res.Companies = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -457,12 +457,12 @@ func (s *companies) List(ctx context.Context, request operations.ListCompaniesRe case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -490,7 +490,7 @@ func (s *companies) Update(ctx context.Context, request operations.UpdateCompany return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "CompanyRequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "CompanyRequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -560,12 +560,12 @@ func (s *companies) Update(ctx context.Context, request operations.UpdateCompany case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Company - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Company + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Company = out + res.Company = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -576,12 +576,12 @@ func (s *companies) Update(ctx context.Context, request operations.UpdateCompany case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/companyinfo.go b/lending/companyinfo.go index 013d03495..a7e75544a 100755 --- a/lending/companyinfo.go +++ b/lending/companyinfo.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -107,12 +107,12 @@ func (s *companyInfo) GetAccountingProfile(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCompanyInfo - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCompanyInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCompanyInfo = out + res.AccountingCompanyInfo = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -125,12 +125,12 @@ func (s *companyInfo) GetAccountingProfile(ctx context.Context, request operatio case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -223,12 +223,12 @@ func (s *companyInfo) GetCommerceProfile(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceCompanyInfo - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceCompanyInfo + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceCompanyInfo = out + res.CommerceCompanyInfo = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -241,12 +241,12 @@ func (s *companyInfo) GetCommerceProfile(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/connections.go b/lending/connections.go index a327f1c84..8d2174ebc 100755 --- a/lending/connections.go +++ b/lending/connections.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -46,7 +46,7 @@ func (s *connections) Create(ctx context.Context, request operations.CreateConne return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -116,12 +116,12 @@ func (s *connections) Create(ctx context.Context, request operations.CreateConne case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Connection - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Connection + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Connection = out + res.Connection = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -132,12 +132,12 @@ func (s *connections) Create(ctx context.Context, request operations.CreateConne case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *connections) Delete(ctx context.Context, request operations.DeleteConne case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -330,12 +330,12 @@ func (s *connections) Get(ctx context.Context, request operations.GetConnectionR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Connection - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Connection + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Connection = out + res.Connection = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -346,12 +346,12 @@ func (s *connections) Get(ctx context.Context, request operations.GetConnectionR case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -446,12 +446,12 @@ func (s *connections) List(ctx context.Context, request operations.ListConnectio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Connections - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Connections + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Connections = out + res.Connections = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -464,12 +464,12 @@ func (s *connections) List(ctx context.Context, request operations.ListConnectio case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -497,7 +497,7 @@ func (s *connections) Unlink(ctx context.Context, request operations.UnlinkConne return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "json") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -567,12 +567,12 @@ func (s *connections) Unlink(ctx context.Context, request operations.UnlinkConne case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Connection - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Connection + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Connection = out + res.Connection = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -583,12 +583,12 @@ func (s *connections) Unlink(ctx context.Context, request operations.UnlinkConne case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/dataintegrity.go b/lending/dataintegrity.go index 4e5a82e0f..4fb91a7d0 100755 --- a/lending/dataintegrity.go +++ b/lending/dataintegrity.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -113,12 +113,12 @@ func (s *dataIntegrity) Details(ctx context.Context, request operations.ListData case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.DataIntegrityDetails - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.DataIntegrityDetails + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.DataIntegrityDetails = out + res.DataIntegrityDetails = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -127,12 +127,12 @@ func (s *dataIntegrity) Details(ctx context.Context, request operations.ListData case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -230,12 +230,12 @@ func (s *dataIntegrity) Status(ctx context.Context, request operations.GetDataIn case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.DataIntegrityStatuses - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.DataIntegrityStatuses + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.DataIntegrityStatuses = out + res.DataIntegrityStatuses = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -244,12 +244,12 @@ func (s *dataIntegrity) Status(ctx context.Context, request operations.GetDataIn case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -348,12 +348,12 @@ func (s *dataIntegrity) Summaries(ctx context.Context, request operations.GetDat case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.DataIntegritySummaries - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.DataIntegritySummaries + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.DataIntegritySummaries = out + res.DataIntegritySummaries = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -362,12 +362,12 @@ func (s *dataIntegrity) Summaries(ctx context.Context, request operations.GetDat case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/docs/models/operations/createaccountrequest.md b/lending/docs/models/operations/createaccountrequest.md new file mode 100755 index 000000000..6e2843e50 --- /dev/null +++ b/lending/docs/models/operations/createaccountrequest.md @@ -0,0 +1,13 @@ +# CreateAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingAccount` | [*shared.AccountingAccount](../../models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..93d37c715 --- /dev/null +++ b/lending/docs/models/operations/createaccountresponse.md @@ -0,0 +1,12 @@ +# CreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `AccountingCreateAccountResponse` | [*shared.AccountingCreateAccountResponse](../../models/shared/accountingcreateaccountresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..0e83afb96 --- /dev/null +++ b/lending/docs/models/operations/createbankaccountrequest.md @@ -0,0 +1,13 @@ +# CreateBankAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingBankAccount` | [*shared.AccountingBankAccount](../../models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..347611e60 --- /dev/null +++ b/lending/docs/models/operations/createbankaccountresponse.md @@ -0,0 +1,12 @@ +# CreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `AccountingCreateBankAccountResponse` | [*shared.AccountingCreateBankAccountResponse](../../models/shared/accountingcreatebankaccountresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..9d04b37a2 --- /dev/null +++ b/lending/docs/models/operations/createbanktransactionsrequest.md @@ -0,0 +1,14 @@ +# CreateBankTransactionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingCreateBankTransactions` | [*shared.AccountingCreateBankTransactions](../../models/shared/accountingcreatebanktransactions.md) | :heavy_minus_sign: | N/A | | +| `AccountID` | *string* | :heavy_check_mark: | Unique identifier for an account | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..833a060bf --- /dev/null +++ b/lending/docs/models/operations/createbanktransactionsresponse.md @@ -0,0 +1,12 @@ +# CreateBankTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `AccountingCreateBankTransactionsResponse` | [*shared.AccountingCreateBankTransactionsResponse](../../models/shared/accountingcreatebanktransactionsresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..b18461651 --- /dev/null +++ b/lending/docs/models/operations/createdirectcostrequest.md @@ -0,0 +1,13 @@ +# CreateDirectCostRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingDirectCost` | [*shared.AccountingDirectCost](../../models/shared/accountingdirectcost.md) | :heavy_minus_sign: | N/A | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..8bf00e403 --- /dev/null +++ b/lending/docs/models/operations/createdirectcostresponse.md @@ -0,0 +1,12 @@ +# CreateDirectCostResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `AccountingCreateDirectCostResponse` | [*shared.AccountingCreateDirectCostResponse](../../models/shared/accountingcreatedirectcostresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..8794b0696 --- /dev/null +++ b/lending/docs/models/operations/createsupplierrequest.md @@ -0,0 +1,13 @@ +# CreateSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingSupplier` | [*shared.AccountingSupplier](../../models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..9b5a3b623 --- /dev/null +++ b/lending/docs/models/operations/createsupplierresponse.md @@ -0,0 +1,12 @@ +# CreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `AccountingCreateSupplierResponse` | [*shared.AccountingCreateSupplierResponse](../../models/shared/accountingcreatesupplierresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..ea4fb4667 --- /dev/null +++ b/lending/docs/models/operations/createtransferrequest.md @@ -0,0 +1,13 @@ +# CreateTransferRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccountingTransfer` | [*shared.AccountingTransfer](../../models/shared/accountingtransfer.md) | :heavy_minus_sign: | N/A | | +| `AllowSyncOnPushComplete` | **bool* | :heavy_minus_sign: | N/A | | +| `CompanyID` | *string* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `ForceUpdate` | **bool* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..13d57fa21 --- /dev/null +++ b/lending/docs/models/operations/createtransferresponse.md @@ -0,0 +1,12 @@ +# CreateTransferResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `AccountingCreateTransferResponse` | [*shared.AccountingCreateTransferResponse](../../models/shared/accountingcreatetransferresponse.md) | :heavy_minus_sign: | Success | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..39c1fd4fb --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..0bbc390d9 --- /dev/null +++ b/lending/docs/models/operations/getcreatebanktransactionsmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateBankTransactionsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | Success | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..2b67ea578 --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..501637f0b --- /dev/null +++ b/lending/docs/models/operations/getcreatechartofaccountsmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateChartOfAccountsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..1bb4af565 --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..8dc94e20c --- /dev/null +++ b/lending/docs/models/operations/getcreatedirectcostsmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateDirectCostsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..c180878e4 --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `PushOperationKey` | *string* | :heavy_check_mark: | Push operation key. | | \ 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 100755 index 000000000..c1202ac32 --- /dev/null +++ b/lending/docs/models/operations/getcreateoperationresponse.md @@ -0,0 +1,12 @@ +# GetCreateOperationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOperation` | [*shared.PushOperation](../../models/shared/pushoperation.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..b2ae2864b --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..72188f7a0 --- /dev/null +++ b/lending/docs/models/operations/getcreatetransfersmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateTransfersModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..27280e2c6 --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..3253f2479 --- /dev/null +++ b/lending/docs/models/operations/getcreateupdatebankaccountsmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateBankAccountsModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..c09ae424e --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ConnectionID` | *string* | :heavy_check_mark: | N/A | 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 100755 index 000000000..01814d9e2 --- /dev/null +++ b/lending/docs/models/operations/getcreateupdatesuppliersmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateSuppliersModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `PushOption` | [*shared.PushOption](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..7d9a77fb2 --- /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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `OrderBy` | **string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `Page` | **int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `PageSize` | **int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `Query` | **string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ 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 100755 index 000000000..ccc753ee0 --- /dev/null +++ b/lending/docs/models/operations/listcreateoperationsresponse.md @@ -0,0 +1,12 @@ +# ListCreateOperationsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | N/A | +| `ErrorMessage` | [*shared.ErrorMessage](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `PushOperations` | [*shared.PushOperations](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/accountbalance.md b/lending/docs/models/shared/accountbalance.md index 40649580e..afe626e0e 100755 --- a/lending/docs/models/shared/accountbalance.md +++ b/lending/docs/models/shared/accountbalance.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| `Available` | **types.Decimal* | :heavy_minus_sign: | The account's current balance | | -| `Currency` | **string* | :heavy_minus_sign: | The currency of the account | GBP | -| `Pending` | **types.Decimal* | :heavy_minus_sign: | Funds that are not yet available in the balance | | -| `Reserved` | *interface{}* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Available` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The account's current balance | | +| `Currency` | **string* | :heavy_minus_sign: | The currency of the account | GBP | +| `Pending` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Funds that are not yet available in the balance | | +| `Reserved` | *interface{}* | :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 index d3d177556..d55806933 100755 --- a/lending/docs/models/shared/accountbalanceamounts.md +++ b/lending/docs/models/shared/accountbalanceamounts.md @@ -7,6 +7,6 @@ Depending on the data provided by the underlying bank, not all balances are alwa | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `Available` | **types.Decimal* | :heavy_minus_sign: | The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. | -| `Current` | **types.Decimal* | :heavy_minus_sign: | The balance of the account only including cleared transactions. | -| `Limit` | **types.Decimal* | :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 +| `Available` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. | +| `Current` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The balance of the account only including cleared transactions. | +| `Limit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/accountcategorylevel.md b/lending/docs/models/shared/accountcategorylevel.md index fd11231b4..58b3dd76d 100755 --- a/lending/docs/models/shared/accountcategorylevel.md +++ b/lending/docs/models/shared/accountcategorylevel.md @@ -7,5 +7,5 @@ An object containing an ordered list of account category levels. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Confidence` | **types.Decimal* | :heavy_minus_sign: | Confidence level of the category. This will only be populated where `status` is `Suggested`. | +| `Confidence` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Confidence level of the category. This will only be populated where `status` is `Suggested`. | | `LevelName` | **string* | :heavy_minus_sign: | Account category name. | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingaccount.md b/lending/docs/models/shared/accountingaccount.md index 91132b71b..7c2e0181c 100755 --- a/lending/docs/models/shared/accountingaccount.md +++ b/lending/docs/models/shared/accountingaccount.md @@ -35,7 +35,7 @@ To determine the list of allowed categories for a specific integration, you can: | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `CurrentBalance` | **types.Decimal* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `CurrentBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Current balance in the account. | 0 | | `Description` | **string* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | | `FullyQualifiedCategory` | **string* | :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` | **string* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | diff --git a/lending/docs/models/shared/accountingaccounttransaction.md b/lending/docs/models/shared/accountingaccounttransaction.md index 7fb05186c..00260b1b3 100755 --- a/lending/docs/models/shared/accountingaccounttransaction.md +++ b/lending/docs/models/shared/accountingaccounttransaction.md @@ -25,7 +25,7 @@ Account transactions is the parent data type of [payments](https://docs.codat.io | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `BankAccountRef` | [*BankAccountRef](../../models/shared/bankaccountref.md) | :heavy_minus_sign: | Links to the Account transactions data type. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | Identifier of the direct cost (unique to the company). | | | `Lines` | [][AccountTransactionLine](../../models/shared/accounttransactionline.md) | :heavy_minus_sign: | Array of account transaction lines. | | @@ -34,5 +34,5 @@ Account transactions is the parent data type of [payments](https://docs.codat.io | `Note` | **string* | :heavy_minus_sign: | Additional information about the account transaction, if available. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [*AccountingAccountTransactionStatus](../../models/shared/accountingaccounttransactionstatus.md) | :heavy_minus_sign: | The status of the account transaction. | | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | Total amount of the account transactions, inclusive of tax. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the account transactions, inclusive of tax. | | | `TransactionID` | **string* | :heavy_minus_sign: | Identifier of the transaction (unique to the company). | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingbankaccount.md b/lending/docs/models/shared/accountingbankaccount.md index 0f60dc572..e3dc7ff90 100755 --- a/lending/docs/models/shared/accountingbankaccount.md +++ b/lending/docs/models/shared/accountingbankaccount.md @@ -25,8 +25,8 @@ Bank accounts data includes: | `AccountName` | **string* | :heavy_minus_sign: | Name of the bank account in the accounting platform. | | | `AccountNumber` | **string* | :heavy_minus_sign: | Account number for the bank account.

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

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | | `AccountType` | [*AccountingBankAccountType](../../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` | **types.Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `Balance` | **types.Decimal* | :heavy_minus_sign: | Balance of the bank account. | | +| `AvailableBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Balance of the bank account. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `IBan` | **string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | | `ID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | | @@ -34,6 +34,6 @@ Bank accounts data includes: | `Metadata` | [*Metadata](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `NominalCode` | **string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `OverdraftLimit` | **types.Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +| `OverdraftLimit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | **string* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingbanktransaction.md b/lending/docs/models/shared/accountingbanktransaction.md index 887bc901e..3a6ae70c3 100755 --- a/lending/docs/models/shared/accountingbanktransaction.md +++ b/lending/docs/models/shared/accountingbanktransaction.md @@ -23,8 +23,8 @@ Bank transactions include the: | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountID` | **string* | :heavy_minus_sign: | N/A | | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | N/A | | -| `Balance` | **types.Decimal* | :heavy_minus_sign: | N/A | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | | `ClearedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Description` | **string* | :heavy_minus_sign: | N/A | | | `ID` | **string* | :heavy_minus_sign: | N/A | | diff --git a/lending/docs/models/shared/accountingbill.md b/lending/docs/models/shared/accountingbill.md index 9691cae59..9e8587cc4 100755 --- a/lending/docs/models/shared/accountingbill.md +++ b/lending/docs/models/shared/accountingbill.md @@ -25,9 +25,9 @@ You can find these types of transactions in our [Direct costs](https://docs.coda | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AmountDue` | **types.Decimal* | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount outstanding on the bill. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `DueDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting platform. | | | `IssueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00.000Z | @@ -40,9 +40,9 @@ You can find these types of transactions in our [Direct costs](https://docs.coda | `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the bill. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | -| `SubTotal` | *types.Decimal* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `SupplierRef` | [*SupplierRef](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | -| `TaxAmount` | *types.Decimal* | :heavy_check_mark: | Amount of tax on the bill. | | -| `TotalAmount` | *types.Decimal* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the bill. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the bill, including tax. | | | `WithholdingTax` | [][AccountingBillWithholdingTax](../../models/shared/accountingbillwithholdingtax.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 index c38e9020f..243537738 100755 --- a/lending/docs/models/shared/accountingbillcreditnote.md +++ b/lending/docs/models/shared/accountingbillcreditnote.md @@ -25,8 +25,8 @@ A bill credit note includes details of: | `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `BillCreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | -| `DiscountPercentage` | *types.Decimal* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | | `ID` | **string* | :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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `LineItems` | [][BillCreditNoteLineItem](../../models/shared/billcreditnotelineitem.md) | :heavy_minus_sign: | An array of line | | @@ -34,13 +34,13 @@ A bill credit note includes details of: | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Note` | **string* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | | `PaymentAllocations` | [][AccountingPaymentAllocation](../../models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `RemainingCredit` | **types.Decimal* | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [BillCreditNoteStatus](../../models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | -| `SubTotal` | *types.Decimal* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `SupplierRef` | [*SupplierRef](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | -| `TotalAmount` | *types.Decimal* | :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` | *types.Decimal* | :heavy_check_mark: | Total value of any discounts applied. | 0 | -| `TotalTaxAmount` | *types.Decimal* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | | `WithholdingTax` | [][Items](../../models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingbillpayment.md b/lending/docs/models/shared/accountingbillpayment.md index eb29f2c25..8b2b42aa0 100755 --- a/lending/docs/models/shared/accountingbillpayment.md +++ b/lending/docs/models/shared/accountingbillpayment.md @@ -159,7 +159,7 @@ These two rates allow the calculation of currency loss or gain for any of the tr | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | | `Currency` | **string* | :heavy_minus_sign: | N/A | GBP | -| `CurrencyRate` | **types.Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `Date` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting platform. | 3d5a8e00-d108-4045-8823-7f342676cffa | | `Lines` | [][BillPaymentLine](../../models/shared/billpaymentline.md) | :heavy_minus_sign: | An array of bill payment lines. | | @@ -171,4 +171,4 @@ These two rates allow the calculation of currency loss or gain for any of the tr | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `SupplierRef` | [*SupplierRef](../../models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | -| `TotalAmount` | **types.Decimal* | :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 +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/accountingbillwithholdingtax.md b/lending/docs/models/shared/accountingbillwithholdingtax.md index d7afd4c0e..821f0936a 100755 --- a/lending/docs/models/shared/accountingbillwithholdingtax.md +++ b/lending/docs/models/shared/accountingbillwithholdingtax.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Amount` | *types.Decimal* | :heavy_check_mark: | N/A | -| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ 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 100755 index 000000000..1bbffcd6c --- /dev/null +++ b/lending/docs/models/shared/accountingcreateaccountresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingAccount](../../models/shared/accountingaccount.md) | :heavy_minus_sign: | > **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/accounting-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. | | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreatebankaccountresponse.md b/lending/docs/models/shared/accountingcreatebankaccountresponse.md new file mode 100755 index 000000000..5798b1781 --- /dev/null +++ b/lending/docs/models/shared/accountingcreatebankaccountresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateBankAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingBankAccount](../../models/shared/accountingbankaccount.md) | :heavy_minus_sign: | > **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/banking-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. | | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreatebanktransactions.md b/lending/docs/models/shared/accountingcreatebanktransactions.md new file mode 100755 index 000000000..43c035a8c --- /dev/null +++ b/lending/docs/models/shared/accountingcreatebanktransactions.md @@ -0,0 +1,9 @@ +# AccountingCreateBankTransactions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `AccountID` | **string* | :heavy_minus_sign: | N/A | +| `Transactions` | [][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 100755 index 000000000..efba63925 --- /dev/null +++ b/lending/docs/models/shared/accountingcreatebanktransactionsresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateBankTransactionsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingCreateBankTransactions](../../models/shared/accountingcreatebanktransactions.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` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreatedirectcostresponse.md b/lending/docs/models/shared/accountingcreatedirectcostresponse.md new file mode 100755 index 000000000..1ca861ab9 --- /dev/null +++ b/lending/docs/models/shared/accountingcreatedirectcostresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateDirectCostResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingDirectCost](../../models/shared/accountingdirectcost.md) | :heavy_minus_sign: | > **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/accounting-api#/schemas/AccountTransaction). | | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreatesupplierresponse.md b/lending/docs/models/shared/accountingcreatesupplierresponse.md new file mode 100755 index 000000000..084bbf6fe --- /dev/null +++ b/lending/docs/models/shared/accountingcreatesupplierresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingSupplier](../../models/shared/accountingsupplier.md) | :heavy_minus_sign: | > 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). | | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreatetransferresponse.md b/lending/docs/models/shared/accountingcreatetransferresponse.md new file mode 100755 index 000000000..aa379da9d --- /dev/null +++ b/lending/docs/models/shared/accountingcreatetransferresponse.md @@ -0,0 +1,21 @@ +# AccountingCreateTransferResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Data` | [*AccountingTransfer](../../models/shared/accountingtransfer.md) | :heavy_minus_sign: | > 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/accounting-api#/schemas/AccountTransaction). | | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingcreditnote.md b/lending/docs/models/shared/accountingcreditnote.md index b04fb69f6..af278fdac 100755 --- a/lending/docs/models/shared/accountingcreditnote.md +++ b/lending/docs/models/shared/accountingcreditnote.md @@ -18,14 +18,14 @@ It contains details of: | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdditionalTaxAmount` | **types.Decimal* | :heavy_minus_sign: | N/A | | -| `AdditionalTaxPercentage` | **types.Decimal* | :heavy_minus_sign: | N/A | | +| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | | `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `CreditNoteNumber` | **string* | :heavy_minus_sign: | Friendly reference for the credit note. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `CustomerRef` | [*AccountingCustomerRef](../../models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `DiscountPercentage` | *types.Decimal* | :heavy_check_mark: | Percentage rate (from 0 to 100) of discounts applied to the credit note. | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Percentage rate (from 0 to 100) of discounts applied to the credit note. | | | `ID` | **string* | :heavy_minus_sign: | Identifier for the credit note, unique to the company in the accounting platform. | | | `IssueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `LineItems` | [][CreditNoteLineItem](../../models/shared/creditnotelineitem.md) | :heavy_minus_sign: | N/A | | @@ -33,12 +33,12 @@ It contains details of: | `ModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Note` | **string* | :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` | [][AccountingPaymentAllocation](../../models/shared/accountingpaymentallocation.md) | :heavy_minus_sign: | An array of payment allocations. | | -| `RemainingCredit` | *types.Decimal* | :heavy_check_mark: | Unused balance of totalAmount originally raised. | | +| `RemainingCredit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unused balance of totalAmount originally raised. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [CreditNoteStatus](../../models/shared/creditnotestatus.md) | :heavy_check_mark: | N/A | | -| `SubTotal` | *types.Decimal* | :heavy_check_mark: | Value of the credit note, including discounts and excluding tax. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Value of the credit note, including discounts and excluding tax. | | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | *types.Decimal* | :heavy_check_mark: | Total amount of credit that has been applied to the customer's accounts receivable | | -| `TotalDiscount` | *types.Decimal* | :heavy_check_mark: | Any discounts applied to the credit note amount. | | -| `TotalTaxAmount` | *types.Decimal* | :heavy_check_mark: | Any tax applied to the credit note amount. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Total amount of credit that has been applied to the customer's accounts receivable | | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any discounts applied to the credit note amount. | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Any tax applied to the credit note amount. | | | `WithholdingTax` | [][Items](../../models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingdirectcost.md b/lending/docs/models/shared/accountingdirectcost.md index ea9ac12dc..95692771c 100755 --- a/lending/docs/models/shared/accountingdirectcost.md +++ b/lending/docs/models/shared/accountingdirectcost.md @@ -23,7 +23,7 @@ Direct costs is a child data type of [account transactions](https://docs.codat.i | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ContactRef` | [*ContactRef](../../models/shared/contactref.md) | :heavy_minus_sign: | The customer or supplier for the transfer, if available. | | | `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` | **types.Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `ID` | **string* | :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-23T00:00:00.000Z | | `LineItems` | [][DirectCostLineItem](../../models/shared/directcostlineitem.md) | :heavy_check_mark: | An array of line items. | | @@ -33,7 +33,7 @@ Direct costs is a child data type of [account transactions](https://docs.codat.i | `PaymentAllocations` | [][AccountingPaymentAllocation](../../models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | An array of payment allocations. | | | `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct cost. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `SubTotal` | *types.Decimal* | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct costs, excluding any taxes. | | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | *types.Decimal* | :heavy_check_mark: | The total amount of tax on the direct costs. | | -| `TotalAmount` | *types.Decimal* | :heavy_check_mark: | The amount of the direct costs, inclusive of tax. | | \ No newline at end of file +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct costs. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/accountingdirectincome.md b/lending/docs/models/shared/accountingdirectincome.md index d17520068..25442acdf 100755 --- a/lending/docs/models/shared/accountingdirectincome.md +++ b/lending/docs/models/shared/accountingdirectincome.md @@ -24,7 +24,7 @@ Direct incomes is a child data type of [account transactions](https://docs.codat | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ContactRef` | [*ContactRef](../../models/shared/contactref.md) | :heavy_minus_sign: | The customer or supplier for the transfer, if available. | | | `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` | **types.Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `ID` | **string* | :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-23T00:00:00.000Z | | `LineItems` | [][DirectIncomeLineItem](../../models/shared/directincomelineitem.md) | :heavy_check_mark: | An array of line items. | | @@ -34,7 +34,7 @@ Direct incomes is a child data type of [account transactions](https://docs.codat | `PaymentAllocations` | [][AccountingPaymentAllocation](../../models/shared/accountingpaymentallocation.md) | :heavy_check_mark: | N/A | | | `Reference` | **string* | :heavy_minus_sign: | User-friendly reference for the direct income. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `SubTotal` | *types.Decimal* | :heavy_check_mark: | The total amount of the direct incomes, excluding any taxes. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of the direct incomes, excluding any taxes. | | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `TaxAmount` | *types.Decimal* | :heavy_check_mark: | The total amount of tax on the direct incomes. | | -| `TotalAmount` | *types.Decimal* | :heavy_check_mark: | The amount of the direct incomes, inclusive of tax. | | \ No newline at end of file +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | The total amount of tax on the direct incomes. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/accountinginvoice.md b/lending/docs/models/shared/accountinginvoice.md index 0e9aaa02e..b3efc80cb 100755 --- a/lending/docs/models/shared/accountinginvoice.md +++ b/lending/docs/models/shared/accountinginvoice.md @@ -35,13 +35,13 @@ In Codat, an invoice contains details of: | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AdditionalTaxAmount` | **types.Decimal* | :heavy_minus_sign: | N/A | | -| `AdditionalTaxPercentage` | **types.Decimal* | :heavy_minus_sign: | N/A | | -| `AmountDue` | *types.Decimal* | :heavy_check_mark: | Amount outstanding on the invoice. | | +| `AdditionalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `AdditionalTaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount outstanding on the invoice. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `CustomerRef` | [*AccountingCustomerRef](../../models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | | -| `DiscountPercentage` | **types.Decimal* | :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`. | | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | Identifier for the invoice, unique to the company in the accounting platform. | | | `InvoiceNumber` | **string* | :heavy_minus_sign: | Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. | | @@ -55,9 +55,9 @@ In Codat, an invoice contains details of: | `SalesOrderRefs` | [][AccountingInvoiceSalesOrderReference](../../models/shared/accountinginvoicesalesorderreference.md) | :heavy_minus_sign: | List of references to related Sales orders. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the invoice excluding any taxes. | | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the invoice excluding any taxes. | | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | *types.Decimal* | :heavy_check_mark: | Amount of the invoice, inclusive of tax. | | -| `TotalDiscount` | **types.Decimal* | :heavy_minus_sign: | Numerical value of discounts applied to the invoice. | | -| `TotalTaxAmount` | *types.Decimal* | :heavy_check_mark: | Amount of tax on the invoice. | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of the invoice, inclusive of tax. | | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Numerical value of discounts applied to the invoice. | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount of tax on the invoice. | | | `WithholdingTax` | [][Items](../../models/shared/items.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/accountingpayment.md b/lending/docs/models/shared/accountingpayment.md index 67a28c415..2ae127cd7 100755 --- a/lending/docs/models/shared/accountingpayment.md +++ b/lending/docs/models/shared/accountingpayment.md @@ -686,7 +686,7 @@ In this example, a payment on account is used to pay the same invoice in January | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `CustomerRef` | [*AccountingCustomerRef](../../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-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | | @@ -698,4 +698,4 @@ In this example, a payment on account is used to pay the same invoice in January | `Reference` | **string* | :heavy_minus_sign: | Friendly reference for the payment. | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `SupplementalData` | [*SupplementalData](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | -| `TotalAmount` | **types.Decimal* | :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 +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/accountingpaymentallocationallocation.md b/lending/docs/models/shared/accountingpaymentallocationallocation.md index 809dc2872..00ca6d62c 100755 --- a/lending/docs/models/shared/accountingpaymentallocationallocation.md +++ b/lending/docs/models/shared/accountingpaymentallocationallocation.md @@ -7,5 +7,5 @@ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/lending/docs/models/shared/accounts.md b/lending/docs/models/shared/accounts.md index f3f6e94cf..470e5b86a 100755 --- a/lending/docs/models/shared/accounts.md +++ b/lending/docs/models/shared/accounts.md @@ -9,6 +9,6 @@ | `AccountProvider` | **string* | :heavy_minus_sign: | The bank or other financial institution providing the account. | | | `AccountType` | **string* | :heavy_minus_sign: | The type of banking account, e.g. credit or debit. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `CurrentBalance` | **types.Decimal* | :heavy_minus_sign: | The balance of the bank account. | | +| `CurrentBalance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The balance of the bank account. | | | `PlatformName` | **string* | :heavy_minus_sign: | Name of the banking data source, e.g. "Plaid". | | | `SourceRef` | [*SourceRef](../../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/accounttransactionline.md b/lending/docs/models/shared/accounttransactionline.md index 6261ad5c1..fb46563c3 100755 --- a/lending/docs/models/shared/accounttransactionline.md +++ b/lending/docs/models/shared/accounttransactionline.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | Amount in the bill payment currency. | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount in the bill payment currency. | | `Description` | **string* | :heavy_minus_sign: | Description of the account transaction. | | `RecordRef` | [*RecordRef](../../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. | \ No newline at end of file diff --git a/lending/docs/models/shared/agedoutstandingamount.md b/lending/docs/models/shared/agedoutstandingamount.md index 2b9a091f2..c6cf1bfc0 100755 --- a/lending/docs/models/shared/agedoutstandingamount.md +++ b/lending/docs/models/shared/agedoutstandingamount.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The amount outstanding. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The amount outstanding. | | | `Details` | [][AgedOutstandingAmountDetail](../../models/shared/agedoutstandingamountdetail.md) | :heavy_minus_sign: | Array of details. | | | `FromDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

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

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/lending/docs/models/shared/agedoutstandingamountdetail.md b/lending/docs/models/shared/agedoutstandingamountdetail.md index 84e718003..12cf79508 100755 --- a/lending/docs/models/shared/agedoutstandingamountdetail.md +++ b/lending/docs/models/shared/agedoutstandingamountdetail.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The amount outstanding. | -| `Name` | **string* | :heavy_minus_sign: | Name of data type with outstanding amount for given period. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The amount outstanding. | +| `Name` | **string* | :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/balancesheet.md b/lending/docs/models/shared/balancesheet.md index 8ed4fc00c..d368a4c44 100755 --- a/lending/docs/models/shared/balancesheet.md +++ b/lending/docs/models/shared/balancesheet.md @@ -9,4 +9,4 @@ | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Equity` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `Liabilities` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | -| `NetAssets` | *types.Decimal* | :heavy_check_mark: | Value of net assets for a company in their base currency. | | \ No newline at end of file +| `NetAssets` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/bankingtransaction.md b/lending/docs/models/shared/bankingtransaction.md index 795fc2c60..51db52b7e 100755 --- a/lending/docs/models/shared/bankingtransaction.md +++ b/lending/docs/models/shared/bankingtransaction.md @@ -12,7 +12,7 @@ View the coverage for banking transactions in the [Data Coverage Explorer](https | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountID` | *string* | :heavy_check_mark: | The unique identifier of the bank account. | | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The amount of the bank transaction. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The amount of the bank transaction. | | | `AuthorizedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Code` | [*TransactionCode](../../models/shared/transactioncode.md) | :heavy_minus_sign: | Code to identify the underlying transaction. | | | `Currency` | *string* | :heavy_check_mark: | The currency of the bank transaction. | | diff --git a/lending/docs/models/shared/bankingtransactionref.md b/lending/docs/models/shared/bankingtransactionref.md index 93e114903..a3ff691dc 100755 --- a/lending/docs/models/shared/bankingtransactionref.md +++ b/lending/docs/models/shared/bankingtransactionref.md @@ -7,7 +7,7 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountID` | **string* | :heavy_minus_sign: | N/A | | | `AccountName` | **string* | :heavy_minus_sign: | N/A | | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | N/A | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | | `DataConnectionID` | **string* | :heavy_minus_sign: | N/A | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Description` | **string* | :heavy_minus_sign: | N/A | | diff --git a/lending/docs/models/shared/billcreditnotelineitem.md b/lending/docs/models/shared/billcreditnotelineitem.md index ce0b452c7..e4b2dc0bb 100755 --- a/lending/docs/models/shared/billcreditnotelineitem.md +++ b/lending/docs/models/shared/billcreditnotelineitem.md @@ -7,14 +7,14 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been received. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Value of any discounts applied. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Value of any discounts applied. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | | `ItemRef` | [*BillCreditNoteLineItemItemReference](../../models/shared/billcreditnotelineitemitemreference.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :heavy_check_mark: | Number of units of the goods or service for which credit has been received. | -| `SubTotal` | **types.Decimal* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Number of units of the goods or service for which credit has been received. | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of tax associated with the line item. | | `TaxRateRef` | [*BillCreditNoteLineItemTaxRateReference](../../models/shared/billcreditnotelineitemtaxratereference.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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | | `Tracking` | [*AccountsPayableTracking](../../models/shared/accountspayabletracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | | ~~`TrackingCategoryRefs`~~ | [][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` | *types.Decimal* | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file diff --git a/lending/docs/models/shared/billcreditnotelineitemtaxratereference.md b/lending/docs/models/shared/billcreditnotelineitemtaxratereference.md index 58edd3422..0b3a7ae53 100755 --- a/lending/docs/models/shared/billcreditnotelineitemtaxratereference.md +++ b/lending/docs/models/shared/billcreditnotelineitemtaxratereference.md @@ -14,8 +14,8 @@ Found on: ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `EffectiveTaxRate` | **types.Decimal* | :heavy_minus_sign: | Applicable tax rate. | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `EffectiveTaxRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Applicable tax rate. | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | +| `Name` | **string* | :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/billlineitem.md b/lending/docs/models/shared/billlineitem.md index cb05100c2..92fd654a6 100755 --- a/lending/docs/models/shared/billlineitem.md +++ b/lending/docs/models/shared/billlineitem.md @@ -7,15 +7,15 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of the goods or services received. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Numerical value of any discounts applied.

Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | N/A | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Numerical value of any discounts applied.

Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | `IsDirectCost` | **bool* | :heavy_minus_sign: | N/A | | `ItemRef` | [*ItemRef](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :heavy_check_mark: | Number of units of goods or services received. | -| `SubTotal` | **types.Decimal* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of tax for the line. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Number of units of goods or services received. | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of tax for the line. | | `TaxRateRef` | [*TaxRateRef](../../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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the line, including tax. | | `Tracking` | [*AccountsPayableTracking](../../models/shared/accountspayabletracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | | `TrackingCategoryRefs` | [][TrackingCategoryRef](../../models/shared/trackingcategoryref.md) | :heavy_minus_sign: | Collection of categories against which this item is tracked. | -| `UnitAmount` | *types.Decimal* | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file diff --git a/lending/docs/models/shared/billpaymentline.md b/lending/docs/models/shared/billpaymentline.md index 86372c7cb..8568f613b 100755 --- a/lending/docs/models/shared/billpaymentline.md +++ b/lending/docs/models/shared/billpaymentline.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `Amount` | *types.Decimal* | :heavy_check_mark: | Amount in the bill payment currency. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount in the bill payment currency. | | | `Links` | [][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 index 40620fad1..7ccdfda28 100755 --- a/lending/docs/models/shared/billpaymentlinelink.md +++ b/lending/docs/models/shared/billpaymentlinelink.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :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` | **types.Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | | `Type` | [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/commerceorder.md b/lending/docs/models/shared/commerceorder.md index 3de856b94..980a6865a 100755 --- a/lending/docs/models/shared/commerceorder.md +++ b/lending/docs/models/shared/commerceorder.md @@ -24,8 +24,8 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `ServiceCharges` | [][ServiceCharge](../../models/shared/servicecharge.md) | :heavy_minus_sign: | N/A | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `SupplementalData` | [*CommerceOrderSupplementalData](../../models/shared/commerceordersupplementaldata.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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the order, including tax, net of any discounts and refunds. | | -| `TotalDiscount` | **types.Decimal* | :heavy_minus_sign: | Total amount of discount applied to the order. | | -| `TotalGratuity` | **types.Decimal* | :heavy_minus_sign: | Extra amount added to a bill. | | -| `TotalRefund` | **types.Decimal* | :heavy_minus_sign: | Total amount refunded issued by a merchant on an order (always a negative value). | | -| `TotalTaxAmount` | **types.Decimal* | :heavy_minus_sign: | Total amount of tax applied to the order. | | \ No newline at end of file +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the order, including tax, net of any discounts and refunds. | | +| `TotalDiscount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of discount applied to the order. | | +| `TotalGratuity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Extra amount added to a bill. | | +| `TotalRefund` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount refunded issued by a merchant on an order (always a negative value). | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of tax applied to the order. | | \ No newline at end of file diff --git a/lending/docs/models/shared/commercepayment.md b/lending/docs/models/shared/commercepayment.md index ba0d8c396..c38f92a22 100755 --- a/lending/docs/models/shared/commercepayment.md +++ b/lending/docs/models/shared/commercepayment.md @@ -13,7 +13,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | Payment Amount (including gratuity) | 194.12 | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Payment Amount (including gratuity) | 194.12 | | `CreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | diff --git a/lending/docs/models/shared/commercetransaction.md b/lending/docs/models/shared/commercetransaction.md index 33932ea8a..7ebd6ddbf 100755 --- a/lending/docs/models/shared/commercetransaction.md +++ b/lending/docs/models/shared/commercetransaction.md @@ -23,6 +23,6 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `SourceCreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `SubType` | **string* | :heavy_minus_sign: | Non-standardised transaction type data from the commerce platform | CardPayment | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | The total transaction amount | 194.12 | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total transaction amount | 194.12 | | `TransactionSourceRef` | [*TransactionSourceRef](../../models/shared/transactionsourceref.md) | :heavy_minus_sign: | Link to the source event which triggered this transaction | | | `Type` | [*TransactionType](../../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/createbankaccounttransaction.md b/lending/docs/models/shared/createbankaccounttransaction.md new file mode 100755 index 000000000..4dc2f3416 --- /dev/null +++ b/lending/docs/models/shared/createbankaccounttransaction.md @@ -0,0 +1,12 @@ +# CreateBankAccountTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | +| `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `Description` | **string* | :heavy_minus_sign: | N/A | | +| `ID` | **string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/creditnotelineitem.md b/lending/docs/models/shared/creditnotelineitem.md index 6c9e3bc9b..f401508ab 100755 --- a/lending/docs/models/shared/creditnotelineitem.md +++ b/lending/docs/models/shared/creditnotelineitem.md @@ -7,15 +7,15 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been issued. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Value of any discounts applied. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Value of any discounts applied. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | | `IsDirectIncome` | **bool* | :heavy_minus_sign: | N/A | | `ItemRef` | [*ItemRef](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :heavy_check_mark: | Number of units of the goods or service for which credit has been issued. | -| `SubTotal` | **types.Decimal* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Number of units of the goods or service for which credit has been issued. | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of tax associated with the line item. | | `TaxRateRef` | [*TaxRateRef](../../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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | | `Tracking` | [*AccountsReceivableTracking](../../models/shared/accountsreceivabletracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | | ~~`TrackingCategoryRefs`~~ | [][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` | *types.Decimal* | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file diff --git a/lending/docs/models/shared/dataintegrityamounts.md b/lending/docs/models/shared/dataintegrityamounts.md index 4b48e80a1..5a99d1aa3 100755 --- a/lending/docs/models/shared/dataintegrityamounts.md +++ b/lending/docs/models/shared/dataintegrityamounts.md @@ -8,5 +8,5 @@ Only returned for transactions. For accounts, there is nothing returned. | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `Max` | **types.Decimal* | :heavy_minus_sign: | Highest value of transaction set. | | -| `Min` | **types.Decimal* | :heavy_minus_sign: | Lowest value of transaction set. | | \ No newline at end of file +| `Max` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Highest value of transaction set. | | +| `Min` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 index d22878637..d922afe3d 100755 --- a/lending/docs/models/shared/dataintegritybyamount.md +++ b/lending/docs/models/shared/dataintegritybyamount.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `MatchPercentage` | **types.Decimal* | :heavy_minus_sign: | The percentage of the absolute value of transactions of the type specified in the route which have a match. | | -| `Matched` | **types.Decimal* | :heavy_minus_sign: | The sum of the absolute value of transactions of the type specified in the route which have a match. | | -| `Total` | **types.Decimal* | :heavy_minus_sign: | The total of unmatched and matched. | | -| `Unmatched` | **types.Decimal* | :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 +| `MatchPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The percentage of the absolute value of transactions of the type specified in the route which have a match. | | +| `Matched` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The sum of the absolute value of transactions of the type specified in the route which have a match. | | +| `Total` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total of unmatched and matched. | | +| `Unmatched` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 index ba8c27e21..113601537 100755 --- a/lending/docs/models/shared/dataintegritybycount.md +++ b/lending/docs/models/shared/dataintegritybycount.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `MatchPercentage` | **types.Decimal* | :heavy_minus_sign: | The percentage of records of the type specified in the route which have a match. | -| `Matched` | **types.Decimal* | :heavy_minus_sign: | The number of records of the type specified in the route which do have a match. | -| `Total` | **types.Decimal* | :heavy_minus_sign: | The total of unmatched and matched. | -| `Unmatched` | **types.Decimal* | :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 +| `MatchPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The percentage of records of the type specified in the route which have a match. | +| `Matched` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The number of records of the type specified in the route which do have a match. | +| `Total` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total of unmatched and matched. | +| `Unmatched` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/dataintegritydetail.md b/lending/docs/models/shared/dataintegritydetail.md index 6516f4fb1..37bfbb49f 100755 --- a/lending/docs/models/shared/dataintegritydetail.md +++ b/lending/docs/models/shared/dataintegritydetail.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The transaction value. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The transaction value. | | | `ConnectionID` | **string* | :heavy_minus_sign: | ID GUID representing the connection of the accounting or banking platform. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | diff --git a/lending/docs/models/shared/directcostlineitem.md b/lending/docs/models/shared/directcostlineitem.md index 8e90bfa30..ad46dc18a 100755 --- a/lending/docs/models/shared/directcostlineitem.md +++ b/lending/docs/models/shared/directcostlineitem.md @@ -7,14 +7,14 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of the goods or services. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Discount amount for the line before tax. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | Discount percentage for the line before tax. | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Discount amount for the line before tax. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Discount percentage for the line before tax. | | `ItemRef` | [*ItemRef](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :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` | **types.Decimal* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of tax for the line. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of tax for the line. | | `TaxRateRef` | [*TaxRateRef](../../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` | **types.Decimal* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of the line, including tax. | | `Tracking` | [*Tracking](../../models/shared/tracking.md) | :heavy_minus_sign: | N/A | | ~~`TrackingCategoryRefs`~~ | [][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` | *types.Decimal* | :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 +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/directincomelineitem.md b/lending/docs/models/shared/directincomelineitem.md index 5a9d1e82d..06ea2e89e 100755 --- a/lending/docs/models/shared/directincomelineitem.md +++ b/lending/docs/models/shared/directincomelineitem.md @@ -7,13 +7,13 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | A user-friendly name of the goods or services. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Discount amount for the line before tax. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | Discount percentage for the line before tax. | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Discount amount for the line before tax. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Discount percentage for the line before tax. | | `ItemRef` | [*ItemRef](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :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` | **types.Decimal* | :heavy_minus_sign: | The amount of the line, inclusive of discounts, but exclusive of tax. | -| `TaxAmount` | **types.Decimal* | :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. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The amount of the line, inclusive of discounts, but exclusive of tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*TaxRateRef](../../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` | **types.Decimal* | :heavy_minus_sign: | The total amount of the line, including tax. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total amount of the line, including tax. | | `TrackingCategoryRefs` | [][TrackingCategoryRef](../../models/shared/trackingcategoryref.md) | :heavy_minus_sign: | An array of categories against which this direct cost is tracked. | -| `UnitAmount` | *types.Decimal* | :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 +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/enhancedcashflowtransaction.md b/lending/docs/models/shared/enhancedcashflowtransaction.md index 4e5ffcef5..e497775f1 100755 --- a/lending/docs/models/shared/enhancedcashflowtransaction.md +++ b/lending/docs/models/shared/enhancedcashflowtransaction.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | An account reference containing the account id and name. | | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The bank transaction amount. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The bank transaction amount. | | | `Currency` | **string* | :heavy_minus_sign: | N/A | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Description` | **string* | :heavy_minus_sign: | The description of the bank transaction. | | diff --git a/lending/docs/models/shared/enhancedfinancialreportreportitem.md b/lending/docs/models/shared/enhancedfinancialreportreportitem.md index 8603579a6..61c90976c 100755 --- a/lending/docs/models/shared/enhancedfinancialreportreportitem.md +++ b/lending/docs/models/shared/enhancedfinancialreportreportitem.md @@ -8,5 +8,5 @@ | `AccountCategory` | [*EnhancedReportAccountCategory](../../models/shared/enhancedreportaccountcategory.md) | :heavy_minus_sign: | N/A | | | `AccountID` | **string* | :heavy_minus_sign: | The unique account ID. | | | `AccountName` | **string* | :heavy_minus_sign: | Name of the account. | | -| `Balance` | **types.Decimal* | :heavy_minus_sign: | Balance of the account as reported on the profit and loss or Balance sheet. | | +| `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Balance of the account as reported on the profit and loss or Balance sheet. | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/lending/docs/models/shared/enhancedinvoicereportitem.md b/lending/docs/models/shared/enhancedinvoicereportitem.md index aa68ce936..e978633ab 100755 --- a/lending/docs/models/shared/enhancedinvoicereportitem.md +++ b/lending/docs/models/shared/enhancedinvoicereportitem.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AmountDue` | **types.Decimal* | :heavy_minus_sign: | N/A | | +| `AmountDue` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `CustomerRef` | [*LendingCustomerRef](../../models/shared/lendingcustomerref.md) | :heavy_minus_sign: | N/A | | | `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | @@ -17,4 +17,4 @@ | `Payments` | [][Payment](../../models/shared/payment.md) | :heavy_minus_sign: | N/A | | | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [*InvoiceStatus](../../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` | **types.Decimal* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/invoicelineitem.md b/lending/docs/models/shared/invoicelineitem.md index 83959c0a9..221dadcb5 100755 --- a/lending/docs/models/shared/invoicelineitem.md +++ b/lending/docs/models/shared/invoicelineitem.md @@ -7,15 +7,15 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Description` | **string* | :heavy_minus_sign: | Friendly name of the goods or services provided. | -| `DiscountAmount` | **types.Decimal* | :heavy_minus_sign: | Numerical value of any discounts applied. | -| `DiscountPercentage` | **types.Decimal* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any discounts applied to the unit amount. | +| `DiscountAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Numerical value of any discounts applied. | +| `DiscountPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any discounts applied to the unit amount. | | `IsDirectIncome` | **bool* | :heavy_minus_sign: | N/A | | `ItemRef` | [*ItemRef](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | -| `Quantity` | *types.Decimal* | :heavy_check_mark: | Number of units of goods or services provided. | -| `SubTotal` | **types.Decimal* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of tax for the line. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Number of units of goods or services provided. | +| `SubTotal` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of tax for the line. | | `TaxRateRef` | [*TaxRateRef](../../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` | **types.Decimal* | :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. | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*AccountsReceivableTracking](../../models/shared/accountsreceivabletracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | | ~~`TrackingCategoryRefs`~~ | [][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` | *types.Decimal* | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file +| `UnitAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file diff --git a/lending/docs/models/shared/items.md b/lending/docs/models/shared/items.md index b13d242fd..23be544b2 100755 --- a/lending/docs/models/shared/items.md +++ b/lending/docs/models/shared/items.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `Amount` | *types.Decimal* | :heavy_check_mark: | N/A | -| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | N/A | +| `Name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/journalline.md b/lending/docs/models/shared/journalline.md index 814faaf30..73b079c24 100755 --- a/lending/docs/models/shared/journalline.md +++ b/lending/docs/models/shared/journalline.md @@ -8,5 +8,5 @@ | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `Currency` | **string* | :heavy_minus_sign: | Currency for the journal line item. | | `Description` | **string* | :heavy_minus_sign: | Description of the journal line item. | -| `NetAmount` | *types.Decimal* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | +| `NetAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | | `Tracking` | [*JournalLineTracking](../../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/loansummaryreportitem.md b/lending/docs/models/shared/loansummaryreportitem.md index 4d480809c..3791c26e0 100755 --- a/lending/docs/models/shared/loansummaryreportitem.md +++ b/lending/docs/models/shared/loansummaryreportitem.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Balance` | **types.Decimal* | :heavy_minus_sign: | The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. | | +| `Balance` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. | | | `Description` | **string* | :heavy_minus_sign: | The description of the object being referred to. E.g. the account. | | | `RecordRef` | [*LoanSummaryRecordRef](../../models/shared/loansummaryrecordref.md) | :heavy_minus_sign: | N/A | | | `StartDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `TotalDrawdowns` | **types.Decimal* | :heavy_minus_sign: | The total loan drawdowns. | | -| `TotalRepayments` | **types.Decimal* | :heavy_minus_sign: | The total loan repayments which includes capital plus any interest. | | \ No newline at end of file +| `TotalDrawdowns` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The total loan drawdowns. | | +| `TotalRepayments` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/orderdiscountallocation.md b/lending/docs/models/shared/orderdiscountallocation.md index b46e1d494..7997564a4 100755 --- a/lending/docs/models/shared/orderdiscountallocation.md +++ b/lending/docs/models/shared/orderdiscountallocation.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `Name` | **string* | :heavy_minus_sign: | Name of the discount in the commerce or point of sale platform. | Promotional Discount | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | Total amount of discount applied. | 15.25 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Name` | **string* | :heavy_minus_sign: | Name of the discount in the commerce or point of sale platform. | Promotional Discount | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of discount applied. | 15.25 | \ No newline at end of file diff --git a/lending/docs/models/shared/orderlineitem.md b/lending/docs/models/shared/orderlineitem.md index 27eb14a58..65aab0cdf 100755 --- a/lending/docs/models/shared/orderlineitem.md +++ b/lending/docs/models/shared/orderlineitem.md @@ -9,9 +9,9 @@ | `ID` | *string* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `ProductRef` | [*ProductRef](../../models/shared/productref.md) | :heavy_minus_sign: | Reference that links the line item to the correct product details. | | | `ProductVariantRef` | [*ProductVariantRef](../../models/shared/productvariantref.md) | :heavy_minus_sign: | Reference that links the line item to the specific version of product that has been ordered. | | -| `Quantity` | **types.Decimal* | :heavy_minus_sign: | Number of units of the product sold.
For refunds, quantity is a negative value.
| | -| `TaxPercentage` | **types.Decimal* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any sale tax applied to the unit amount. | 0 | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Number of units of the product sold.
For refunds, quantity is a negative value.
| | +| `TaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any sale tax applied to the unit amount. | 0 | | `Taxes` | [][TaxComponentAllocation](../../models/shared/taxcomponentallocation.md) | :heavy_minus_sign: | Taxes breakdown as applied to order lines. | | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | Total price of the line item, including discounts, tax and minus any refunds. | | -| `TotalTaxAmount` | **types.Decimal* | :heavy_minus_sign: | Total amount of tax applied to the line item. | | -| `UnitPrice` | **types.Decimal* | :heavy_minus_sign: | Price per unit of goods or service. | | \ No newline at end of file +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total price of the line item, including discounts, tax and minus any refunds. | | +| `TotalTaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total amount of tax applied to the line item. | | +| `UnitPrice` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Price per unit of goods or service. | | \ No newline at end of file diff --git a/lending/docs/models/shared/payment.md b/lending/docs/models/shared/payment.md index 7b6a67725..3fd18ec7f 100755 --- a/lending/docs/models/shared/payment.md +++ b/lending/docs/models/shared/payment.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | N/A | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | | `BankingTransactionRefs` | [][BankingTransactionRef](../../models/shared/bankingtransactionref.md) | :heavy_minus_sign: | N/A | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `ID` | **string* | :heavy_minus_sign: | ID of the invoice, which may be a GUID but it may be something else depending on the accounting platform | | | `PaymentType` | **string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/paymentallocationpayment.md b/lending/docs/models/shared/paymentallocationpayment.md index e469bc6bc..574c7e4cd 100755 --- a/lending/docs/models/shared/paymentallocationpayment.md +++ b/lending/docs/models/shared/paymentallocationpayment.md @@ -7,9 +7,9 @@ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

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

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | | +| `CurrencyRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | | `ID` | **string* | :heavy_minus_sign: | Identifier of the allocated payment. | | | `Note` | **string* | :heavy_minus_sign: | Notes attached to the allocated payment. | | | `PaidOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Reference` | **string* | :heavy_minus_sign: | Reference to the allocated payment. | | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 index 92cf0f18e..3cfd66111 100755 --- a/lending/docs/models/shared/paymentline.md +++ b/lending/docs/models/shared/paymentline.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AllocatedOnDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `Amount` | *types.Decimal* | :heavy_check_mark: | Amount in the payment currency. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Amount in the payment currency. | | | `Links` | [][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 index b4b9b50f3..563043358 100755 --- a/lending/docs/models/shared/paymentlinelink.md +++ b/lending/docs/models/shared/paymentlinelink.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :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` | **types.Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \| | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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 \| | | `ID` | **string* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | | `Type` | [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/paymentref.md b/lending/docs/models/shared/paymentref.md index f8c0abdf2..496faf9f0 100755 --- a/lending/docs/models/shared/paymentref.md +++ b/lending/docs/models/shared/paymentref.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | Payment Amount (including gratuity). | 194.12 | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Payment Amount (including gratuity). | 194.12 | | `CreatedDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `DueDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | diff --git a/lending/docs/models/shared/productinventory.md b/lending/docs/models/shared/productinventory.md index ca5942082..2c8c44247 100755 --- a/lending/docs/models/shared/productinventory.md +++ b/lending/docs/models/shared/productinventory.md @@ -8,4 +8,4 @@ Information about the total inventory as well as the locations inventory is in. | Field | Type | Required | Description | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `Locations` | [][ProductInventoryLocation](../../models/shared/productinventorylocation.md) | :heavy_minus_sign: | N/A | -| `TotalQuantity` | **types.Decimal* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `TotalQuantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/productinventorylocation.md b/lending/docs/models/shared/productinventorylocation.md index 8e5a7ad82..63892d0d5 100755 --- a/lending/docs/models/shared/productinventorylocation.md +++ b/lending/docs/models/shared/productinventorylocation.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `LocationRef` | [*LocationRef](../../models/shared/locationref.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | -| `Quantity` | **types.Decimal* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `LocationRef` | [*LocationRef](../../models/shared/locationref.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | +| `Quantity` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/productprice.md b/lending/docs/models/shared/productprice.md index 1764a6b75..dda373169 100755 --- a/lending/docs/models/shared/productprice.md +++ b/lending/docs/models/shared/productprice.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `UnitPrice` | **types.Decimal* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `UnitPrice` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/lending/docs/models/shared/productvariant.md b/lending/docs/models/shared/productvariant.md index 3560b8f2c..ae46df596 100755 --- a/lending/docs/models/shared/productvariant.md +++ b/lending/docs/models/shared/productvariant.md @@ -21,4 +21,4 @@ Represents a variation of a product available for sale, for example an item of c | `SourceModifiedDate` | **string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `Status` | [*ProductVariantStatus](../../models/shared/productvariantstatus.md) | :heavy_minus_sign: | N/A | | | `UnitOfMeasure` | **string* | :heavy_minus_sign: | Unit of measure for the variant, such as `kg` or `meters`. | kg | -| `VatPercentage` | **types.Decimal* | :heavy_minus_sign: | VAT rate for the product variant if sales taxes are enabled. | 12.5 | \ No newline at end of file +| `VatPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :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/profitandlossreport.md b/lending/docs/models/shared/profitandlossreport.md index 788b1f80b..c45922f00 100755 --- a/lending/docs/models/shared/profitandlossreport.md +++ b/lending/docs/models/shared/profitandlossreport.md @@ -8,11 +8,11 @@ | `CostOfSales` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `Expenses` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `FromDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `GrossProfit` | *types.Decimal* | :heavy_check_mark: | Gross profit of the company in the given date range. | | +| `GrossProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Gross profit of the company in the given date range. | | | `Income` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | -| `NetOperatingProfit` | *types.Decimal* | :heavy_check_mark: | Net operating profit of the company in the given date range. | | -| `NetOtherIncome` | *types.Decimal* | :heavy_check_mark: | Net other income of the company in the given date range. | | -| `NetProfit` | *types.Decimal* | :heavy_check_mark: | Net profit of the company in the given date range. | | +| `NetOperatingProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net operating profit of the company in the given date range. | | +| `NetOtherIncome` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net other income of the company in the given date range. | | +| `NetProfit` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Net profit of the company in the given date range. | | | `OtherExpenses` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `OtherIncome` | [*ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | N/A | | | `ToDate` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | \ 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 100755 index 000000000..b331b388c --- /dev/null +++ b/lending/docs/models/shared/pushchangetype.md @@ -0,0 +1,12 @@ +# PushChangeType + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `PushChangeTypeUnknown` | Unknown | +| `PushChangeTypeCreated` | Created | +| `PushChangeTypeModified` | Modified | +| `PushChangeTypeDeleted` | Deleted | +| `PushChangeTypeAttachmentUploaded` | 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 100755 index 000000000..628a83597 --- /dev/null +++ b/lending/docs/models/shared/pushfieldvalidation.md @@ -0,0 +1,10 @@ +# PushFieldValidation + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Details` | *string* | :heavy_check_mark: | N/A | +| `Field` | **string* | :heavy_minus_sign: | N/A | +| `Ref` | **string* | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..9442c65f4 --- /dev/null +++ b/lending/docs/models/shared/pushoperation.md @@ -0,0 +1,20 @@ +# PushOperation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Changes` | [][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` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ErrorMessage` | **string* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `Status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `StatusCode` | *int64* | :heavy_check_mark: | N/A | | +| `TimeoutInMinutes` | **int* | :heavy_minus_sign: | N/A | | +| ~~`TimeoutInSeconds`~~ | **int* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Validation` | [*Validation](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/lending/docs/models/shared/pushoperationchange.md b/lending/docs/models/shared/pushoperationchange.md new file mode 100755 index 000000000..2f9ff6fc5 --- /dev/null +++ b/lending/docs/models/shared/pushoperationchange.md @@ -0,0 +1,10 @@ +# PushOperationChange + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `AttachmentID` | **string* | :heavy_minus_sign: | N/A | +| `RecordRef` | [*PushOperationRef](../../models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +| `Type` | [*PushChangeType](../../models/shared/pushchangetype.md) | :heavy_minus_sign: | N/A | \ 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 100755 index 000000000..5374357ff --- /dev/null +++ b/lending/docs/models/shared/pushoperationref.md @@ -0,0 +1,9 @@ +# PushOperationRef + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `DataType` | [*DataType](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `ID` | **string* | :heavy_minus_sign: | N/A | | \ 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 100755 index 000000000..c443514b3 --- /dev/null +++ b/lending/docs/models/shared/pushoperations.md @@ -0,0 +1,12 @@ +# PushOperations + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `PageNumber` | *int64* | :heavy_check_mark: | N/A | +| `PageSize` | *int64* | :heavy_check_mark: | N/A | +| `Results` | [][PushOperation](../../models/shared/pushoperation.md) | :heavy_minus_sign: | N/A | +| `TotalResults` | *int64* | :heavy_check_mark: | N/A | \ 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 100755 index 000000000..09045add1 --- /dev/null +++ b/lending/docs/models/shared/pushoperationstatus.md @@ -0,0 +1,13 @@ +# PushOperationStatus + +The current status of the push operation. + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `PushOperationStatusPending` | Pending | +| `PushOperationStatusFailed` | Failed | +| `PushOperationStatusSuccess` | Success | +| `PushOperationStatusTimedOut` | TimedOut | \ 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 100755 index 000000000..4062cf6bc --- /dev/null +++ b/lending/docs/models/shared/pushoption.md @@ -0,0 +1,14 @@ +# PushOption + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `DisplayName` | *string* | :heavy_check_mark: | N/A | +| `Options` | [][PushOptionChoice](../../models/shared/pushoptionchoice.md) | :heavy_minus_sign: | N/A | +| `Properties` | map[string][PushOptionProperty](../../models/shared/pushoptionproperty.md) | :heavy_minus_sign: | N/A | +| `Required` | *bool* | :heavy_check_mark: | N/A | +| `Type` | [PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | N/A | +| `Validation` | [*PushValidationInfo](../../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 100755 index 000000000..7a50588bf --- /dev/null +++ b/lending/docs/models/shared/pushoptionchoice.md @@ -0,0 +1,12 @@ +# PushOptionChoice + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Description` | **string* | :heavy_minus_sign: | N/A | +| `DisplayName` | **string* | :heavy_minus_sign: | N/A | +| `Required` | **bool* | :heavy_minus_sign: | N/A | +| `Type` | [*PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_minus_sign: | N/A | +| `Value` | **string* | :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 100755 index 000000000..d1f762bdb --- /dev/null +++ b/lending/docs/models/shared/pushoptionproperty.md @@ -0,0 +1,14 @@ +# PushOptionProperty + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Description` | *string* | :heavy_check_mark: | N/A | +| `DisplayName` | *string* | :heavy_check_mark: | N/A | +| `Options` | [][PushOptionChoice](../../models/shared/pushoptionchoice.md) | :heavy_minus_sign: | N/A | +| `Properties` | map[string][PushOptionProperty](../../models/shared/pushoptionproperty.md) | :heavy_minus_sign: | N/A | +| `Required` | *bool* | :heavy_check_mark: | N/A | +| `Type` | [PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | N/A | +| `Validation` | [*PushValidationInfo](../../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 100755 index 000000000..86190eb9d --- /dev/null +++ b/lending/docs/models/shared/pushoptiontype.md @@ -0,0 +1,15 @@ +# PushOptionType + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `PushOptionTypeArray` | Array | +| `PushOptionTypeObject` | Object | +| `PushOptionTypeString` | String | +| `PushOptionTypeNumber` | Number | +| `PushOptionTypeBoolean` | Boolean | +| `PushOptionTypeDateTime` | DateTime | +| `PushOptionTypeFile` | File | +| `PushOptionTypeMultiPart` | 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 100755 index 000000000..520c31e52 --- /dev/null +++ b/lending/docs/models/shared/pushvalidationinfo.md @@ -0,0 +1,9 @@ +# PushValidationInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Information` | [][PushFieldValidation](../../models/shared/pushfieldvalidation.md) | :heavy_minus_sign: | N/A | +| `Warnings` | [][PushFieldValidation](../../models/shared/pushfieldvalidation.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/reportcomponentmeasure.md b/lending/docs/models/shared/reportcomponentmeasure.md index a646f70f9..06537f98c 100755 --- a/lending/docs/models/shared/reportcomponentmeasure.md +++ b/lending/docs/models/shared/reportcomponentmeasure.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------- | -------------------- | -------------------- | -------------------- | -| `Index` | **int64* | :heavy_minus_sign: | N/A | -| `MeasureDisplayName` | **string* | :heavy_minus_sign: | N/A | -| `Value` | **types.Decimal* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `Index` | **int64* | :heavy_minus_sign: | N/A | +| `MeasureDisplayName` | **string* | :heavy_minus_sign: | N/A | +| `Value` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/models/shared/reportitems.md b/lending/docs/models/shared/reportitems.md index 887935807..d649123ea 100755 --- a/lending/docs/models/shared/reportitems.md +++ b/lending/docs/models/shared/reportitems.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The loan transaction amount. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The loan transaction amount. | | | `Date` | **string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `ItemRef` | [*DefinitionsitemRef](../../models/shared/definitionsitemref.md) | :heavy_minus_sign: | N/A | | | `LoanRef` | [*LoanRef](../../models/shared/loanref.md) | :heavy_minus_sign: | N/A | | diff --git a/lending/docs/models/shared/reportline.md b/lending/docs/models/shared/reportline.md index 73f91ac16..fc54bcda0 100755 --- a/lending/docs/models/shared/reportline.md +++ b/lending/docs/models/shared/reportline.md @@ -8,4 +8,4 @@ | `AccountID` | **string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting platform. | | `Items` | [][ReportLine](../../models/shared/reportline.md) | :heavy_minus_sign: | An array of ReportLine items. | | `Name` | **string* | :heavy_minus_sign: | Name of the report line item. | -| `Value` | *types.Decimal* | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file +| `Value` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_check_mark: | Numerical value of the line item. | \ No newline at end of file diff --git a/lending/docs/models/shared/servicecharge.md b/lending/docs/models/shared/servicecharge.md index 56c89163c..e1bcd4ce8 100755 --- a/lending/docs/models/shared/servicecharge.md +++ b/lending/docs/models/shared/servicecharge.md @@ -7,8 +7,8 @@ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | | `Description` | **string* | :heavy_minus_sign: | Service charges for this order. | A service charge | | `Quantity` | **int64* | :heavy_minus_sign: | The number of times the charge is charged. | 1 | -| `TaxAmount` | **types.Decimal* | :heavy_minus_sign: | Amount of the service charge that is tax. | 0 | -| `TaxPercentage` | **types.Decimal* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any tax applied to the service charge. | 0 | +| `TaxAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Amount of the service charge that is tax. | 0 | +| `TaxPercentage` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any tax applied to the service charge. | 0 | | `Taxes` | [][TaxComponentAllocation](../../models/shared/taxcomponentallocation.md) | :heavy_minus_sign: | Taxes breakdown as applied to service charges. | | -| `TotalAmount` | **types.Decimal* | :heavy_minus_sign: | Total service charge, including taxes. | 0 | +| `TotalAmount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Total service charge, including taxes. | 0 | | `Type` | [*ServiceChargeType](../../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/taxcomponentallocation.md b/lending/docs/models/shared/taxcomponentallocation.md index 82eab7361..3f635e707 100755 --- a/lending/docs/models/shared/taxcomponentallocation.md +++ b/lending/docs/models/shared/taxcomponentallocation.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `Rate` | **types.Decimal* | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | +| `Rate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | | `TaxComponentRef` | [*TaxComponentRef](../../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/taxrateref.md b/lending/docs/models/shared/taxrateref.md index d7ff7fb91..7503f800c 100755 --- a/lending/docs/models/shared/taxrateref.md +++ b/lending/docs/models/shared/taxrateref.md @@ -14,8 +14,8 @@ Found on: ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `EffectiveTaxRate` | **types.Decimal* | :heavy_minus_sign: | Applicable tax rate. | -| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | -| `Name` | **string* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `EffectiveTaxRate` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Applicable tax rate. | +| `ID` | **string* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | +| `Name` | **string* | :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/transactioncategory.md b/lending/docs/models/shared/transactioncategory.md index 0f2c18c0e..c090302d1 100755 --- a/lending/docs/models/shared/transactioncategory.md +++ b/lending/docs/models/shared/transactioncategory.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Confidence` | **types.Decimal* | :heavy_minus_sign: | Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. | +| `Confidence` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. | | `Levels` | []*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/transferaccount.md b/lending/docs/models/shared/transferaccount.md index ab96fa1d3..2104c88c6 100755 --- a/lending/docs/models/shared/transferaccount.md +++ b/lending/docs/models/shared/transferaccount.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AccountRef` | [*AccountRef](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | -| `Amount` | **types.Decimal* | :heavy_minus_sign: | The amount transferred between accounts. | | +| `Amount` | [*decimal.Big](https://pkg.go.dev/github.com/ericlagergren/decimal#Big) | :heavy_minus_sign: | The amount transferred between accounts. | | | `Currency` | **string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | \ 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 100755 index 000000000..ff0976b5f --- /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` | [][ValidationItem](../../models/shared/validationitem.md) | :heavy_minus_sign: | N/A | +| `Warnings` | [][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 100755 index 000000000..8f00370c4 --- /dev/null +++ b/lending/docs/models/shared/validationitem.md @@ -0,0 +1,10 @@ +# ValidationItem + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ItemID` | **string* | :heavy_minus_sign: | N/A | +| `Message` | **string* | :heavy_minus_sign: | N/A | +| `ValidatorName` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/lending/docs/sdks/accountingbankdata/README.md b/lending/docs/sdks/accountingbankdata/README.md index f04570779..c368ed211 100755 --- a/lending/docs/sdks/accountingbankdata/README.md +++ b/lending/docs/sdks/accountingbankdata/README.md @@ -33,8 +33,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -44,10 +44,10 @@ func main() { AccountID: "distinctio", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("quibusdam"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("quibusdam"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountingbankdataaccounts/README.md b/lending/docs/sdks/accountingbankdataaccounts/README.md index 5e8e41a11..9ac3e05a6 100755 --- a/lending/docs/sdks/accountingbankdataaccounts/README.md +++ b/lending/docs/sdks/accountingbankdataaccounts/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.AccountingBankData.Accounts.List(ctx, operations.ListAccountingBankAccountsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("nulla"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("nulla"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountspayablebillcreditnotes/README.md b/lending/docs/sdks/accountspayablebillcreditnotes/README.md index 729540f2a..b608caac2 100755 --- a/lending/docs/sdks/accountspayablebillcreditnotes/README.md +++ b/lending/docs/sdks/accountspayablebillcreditnotes/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.BillCreditNotes.List(ctx, operations.ListAccountingBillCreditNotesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("minus"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("minus"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountspayablebillpayments/README.md b/lending/docs/sdks/accountspayablebillpayments/README.md index 8f8709c24..8fda75c7d 100755 --- a/lending/docs/sdks/accountspayablebillpayments/README.md +++ b/lending/docs/sdks/accountspayablebillpayments/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.BillPayments.List(ctx, operations.ListAccountingBillPaymentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("voluptatum"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("voluptatum"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountspayablebills/README.md b/lending/docs/sdks/accountspayablebills/README.md index 522de2c05..ab869e133 100755 --- a/lending/docs/sdks/accountspayablebills/README.md +++ b/lending/docs/sdks/accountspayablebills/README.md @@ -31,8 +31,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -93,8 +93,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -151,8 +151,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -211,8 +211,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -220,10 +220,10 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Bills.List(ctx, operations.ListAccountingBillsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("recusandae"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("recusandae"), }) if err != nil { log.Fatal(err) @@ -272,8 +272,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/accountspayablesuppliers/README.md b/lending/docs/sdks/accountspayablesuppliers/README.md index 711b38567..5a6a0c679 100755 --- a/lending/docs/sdks/accountspayablesuppliers/README.md +++ b/lending/docs/sdks/accountspayablesuppliers/README.md @@ -31,8 +31,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -93,8 +93,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -151,8 +151,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -211,8 +211,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -220,10 +220,10 @@ func main() { ctx := context.Background() res, err := s.AccountsPayable.Suppliers.List(ctx, operations.ListAccountingSuppliersRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("deserunt"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("deserunt"), }) if err != nil { log.Fatal(err) @@ -272,8 +272,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/accountsreceivablecreditnotes/README.md b/lending/docs/sdks/accountsreceivablecreditnotes/README.md index 2fc05d68e..52ca28c96 100755 --- a/lending/docs/sdks/accountsreceivablecreditnotes/README.md +++ b/lending/docs/sdks/accountsreceivablecreditnotes/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.CreditNotes.List(ctx, operations.ListAccountingCreditNotesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("repellendus"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("repellendus"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountsreceivablecustomers/README.md b/lending/docs/sdks/accountsreceivablecustomers/README.md index 1af1fc701..042b72a20 100755 --- a/lending/docs/sdks/accountsreceivablecustomers/README.md +++ b/lending/docs/sdks/accountsreceivablecustomers/README.md @@ -31,8 +31,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -93,8 +93,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -151,8 +151,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -211,8 +211,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -220,10 +220,10 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Customers.List(ctx, operations.ListAccountingCustomersRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("at"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("at"), }) if err != nil { log.Fatal(err) @@ -272,8 +272,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/accountsreceivabledirectincomes/README.md b/lending/docs/sdks/accountsreceivabledirectincomes/README.md index 432195ca0..29226be36 100755 --- a/lending/docs/sdks/accountsreceivabledirectincomes/README.md +++ b/lending/docs/sdks/accountsreceivabledirectincomes/README.md @@ -31,8 +31,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -93,8 +93,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -152,8 +152,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -164,7 +164,7 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", DirectIncomeID: "quod", - TimeoutInMinutes: codatlending.Int(800911), + TimeoutInMinutes: lending.Int(800911), }) if err != nil { log.Fatal(err) @@ -213,8 +213,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -223,10 +223,10 @@ func main() { res, err := s.AccountsReceivable.DirectIncomes.List(ctx, operations.ListAccountingDirectIncomesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("esse"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("esse"), }) if err != nil { log.Fatal(err) @@ -275,8 +275,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/accountsreceivableinvoices/README.md b/lending/docs/sdks/accountsreceivableinvoices/README.md index 5eadd7c9d..69f635ecb 100755 --- a/lending/docs/sdks/accountsreceivableinvoices/README.md +++ b/lending/docs/sdks/accountsreceivableinvoices/README.md @@ -33,8 +33,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -147,8 +147,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -205,8 +205,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -271,8 +271,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -280,10 +280,10 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Invoices.List(ctx, operations.ListAccountingInvoicesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("officia"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("officia"), }) if err != nil { log.Fatal(err) @@ -332,8 +332,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -386,8 +386,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -395,9 +395,9 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Invoices.ListReconciled(ctx, operations.ListReconciledInvoicesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("fugit"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("fugit"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountsreceivablepayments/README.md b/lending/docs/sdks/accountsreceivablepayments/README.md index 4209048df..e90019533 100755 --- a/lending/docs/sdks/accountsreceivablepayments/README.md +++ b/lending/docs/sdks/accountsreceivablepayments/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Payments.List(ctx, operations.ListAccountingPaymentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("hic"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("hic"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/accountsreceivablereports/README.md b/lending/docs/sdks/accountsreceivablereports/README.md index 794ad4230..b30fa5b42 100755 --- a/lending/docs/sdks/accountsreceivablereports/README.md +++ b/lending/docs/sdks/accountsreceivablereports/README.md @@ -26,8 +26,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -35,8 +35,8 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Reports.GetAgedCreditors(ctx, operations.GetAccountingAgedCreditorsReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - NumberOfPeriods: codatlending.Int(12), - PeriodLengthDays: codatlending.Int(30), + NumberOfPeriods: lending.Int(12), + PeriodLengthDays: lending.Int(30), ReportDate: types.MustDateFromString("2022-12-31"), }) if err != nil { @@ -82,8 +82,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -91,8 +91,8 @@ func main() { ctx := context.Background() res, err := s.AccountsReceivable.Reports.GetAgedDebtors(ctx, operations.GetAccountingAgedDebtorsReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - NumberOfPeriods: codatlending.Int(12), - PeriodLengthDays: codatlending.Int(30), + NumberOfPeriods: lending.Int(12), + PeriodLengthDays: lending.Int(30), ReportDate: types.MustDateFromString("2022-12-31"), }) if err != nil { @@ -137,8 +137,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -189,8 +189,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/bankingaccountbalances/README.md b/lending/docs/sdks/bankingaccountbalances/README.md index acbb2df86..79de07eb0 100755 --- a/lending/docs/sdks/bankingaccountbalances/README.md +++ b/lending/docs/sdks/bankingaccountbalances/README.md @@ -27,8 +27,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -37,10 +37,10 @@ func main() { res, err := s.Banking.AccountBalances.List(ctx, operations.ListBankingAccountBalancesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("optio"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("optio"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/bankingaccounts/README.md b/lending/docs/sdks/bankingaccounts/README.md index 367c6dfc9..0b9aaa9b3 100755 --- a/lending/docs/sdks/bankingaccounts/README.md +++ b/lending/docs/sdks/bankingaccounts/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Banking.Accounts.List(ctx, operations.ListBankingAccountsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("beatae"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("beatae"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/bankingcategorizedstatement/README.md b/lending/docs/sdks/bankingcategorizedstatement/README.md index 4a0a51dfc..ef6a73a0d 100755 --- a/lending/docs/sdks/bankingcategorizedstatement/README.md +++ b/lending/docs/sdks/bankingcategorizedstatement/README.md @@ -26,8 +26,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -35,9 +35,9 @@ func main() { ctx := context.Background() res, err := s.Banking.CategorizedStatement.Get(ctx, operations.GetCategorizedBankStatementRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("commodi"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("commodi"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/bankingtransactioncategories/README.md b/lending/docs/sdks/bankingtransactioncategories/README.md index 42f911045..206f6df92 100755 --- a/lending/docs/sdks/bankingtransactioncategories/README.md +++ b/lending/docs/sdks/bankingtransactioncategories/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Banking.TransactionCategories.List(ctx, operations.ListBankingTransactionCategoriesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("modi"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("modi"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/bankingtransactions/README.md b/lending/docs/sdks/bankingtransactions/README.md index 5b20ad3ff..f6f1a6e22 100755 --- a/lending/docs/sdks/bankingtransactions/README.md +++ b/lending/docs/sdks/bankingtransactions/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Banking.Transactions.List(ctx, operations.ListBankingTransactionsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("impedit"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("impedit"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/companies/README.md b/lending/docs/sdks/companies/README.md index 388f9aa43..7c93288d8 100755 --- a/lending/docs/sdks/companies/README.md +++ b/lending/docs/sdks/companies/README.md @@ -33,15 +33,15 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) ctx := context.Background() res, err := s.Companies.Create(ctx, shared.CompanyRequestBody{ - Description: codatlending.String("Requested early access to the new financing scheme."), + Description: lending.String("Requested early access to the new financing scheme."), Name: "Bank of Dave", }) if err != nil { @@ -87,8 +87,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -139,8 +139,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -191,18 +191,18 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) ctx := context.Background() res, err := s.Companies.List(ctx, operations.ListCompaniesRequest{ - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("corrupti"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("corrupti"), }) if err != nil { log.Fatal(err) @@ -246,8 +246,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -255,7 +255,7 @@ func main() { ctx := context.Background() res, err := s.Companies.Update(ctx, operations.UpdateCompanyRequest{ CompanyRequestBody: &shared.CompanyRequestBody{ - Description: codatlending.String("Requested early access to the new financing scheme."), + Description: lending.String("Requested early access to the new financing scheme."), Name: "Bank of Dave", }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", diff --git a/lending/docs/sdks/companyinfo/README.md b/lending/docs/sdks/companyinfo/README.md index dccf1a61e..5d076def8 100755 --- a/lending/docs/sdks/companyinfo/README.md +++ b/lending/docs/sdks/companyinfo/README.md @@ -27,8 +27,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -81,8 +81,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/connections/README.md b/lending/docs/sdks/connections/README.md index 9db0cf8f1..b1da8431d 100755 --- a/lending/docs/sdks/connections/README.md +++ b/lending/docs/sdks/connections/README.md @@ -32,8 +32,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -41,7 +41,7 @@ func main() { ctx := context.Background() res, err := s.Connections.Create(ctx, operations.CreateConnectionRequest{ RequestBody: &operations.CreateConnectionRequestBody{ - PlatformKey: codatlending.String("illum"), + PlatformKey: lending.String("illum"), }, CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", }) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -141,8 +141,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -194,8 +194,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -203,10 +203,10 @@ func main() { ctx := context.Background() res, err := s.Connections.List(ctx, operations.ListConnectionsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("vel"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("vel"), }) if err != nil { log.Fatal(err) @@ -250,8 +250,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/dataintegrity/README.md b/lending/docs/sdks/dataintegrity/README.md index 997175a5c..e6c7315d0 100755 --- a/lending/docs/sdks/dataintegrity/README.md +++ b/lending/docs/sdks/dataintegrity/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,10 +40,10 @@ func main() { res, err := s.DataIntegrity.Details(ctx, operations.ListDataIntegrityDetailsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", DataType: shared.DataIntegrityDataTypeBankingAccounts, - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("deserunt"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("deserunt"), }) if err != nil { log.Fatal(err) @@ -94,8 +94,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -151,8 +151,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -161,7 +161,7 @@ func main() { res, err := s.DataIntegrity.Summaries(ctx, operations.GetDataIntegritySummariesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", DataType: shared.DataIntegrityDataTypeBankingAccounts, - Query: codatlending.String("suscipit"), + Query: lending.String("suscipit"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/excelreports/README.md b/lending/docs/sdks/excelreports/README.md index b981e21ac..31b444c2f 100755 --- a/lending/docs/sdks/excelreports/README.md +++ b/lending/docs/sdks/excelreports/README.md @@ -32,8 +32,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -101,8 +101,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -158,8 +158,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/fileupload/README.md b/lending/docs/sdks/fileupload/README.md index 9380101b9..bdc7835e9 100755 --- a/lending/docs/sdks/fileupload/README.md +++ b/lending/docs/sdks/fileupload/README.md @@ -28,8 +28,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -37,7 +37,7 @@ func main() { ctx := context.Background() res, err := s.FileUpload.Download(ctx, operations.DownloadFilesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - Date: codatlending.String("2022-10-23T00:00:00.000Z"), + Date: lending.String("2022-10-23T00:00:00.000Z"), }) if err != nil { log.Fatal(err) @@ -81,8 +81,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -139,8 +139,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/financialstatementsaccounts/README.md b/lending/docs/sdks/financialstatementsaccounts/README.md index 47df89b25..cd8823fc0 100755 --- a/lending/docs/sdks/financialstatementsaccounts/README.md +++ b/lending/docs/sdks/financialstatementsaccounts/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -87,8 +87,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -96,10 +96,10 @@ func main() { ctx := context.Background() res, err := s.FinancialStatements.Accounts.List(ctx, operations.ListAccountingAccountsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("esse"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("esse"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/financialstatementsbalancesheet/README.md b/lending/docs/sdks/financialstatementsbalancesheet/README.md index a963f33b3..ae342c528 100755 --- a/lending/docs/sdks/financialstatementsbalancesheet/README.md +++ b/lending/docs/sdks/financialstatementsbalancesheet/README.md @@ -23,8 +23,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -34,7 +34,7 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", PeriodLength: 4, PeriodsToCompare: 20, - StartMonth: codatlending.String("2022-10-23T00:00:00.000Z"), + StartMonth: lending.String("2022-10-23T00:00:00.000Z"), }) if err != nil { log.Fatal(err) @@ -80,8 +80,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,7 +89,7 @@ func main() { ctx := context.Background() res, err := s.FinancialStatements.BalanceSheet.GetCategorizedAccounts(ctx, operations.GetCategorizedBalanceSheetStatementRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - NumberOfPeriods: codatlending.Int64(568434), + NumberOfPeriods: lending.Int64(568434), ReportDate: "29-09-2020", }) if err != nil { diff --git a/lending/docs/sdks/financialstatementscashflow/README.md b/lending/docs/sdks/financialstatementscashflow/README.md index 983c1d92e..5613987ac 100755 --- a/lending/docs/sdks/financialstatementscashflow/README.md +++ b/lending/docs/sdks/financialstatementscashflow/README.md @@ -22,8 +22,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -33,7 +33,7 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", PeriodLength: 4, PeriodsToCompare: 20, - StartMonth: codatlending.String("2022-10-23T00:00:00.000Z"), + StartMonth: lending.String("2022-10-23T00:00:00.000Z"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/financialstatementsprofitandloss/README.md b/lending/docs/sdks/financialstatementsprofitandloss/README.md index 276a43200..d70c89d21 100755 --- a/lending/docs/sdks/financialstatementsprofitandloss/README.md +++ b/lending/docs/sdks/financialstatementsprofitandloss/README.md @@ -23,8 +23,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -34,7 +34,7 @@ func main() { CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", PeriodLength: 4, PeriodsToCompare: 20, - StartMonth: codatlending.String("2022-10-23T00:00:00.000Z"), + StartMonth: lending.String("2022-10-23T00:00:00.000Z"), }) if err != nil { log.Fatal(err) @@ -80,8 +80,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,7 +89,7 @@ func main() { ctx := context.Background() res, err := s.FinancialStatements.ProfitAndLoss.GetCategorizedAccounts(ctx, operations.GetCategorizedProfitAndLossStatementRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - NumberOfPeriods: codatlending.Int64(324141), + NumberOfPeriods: lending.Int64(324141), ReportDate: "29-09-2020", }) if err != nil { diff --git a/lending/docs/sdks/liabilities/README.md b/lending/docs/sdks/liabilities/README.md index e81aa4e45..43d9af406 100755 --- a/lending/docs/sdks/liabilities/README.md +++ b/lending/docs/sdks/liabilities/README.md @@ -32,8 +32,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/loanwriteback/README.md b/lending/docs/sdks/loanwriteback/README.md new file mode 100755 index 000000000..4d21cd6c8 --- /dev/null +++ b/lending/docs/sdks/loanwriteback/README.md @@ -0,0 +1,4 @@ +# LoanWriteback + +### Available Operations + diff --git a/lending/docs/sdks/loanwritebackaccounts/README.md b/lending/docs/sdks/loanwritebackaccounts/README.md new file mode 100755 index 000000000..992319579 --- /dev/null +++ b/lending/docs/sdks/loanwritebackaccounts/README.md @@ -0,0 +1,160 @@ +# 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/accounting-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Accounts.Create(ctx, operations.CreateAccountRequest{ + AccountingAccount: &shared.AccountingAccount{ + Currency: lending.String("USD"), + CurrentBalance: types.MustNewDecimalFromString("0"), + Description: lending.String("Invoices the business has issued but has not yet collected payment on."), + FullyQualifiedCategory: lending.String("Asset.Current"), + FullyQualifiedName: lending.String("Cash On Hand"), + ID: lending.String("1b6266d1-1e44-46c5-8eb5-a8f98e03124e"), + IsBankAccount: lending.Bool(false), + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(false), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + Name: lending.String("Accounts Receivable"), + NominalCode: lending.String("610"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + Status: shared.AccountStatusActive.ToPointer(), + Type: shared.AccountTypeAsset.ToPointer(), + ValidDatatypeLinks: []shared.AccountingAccountValidDataTypeLinks{ + shared.AccountingAccountValidDataTypeLinks{ + Links: []string{ + "natus", + }, + Property: lending.String("laboriosam"), + }, + }, + }, + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(943749), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateAccountResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateAccountRequest](../../models/operations/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateAccountResponse](../../models/operations/createaccountresponse.md), error** + + +## GetCreateModel + +The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/accounting-api#/schemas/Account) for a given company and integration. + +[Accounts](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Accounts.GetCreateModel(ctx, operations.GetCreateChartOfAccountsModelRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateChartOfAccountsModelRequest](../../models/operations/getcreatechartofaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateChartOfAccountsModelResponse](../../models/operations/getcreatechartofaccountsmodelresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebackbankaccounts/README.md b/lending/docs/sdks/loanwritebackbankaccounts/README.md new file mode 100755 index 000000000..5b2f7143c --- /dev/null +++ b/lending/docs/sdks/loanwritebackbankaccounts/README.md @@ -0,0 +1,152 @@ +# 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/accounting-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.BankAccounts.Create(ctx, operations.CreateBankAccountRequest{ + AccountingBankAccount: &shared.AccountingBankAccount{ + AccountName: lending.String("saepe"), + AccountNumber: lending.String("fuga"), + AccountType: shared.AccountingBankAccountTypeCredit.ToPointer(), + AvailableBalance: types.MustNewDecimalFromString("3595.08"), + Balance: types.MustNewDecimalFromString("6130.64"), + Currency: lending.String("USD"), + IBan: lending.String("saepe"), + ID: lending.String("b10faaa2-352c-4595-9907-aff1a3a2fa94"), + Institution: lending.String("commodi"), + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(false), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + NominalCode: lending.String("molestiae"), + OverdraftLimit: types.MustNewDecimalFromString("2444.25"), + SortCode: lending.String("error"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + }, + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(338007), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateBankAccountResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateBankAccountRequest](../../models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateBankAccountResponse](../../models/operations/createbankaccountresponse.md), error** + + +## 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/accounting-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.BankAccounts.GetCreateUpdateModel(ctx, operations.GetCreateUpdateBankAccountsModelRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateUpdateBankAccountsModelRequest](../../models/operations/getcreateupdatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateUpdateBankAccountsModelResponse](../../models/operations/getcreateupdatebankaccountsmodelresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebackbanktransactions/README.md b/lending/docs/sdks/loanwritebackbanktransactions/README.md new file mode 100755 index 000000000..b545071ee --- /dev/null +++ b/lending/docs/sdks/loanwritebackbanktransactions/README.md @@ -0,0 +1,148 @@ +# 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/accounting-api#/schemas/BankTransactions) for a given company's connection. + +[Bank account transactions](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.BankTransactions.Create(ctx, operations.CreateBankTransactionsRequest{ + AccountingCreateBankTransactions: &shared.AccountingCreateBankTransactions{ + AccountID: lending.String("vitae"), + Transactions: []shared.CreateBankAccountTransaction{ + shared.CreateBankAccountTransaction{ + Amount: types.MustNewDecimalFromString("6747.52"), + Balance: types.MustNewDecimalFromString("6563.3"), + Date: lending.String("2022-10-23T00:00:00.000Z"), + Description: lending.String("odit"), + ID: lending.String("c3f5ad01-9da1-4ffe-b8f0-97b0074f1547"), + }, + }, + }, + AccountID: "dicta", + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(688661), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateBankTransactionsResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateBankTransactionsRequest](../../models/operations/createbanktransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateBankTransactionsResponse](../../models/operations/createbanktransactionsresponse.md), error** + + +## 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/accounting-api#/schemas/BankTransactions) for a given company and integration. + +[Bank account transactions](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.BankTransactions.GetCreateModel(ctx, operations.GetCreateBankTransactionsModelRequest{ + AccountID: "enim", + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateBankTransactionsModelRequest](../../models/operations/getcreatebanktransactionsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateBankTransactionsModelResponse](../../models/operations/getcreatebanktransactionsmodelresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebackcreateoperations/README.md b/lending/docs/sdks/loanwritebackcreateoperations/README.md new file mode 100755 index 000000000..1378d2701 --- /dev/null +++ b/lending/docs/sdks/loanwritebackcreateoperations/README.md @@ -0,0 +1,115 @@ +# LoanWriteback.CreateOperations + +### Available Operations + +* [Get](#get) - Get create operation +* [List](#list) - List create operations + +## Get + +Retrieve create operation. + +### Example Usage + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.CreateOperations.Get(ctx, operations.GetCreateOperationRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + PushOperationKey: "e6e13b99-d488-4e1e-91e4-50ad2abd4426", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOperation != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateOperationRequest](../../models/operations/getcreateoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateOperationResponse](../../models/operations/getcreateoperationresponse.md), error** + + +## List + +List create operations. + +### Example Usage + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.CreateOperations.List(ctx, operations.ListCreateOperationsRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("cupiditate"), + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOperations != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.ListCreateOperationsRequest](../../models/operations/listcreateoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.ListCreateOperationsResponse](../../models/operations/listcreateoperationsresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebackdirectcosts/README.md b/lending/docs/sdks/loanwritebackdirectcosts/README.md new file mode 100755 index 000000000..7357429c5 --- /dev/null +++ b/lending/docs/sdks/loanwritebackdirectcosts/README.md @@ -0,0 +1,227 @@ +# 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/accounting-api#/schemas/DirectCost) for a given company's connection. + +[Direct costs](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.DirectCosts.Create(ctx, operations.CreateDirectCostRequest{ + AccountingDirectCost: &shared.AccountingDirectCost{ + ContactRef: &shared.ContactRef{ + DataType: lending.String("quos"), + ID: "02d502a9-4bb4-4f63-8969-e9a3efa77dfb", + }, + Currency: "GBP", + CurrencyRate: types.MustNewDecimalFromString("2974.37"), + ID: lending.String("cd66ae39-5efb-49ba-88f3-a66997074ba4"), + IssueDate: "2022-10-23T00:00:00.000Z", + LineItems: []shared.DirectCostLineItem{ + shared.DirectCostLineItem{ + AccountRef: &shared.AccountRef{ + ID: lending.String("69b6e214-1959-4890-afa5-63e2516fe4c8"), + Name: lending.String("Dr. Arnold Bradtke"), + }, + Description: lending.String("expedita"), + DiscountAmount: types.MustNewDecimalFromString("4692.49"), + DiscountPercentage: types.MustNewDecimalFromString("9988.48"), + ItemRef: &shared.ItemRef{ + ID: "d2ed0289-21cd-4dc6-9260-1fb576b0d5f0", + Name: lending.String("Vincent Anderson"), + }, + Quantity: types.MustNewDecimalFromString("9441.24"), + SubTotal: types.MustNewDecimalFromString("7299.91"), + TaxAmount: types.MustNewDecimalFromString("7499.99"), + TaxRateRef: &shared.TaxRateRef{ + EffectiveTaxRate: types.MustNewDecimalFromString("1716.29"), + ID: lending.String("58705320-2c73-4d5f-a9b9-0c28909b3fe4"), + Name: lending.String("Omar Leuschke"), + }, + TotalAmount: types.MustNewDecimalFromString("7508.44"), + Tracking: &shared.Tracking{ + InvoiceTo: &shared.RecordRef{ + DataType: lending.String("accountTransaction"), + ID: lending.String("f4863332-3f9b-477f-ba41-00674ebf6928"), + }, + RecordRefs: []shared.RecordRef{ + shared.RecordRef{ + DataType: lending.String("journalEntry"), + ID: lending.String("d1ba77a8-9ebf-4737-ae42-03ce5e6a95d8"), + }, + }, + }, + TrackingCategoryRefs: []shared.TrackingCategoryRef{ + shared.TrackingCategoryRef{ + ID: "a0d446ce-2af7-4a73-8f3b-e453f870b326", + Name: lending.String("Glen Oberbrunner"), + }, + }, + UnitAmount: types.MustNewDecimalFromString("2776.28"), + }, + }, + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(false), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + Note: lending.String("cupiditate"), + PaymentAllocations: []shared.AccountingPaymentAllocation{ + shared.AccountingPaymentAllocation{ + Allocation: shared.AccountingPaymentAllocationAllocation{ + AllocatedOnDate: lending.String("2022-10-23T00:00:00.000Z"), + Currency: lending.String("EUR"), + CurrencyRate: types.MustNewDecimalFromString("7470.8"), + TotalAmount: types.MustNewDecimalFromString("1175.31"), + }, + Payment: shared.PaymentAllocationPayment{ + AccountRef: &shared.AccountRef{ + ID: lending.String("a8422bb6-79d2-4322-b15b-f0cbb1e31b8b"), + Name: lending.String("Kevin Willms"), + }, + Currency: lending.String("GBP"), + CurrencyRate: types.MustNewDecimalFromString("2408.29"), + ID: lending.String("a1108e0a-dcf4-4b92-9879-fce953f73ef7"), + Note: lending.String("hic"), + PaidOnDate: lending.String("2022-10-23T00:00:00.000Z"), + Reference: lending.String("quod"), + TotalAmount: types.MustNewDecimalFromString("4861.6"), + }, + }, + }, + Reference: lending.String("similique"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + SubTotal: types.MustNewDecimalFromString("8742.88"), + SupplementalData: &shared.SupplementalData{ + Content: map[string]map[string]interface{}{ + "ducimus": map[string]interface{}{ + "dolore": "quibusdam", + }, + }, + }, + TaxAmount: types.MustNewDecimalFromString("8489.44"), + TotalAmount: types.MustNewDecimalFromString("1943.42"), + }, + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(617877), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateDirectCostResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateDirectCostRequest](../../models/operations/createdirectcostrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateDirectCostResponse](../../models/operations/createdirectcostresponse.md), error** + + +## 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/accounting-api#/schemas/DirectCost) for a given company and integration. + +[Direct costs](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.DirectCosts.GetCreateModel(ctx, operations.GetCreateDirectCostsModelRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateDirectCostsModelRequest](../../models/operations/getcreatedirectcostsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateDirectCostsModelResponse](../../models/operations/getcreatedirectcostsmodelresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebacksuppliers/README.md b/lending/docs/sdks/loanwritebacksuppliers/README.md new file mode 100755 index 000000000..d8f7a1d70 --- /dev/null +++ b/lending/docs/sdks/loanwritebacksuppliers/README.md @@ -0,0 +1,167 @@ +# 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/accounting-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Suppliers.Create(ctx, operations.CreateSupplierRequest{ + AccountingSupplier: &shared.AccountingSupplier{ + Addresses: []shared.AccountingAddress{ + shared.AccountingAddress{ + City: lending.String("Ankundingworth"), + Country: lending.String("Guadeloupe"), + Line1: lending.String("nulla"), + Line2: lending.String("fugit"), + PostalCode: lending.String("99474-0623"), + Region: lending.String("ea"), + Type: shared.AccountingAddressTypeUnknown, + }, + }, + ContactName: lending.String("vel"), + DefaultCurrency: lending.String("possimus"), + EmailAddress: lending.String("magnam"), + ID: lending.String("36813f16-d9f5-4fce-ac55-6146c3e250fb"), + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(false), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + Phone: lending.String("+44 25691 154789"), + RegistrationNumber: lending.String("deleniti"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + Status: shared.SupplierStatusUnknown, + SupplementalData: &shared.SupplementalData{ + Content: map[string]map[string]interface{}{ + "fugit": map[string]interface{}{ + "accusamus": "inventore", + }, + }, + }, + SupplierName: lending.String("non"), + TaxNumber: lending.String("et"), + }, + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(677412), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateSupplierResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateSupplierRequest](../../models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateSupplierResponse](../../models/operations/createsupplierresponse.md), error** + + +## 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/accounting-api#/schemas/Supplier) for a given company and integration. + +[Suppliers](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Suppliers.GetCreateUpdateModel(ctx, operations.GetCreateUpdateSuppliersModelRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateUpdateSuppliersModelRequest](../../models/operations/getcreateupdatesuppliersmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateUpdateSuppliersModelResponse](../../models/operations/getcreateupdatesuppliersmodelresponse.md), error** + diff --git a/lending/docs/sdks/loanwritebacktransfers/README.md b/lending/docs/sdks/loanwritebacktransfers/README.md new file mode 100755 index 000000000..ee80deb54 --- /dev/null +++ b/lending/docs/sdks/loanwritebacktransfers/README.md @@ -0,0 +1,183 @@ +# 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/accounting-api#/schemas/Transfer) for a given company's connection. + +[Transfers](https://docs.codat.io/accounting-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/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Transfers.Create(ctx, operations.CreateTransferRequest{ + AccountingTransfer: &shared.AccountingTransfer{ + ContactRef: &shared.AccountingTransferContactRef{ + DataType: lending.String("laborum"), + ID: "c366c8dd-6b14-4429-8747-4778a7bd466d", + }, + Date: lending.String("2022-10-23T00:00:00.000Z"), + DepositedRecordRefs: []shared.RecordRef{ + shared.RecordRef{ + DataType: lending.String("accountTransaction"), + ID: lending.String("c10ab3cd-ca42-4519-84e5-23c7e0bc7178"), + }, + }, + Description: lending.String("accusamus"), + From: &shared.TransferAccount{ + AccountRef: &shared.AccountRef{ + ID: lending.String("4796f2a7-0c68-4828-aaa4-82562f222e98"), + Name: lending.String("Tamara Vandervort IV"), + }, + Amount: types.MustNewDecimalFromString("8003.79"), + Currency: lending.String("EUR"), + }, + ID: lending.String("e61e6b7b-95bc-40ab-bc20-c4f3789fd871"), + Metadata: &shared.Metadata{ + IsDeleted: lending.Bool(false), + }, + ModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + SourceModifiedDate: lending.String("2022-10-23T00:00:00.000Z"), + SupplementalData: &shared.SupplementalData{ + Content: map[string]map[string]interface{}{ + "sint": map[string]interface{}{ + "pariatur": "possimus", + }, + }, + }, + To: &shared.TransferAccount{ + AccountRef: &shared.AccountRef{ + ID: lending.String("2efd121a-a6f1-4e67-8bdb-04f15756082d"), + Name: lending.String("Cassandra Ward V"), + }, + Amount: types.MustNewDecimalFromString("9453.02"), + Currency: lending.String("GBP"), + }, + TrackingCategoryRefs: []shared.TrackingCategoryRef{ + shared.TrackingCategoryRef{ + ID: "d1705133-9d08-4086-a184-0394c26071f9", + Name: lending.String("Camille Hirthe III"), + }, + }, + }, + AllowSyncOnPushComplete: lending.Bool(false), + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + ForceUpdate: lending.Bool(false), + TimeoutInMinutes: lending.Int(310067), + }) + if err != nil { + log.Fatal(err) + } + + if res.AccountingCreateTransferResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreateTransferRequest](../../models/operations/createtransferrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.CreateTransferResponse](../../models/operations/createtransferresponse.md), error** + + +## GetCreateModel + +The *Get create transfer model* endpoint returns the expected data for the request payload when creating a [transfer](https://docs.codat.io/accounting-api#/schemas/Transfer) for a given company and integration. + +[Transfers](https://docs.codat.io/accounting-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 + +```go +package main + +import( + "context" + "log" + "github.com/codatio/client-sdk-go/lending/v4" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" +) + +func main() { + s := lending.New( + lending.WithSecurity(shared.Security{ + AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", + }), + ) + + ctx := context.Background() + res, err := s.LoanWriteback.Transfers.GetCreateModel(ctx, operations.GetCreateTransfersModelRequest{ + CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", + ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + if err != nil { + log.Fatal(err) + } + + if res.PushOption != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreateTransfersModelRequest](../../models/operations/getcreatetransfersmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + + +### Response + +**[*operations.GetCreateTransfersModelResponse](../../models/operations/getcreatetransfersmodelresponse.md), error** + diff --git a/lending/docs/sdks/managedata/README.md b/lending/docs/sdks/managedata/README.md index 5012ca690..890e16180 100755 --- a/lending/docs/sdks/managedata/README.md +++ b/lending/docs/sdks/managedata/README.md @@ -22,8 +22,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/managedatapulloperations/README.md b/lending/docs/sdks/managedatapulloperations/README.md index 94ba00855..dc1c7ab07 100755 --- a/lending/docs/sdks/managedatapulloperations/README.md +++ b/lending/docs/sdks/managedatapulloperations/README.md @@ -23,8 +23,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -76,8 +76,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -85,10 +85,10 @@ func main() { ctx := context.Background() res, err := s.ManageData.PullOperations.List(ctx, operations.ListPullOperationsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("natus"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("consequuntur"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/managedatarefresh/README.md b/lending/docs/sdks/managedatarefresh/README.md index b7d5e471b..ccc23379c 100755 --- a/lending/docs/sdks/managedatarefresh/README.md +++ b/lending/docs/sdks/managedatarefresh/README.md @@ -27,8 +27,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -81,8 +81,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -90,7 +90,7 @@ func main() { ctx := context.Background() res, err := s.ManageData.Refresh.DataType(ctx, operations.RefreshDataTypeRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - ConnectionID: codatlending.String("29396fea-7596-4eb1-8faa-a2352c595590"), + ConnectionID: lending.String("dac7af51-5cc4-413a-a63a-ae8d67864dbb"), DataType: shared.DataTypeInvoices, }) if err != nil { diff --git a/lending/docs/sdks/salescustomers/README.md b/lending/docs/sdks/salescustomers/README.md index 05da75638..9aa792a9d 100755 --- a/lending/docs/sdks/salescustomers/README.md +++ b/lending/docs/sdks/salescustomers/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Customers.Get(ctx, operations.GetCommerceCustomerRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - CustomerID: "iure", + CustomerID: "commodi", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Customers.List(ctx, operations.ListCommerceCustomersRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("culpa"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("in"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salesdisputes/README.md b/lending/docs/sdks/salesdisputes/README.md index e3ada11b7..4614002b6 100755 --- a/lending/docs/sdks/salesdisputes/README.md +++ b/lending/docs/sdks/salesdisputes/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Disputes.Get(ctx, operations.GetCommerceDisputeRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DisputeID: "doloribus", + DisputeID: "corporis", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Disputes.List(ctx, operations.ListCommerceDisputesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("sapiente"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("reiciendis"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/saleslocations/README.md b/lending/docs/sdks/saleslocations/README.md index b1578cdbd..cf7619c4d 100755 --- a/lending/docs/sdks/saleslocations/README.md +++ b/lending/docs/sdks/saleslocations/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Locations.Get(ctx, operations.GetCommerceLocationRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - LocationID: "architecto", + LocationID: "assumenda", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) diff --git a/lending/docs/sdks/salesmetrics/README.md b/lending/docs/sdks/salesmetrics/README.md index 804d4b9d1..c864c45a0 100755 --- a/lending/docs/sdks/salesmetrics/README.md +++ b/lending/docs/sdks/salesmetrics/README.md @@ -52,8 +52,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -62,10 +62,10 @@ func main() { res, err := s.Sales.Metrics.GetCustomerRetention(ctx, operations.GetCommerceCustomerRetentionMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - IncludeDisplayNames: codatlending.Bool(false), - NumberOfPeriods: 652790, - PeriodLength: 208876, - PeriodUnit: shared.PeriodUnitMonth, + IncludeDisplayNames: lending.Bool(false), + NumberOfPeriods: 363161, + PeriodLength: 924967, + PeriodUnit: shared.PeriodUnitWeek, ReportDate: "29-09-2020", }) if err != nil { @@ -132,8 +132,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -142,10 +142,10 @@ func main() { res, err := s.Sales.Metrics.GetLifetimeValue(ctx, operations.GetCommerceLifetimeValueMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - IncludeDisplayNames: codatlending.Bool(false), - NumberOfPeriods: 161309, - PeriodLength: 995300, - PeriodUnit: shared.PeriodUnitMonth, + IncludeDisplayNames: lending.Bool(false), + NumberOfPeriods: 46007, + PeriodLength: 738683, + PeriodUnit: shared.PeriodUnitDay, ReportDate: "29-09-2020", }) if err != nil { @@ -213,8 +213,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -223,10 +223,10 @@ func main() { res, err := s.Sales.Metrics.GetRevenue(ctx, operations.GetCommerceRevenueMetricsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - IncludeDisplayNames: codatlending.Bool(false), - NumberOfPeriods: 581850, - PeriodLength: 253291, - PeriodUnit: shared.PeriodUnitWeek, + IncludeDisplayNames: lending.Bool(false), + NumberOfPeriods: 449083, + PeriodLength: 348519, + PeriodUnit: shared.PeriodUnitYear, ReportDate: "29-09-2020", }) if err != nil { diff --git a/lending/docs/sdks/salesorders/README.md b/lending/docs/sdks/salesorders/README.md index 973bab138..5be9417cb 100755 --- a/lending/docs/sdks/salesorders/README.md +++ b/lending/docs/sdks/salesorders/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Orders.Get(ctx, operations.GetCommerceOrderRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderID: "quam", + OrderID: "facere", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Orders.List(ctx, operations.ListCommerceOrdersRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("molestiae"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("numquam"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salespaymentmethods/README.md b/lending/docs/sdks/salespaymentmethods/README.md index d3b380ef6..089a5e97b 100755 --- a/lending/docs/sdks/salespaymentmethods/README.md +++ b/lending/docs/sdks/salespaymentmethods/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.PaymentMethods.Get(ctx, operations.GetCommercePaymentMethodRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - PaymentMethodID: "velit", + PaymentMethodID: "doloribus", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.PaymentMethods.List(ctx, operations.ListCommercePaymentMethodsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("error"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("suscipit"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salespayments/README.md b/lending/docs/sdks/salespayments/README.md index ee6f1a7db..0a35b259b 100755 --- a/lending/docs/sdks/salespayments/README.md +++ b/lending/docs/sdks/salespayments/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Payments.Get(ctx, operations.GetCommercePaymentRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - PaymentID: "quia", + PaymentID: "reiciendis", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Payments.List(ctx, operations.ListCommercePaymentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("quis"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("quidem"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salesproductcategories/README.md b/lending/docs/sdks/salesproductcategories/README.md index 3c1689ce6..f54ccbdb8 100755 --- a/lending/docs/sdks/salesproductcategories/README.md +++ b/lending/docs/sdks/salesproductcategories/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.ProductCategories.Get(ctx, operations.GetCommerceProductCategoryRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - ProductID: "vitae", + ProductID: "saepe", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.ProductCategories.List(ctx, operations.ListCommerceProductCategoriesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("laborum"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("necessitatibus"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salesproducts/README.md b/lending/docs/sdks/salesproducts/README.md index 533798b74..055eb9527 100755 --- a/lending/docs/sdks/salesproducts/README.md +++ b/lending/docs/sdks/salesproducts/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Products.Get(ctx, operations.GetCommerceProductRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - ProductID: "animi", + ProductID: "dolore", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Products.List(ctx, operations.ListCommerceProductsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("enim"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("sunt"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/salesreports/README.md b/lending/docs/sdks/salesreports/README.md index cb07c2e3b..1fa043938 100755 --- a/lending/docs/sdks/salesreports/README.md +++ b/lending/docs/sdks/salesreports/README.md @@ -46,8 +46,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -56,9 +56,9 @@ func main() { res, err := s.Sales.Reports.GetOrders(ctx, operations.GetCommerceOrdersReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - IncludeDisplayNames: codatlending.Bool(false), - NumberOfPeriods: 138183, - PeriodLength: 778346, + IncludeDisplayNames: lending.Bool(false), + NumberOfPeriods: 992012, + PeriodLength: 241545, PeriodUnit: shared.PeriodUnitDay, ReportDate: "29-09-2020", }) @@ -128,8 +128,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -138,10 +138,10 @@ func main() { res, err := s.Sales.Reports.GetRefunds(ctx, operations.GetCommerceRefundsReportRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - IncludeDisplayNames: codatlending.Bool(false), - NumberOfPeriods: 949572, - PeriodLength: 368725, - PeriodUnit: shared.PeriodUnitMonth, + IncludeDisplayNames: lending.Bool(false), + NumberOfPeriods: 228263, + PeriodLength: 105906, + PeriodUnit: shared.PeriodUnitWeek, ReportDate: "29-09-2020", }) if err != nil { diff --git a/lending/docs/sdks/salestransactions/README.md b/lending/docs/sdks/salestransactions/README.md index a8d79a440..e1ffd4016 100755 --- a/lending/docs/sdks/salestransactions/README.md +++ b/lending/docs/sdks/salestransactions/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Sales.Transactions.Get(ctx, operations.GetCommerceTransactionRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransactionID: "possimus", + TransactionID: "a", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Sales.Transactions.List(ctx, operations.ListCommerceTransactionsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("aut"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("debitis"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/transactionsaccounttransactions/README.md b/lending/docs/sdks/transactionsaccounttransactions/README.md index 16255c80a..9233e443b 100755 --- a/lending/docs/sdks/transactionsaccounttransactions/README.md +++ b/lending/docs/sdks/transactionsaccounttransactions/README.md @@ -30,15 +30,15 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) ctx := context.Background() res, err := s.Transactions.AccountTransactions.Get(ctx, operations.GetAccountingAccountTransactionRequest{ - AccountTransactionID: "quasi", + AccountTransactionID: "consectetur", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", }) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Transactions.AccountTransactions.List(ctx, operations.ListAccountingAccountTransactionsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("error"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("corporis"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/transactionsdirectcosts/README.md b/lending/docs/sdks/transactionsdirectcosts/README.md index 4f7f38e8c..7ce5dc263 100755 --- a/lending/docs/sdks/transactionsdirectcosts/README.md +++ b/lending/docs/sdks/transactionsdirectcosts/README.md @@ -31,8 +31,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -42,7 +42,7 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "temporibus", + DirectCostID: "harum", }) if err != nil { log.Fatal(err) @@ -93,8 +93,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -103,7 +103,7 @@ func main() { res, err := s.Transactions.DirectCosts.Get(ctx, operations.GetAccountingDirectCostRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "laborum", + DirectCostID: "laboriosam", }) if err != nil { log.Fatal(err) @@ -152,8 +152,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -163,7 +163,7 @@ func main() { AttachmentID: "8a210b68-6988-11ed-a1eb-0242ac120002", CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "quasi", + DirectCostID: "ipsa", }) if err != nil { log.Fatal(err) @@ -212,8 +212,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -222,10 +222,10 @@ func main() { res, err := s.Transactions.DirectCosts.List(ctx, operations.ListAccountingDirectCostsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("reiciendis"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("voluptates"), }) if err != nil { log.Fatal(err) @@ -274,8 +274,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -284,7 +284,7 @@ func main() { res, err := s.Transactions.DirectCosts.ListAttachments(ctx, operations.ListAccountingDirectCostAttachmentsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - DirectCostID: "voluptatibus", + DirectCostID: "libero", }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/transactionsjournalentries/README.md b/lending/docs/sdks/transactionsjournalentries/README.md index ce3897771..eaa01f823 100755 --- a/lending/docs/sdks/transactionsjournalentries/README.md +++ b/lending/docs/sdks/transactionsjournalentries/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -39,7 +39,7 @@ func main() { ctx := context.Background() res, err := s.Transactions.JournalEntries.Get(ctx, operations.GetAccountingJournalEntryRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - JournalEntryID: "vero", + JournalEntryID: "vitae", }) if err != nil { log.Fatal(err) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.Transactions.JournalEntries.List(ctx, operations.ListAccountingJournalEntriesRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("nihil"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("accusamus"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/transactionsjournals/README.md b/lending/docs/sdks/transactionsjournals/README.md index f7f4019bd..00a86c190 100755 --- a/lending/docs/sdks/transactionsjournals/README.md +++ b/lending/docs/sdks/transactionsjournals/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -39,7 +39,7 @@ func main() { ctx := context.Background() res, err := s.Transactions.Journals.Get(ctx, operations.GetAccountingJournalRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - JournalID: "praesentium", + JournalID: "similique", }) if err != nil { log.Fatal(err) @@ -88,8 +88,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -97,10 +97,10 @@ func main() { ctx := context.Background() res, err := s.Transactions.Journals.List(ctx, operations.ListAccountingJournalsRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("voluptatibus"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("tempora"), }) if err != nil { log.Fatal(err) diff --git a/lending/docs/sdks/transactionstransfers/README.md b/lending/docs/sdks/transactionstransfers/README.md index 30f72fbed..45f4f53db 100755 --- a/lending/docs/sdks/transactionstransfers/README.md +++ b/lending/docs/sdks/transactionstransfers/README.md @@ -30,8 +30,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -40,7 +40,7 @@ func main() { res, err := s.Transactions.Transfers.Get(ctx, operations.GetAccountingTransferRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - TransferID: "ipsa", + TransferID: "aspernatur", }) if err != nil { log.Fatal(err) @@ -89,8 +89,8 @@ import( ) func main() { - s := codatlending.New( - codatlending.WithSecurity(shared.Security{ + s := lending.New( + lending.WithSecurity(shared.Security{ AuthHeader: "Basic BASE_64_ENCODED(API_KEY)", }), ) @@ -99,10 +99,10 @@ func main() { res, err := s.Transactions.Transfers.List(ctx, operations.ListAccountingTransfersRequest{ CompanyID: "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionID: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - OrderBy: codatlending.String("-modifiedDate"), - Page: codatlending.Int(1), - PageSize: codatlending.Int(100), - Query: codatlending.String("omnis"), + OrderBy: lending.String("-modifiedDate"), + Page: lending.Int(1), + PageSize: lending.Int(100), + Query: lending.String("voluptas"), }) if err != nil { log.Fatal(err) diff --git a/lending/excelreports.go b/lending/excelreports.go index 88b4e0ec0..fc6f1b408 100755 --- a/lending/excelreports.go +++ b/lending/excelreports.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -130,12 +130,12 @@ func (s *excelReports) Download(ctx context.Context, request operations.Download case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -243,12 +243,12 @@ func (s *excelReports) Generate(ctx context.Context, request operations.Generate case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ExcelStatus - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ExcelStatus + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ExcelStatus = out + res.ExcelStatus = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -257,12 +257,12 @@ func (s *excelReports) Generate(ctx context.Context, request operations.Generate case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -361,12 +361,12 @@ func (s *excelReports) GetStatus(ctx context.Context, request operations.GetExce case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ExcelStatus - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ExcelStatus + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ExcelStatus = out + res.ExcelStatus = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -375,12 +375,12 @@ func (s *excelReports) GetStatus(ctx context.Context, request operations.GetExce case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/files.gen b/lending/files.gen index 0bf8b7d47..5e37cc4d2 100755 --- a/lending/files.gen +++ b/lending/files.gen @@ -30,6 +30,14 @@ financialstatementsbalancesheet.go financialstatementscashflow.go financialstatementsprofitandloss.go financialstatements.go +loanwritebackaccounts.go +loanwritebackbankaccounts.go +loanwritebackbanktransactions.go +loanwritebackcreateoperations.go +loanwritebackdirectcosts.go +loanwritebacksuppliers.go +loanwritebacktransfers.go +loanwriteback.go managedatapulloperations.go managedatarefresh.go managedata.go @@ -62,6 +70,7 @@ pkg/types/decimal.go pkg/utils/contenttype.go pkg/utils/form.go pkg/utils/headers.go +pkg/utils/json.go pkg/utils/pathparams.go pkg/utils/queryparams.go pkg/utils/requestbody.go @@ -148,6 +157,20 @@ pkg/models/operations/getcategorizedbalancesheetstatement.go pkg/models/operations/getaccountingcashflowstatement.go pkg/models/operations/getaccountingprofitandloss.go pkg/models/operations/getcategorizedprofitandlossstatement.go +pkg/models/operations/createaccount.go +pkg/models/operations/getcreatechartofaccountsmodel.go +pkg/models/operations/createbankaccount.go +pkg/models/operations/getcreateupdatebankaccountsmodel.go +pkg/models/operations/createbanktransactions.go +pkg/models/operations/getcreatebanktransactionsmodel.go +pkg/models/operations/getcreateoperation.go +pkg/models/operations/listcreateoperations.go +pkg/models/operations/createdirectcost.go +pkg/models/operations/getcreatedirectcostsmodel.go +pkg/models/operations/createsupplier.go +pkg/models/operations/getcreateupdatesuppliersmodel.go +pkg/models/operations/createtransfer.go +pkg/models/operations/getcreatetransfersmodel.go pkg/models/operations/getpulloperation.go pkg/models/operations/listpulloperations.go pkg/models/operations/refreshalldatatypes.go @@ -351,9 +374,37 @@ pkg/models/shared/reportinput.go pkg/models/shared/reportbasis.go pkg/models/shared/accountingprofitandlossreport.go pkg/models/shared/profitandlossreport.go +pkg/models/shared/accountingcreateaccountresponse.go +pkg/models/shared/validation.go +pkg/models/shared/validationitem.go +pkg/models/shared/pushoperationstatus.go +pkg/models/shared/datatype.go +pkg/models/shared/pushoperationchange.go +pkg/models/shared/pushchangetype.go +pkg/models/shared/pushoperationref.go +pkg/models/shared/pushoption.go +pkg/models/shared/pushvalidationinfo.go +pkg/models/shared/pushfieldvalidation.go +pkg/models/shared/pushoptiontype.go +pkg/models/shared/pushoptionproperty.go +pkg/models/shared/pushoptionchoice.go +pkg/models/shared/accountingcreatebankaccountresponse.go +pkg/models/shared/accountingcreatebanktransactionsresponse.go +pkg/models/shared/accountingcreatebanktransactions.go +pkg/models/shared/createbankaccounttransaction.go +pkg/models/shared/pushoperation.go +pkg/models/shared/pushoperations.go +pkg/models/shared/accountingcreatedirectcostresponse.go +pkg/models/shared/accountingdirectcost.go +pkg/models/shared/directcostlineitem.go +pkg/models/shared/tracking.go +pkg/models/shared/recordref.go +pkg/models/shared/accountingcreatesupplierresponse.go +pkg/models/shared/accountingcreatetransferresponse.go +pkg/models/shared/accountingtransfer.go +pkg/models/shared/transferaccount.go pkg/models/shared/pulloperation.go pkg/models/shared/pulloperations.go -pkg/models/shared/datatype.go pkg/models/shared/datastatus.go pkg/models/shared/commercecustomer.go pkg/models/shared/commercecustomers.go @@ -406,12 +457,8 @@ pkg/models/shared/transactiontype.go pkg/models/shared/commercetransactions.go pkg/models/shared/accountingaccounttransaction.go pkg/models/shared/accounttransactionline.go -pkg/models/shared/recordref.go pkg/models/shared/bankaccountref.go pkg/models/shared/accountingaccounttransactions.go -pkg/models/shared/accountingdirectcost.go -pkg/models/shared/directcostlineitem.go -pkg/models/shared/tracking.go pkg/models/shared/accountingdirectcosts.go pkg/models/shared/accountingjournalentry.go pkg/models/shared/journalref.go @@ -420,8 +467,6 @@ pkg/models/shared/accountingjournalentries.go pkg/models/shared/accountingjournal.go pkg/models/shared/journalstatus.go pkg/models/shared/accountingjournals.go -pkg/models/shared/accountingtransfer.go -pkg/models/shared/transferaccount.go pkg/models/shared/accountingtransfers.go pkg/models/shared/security.go pkg/models/shared/accountcategoriesupdatedwebhook.go @@ -467,6 +512,14 @@ docs/sdks/financialstatementsaccounts/README.md docs/sdks/financialstatementsbalancesheet/README.md docs/sdks/financialstatementscashflow/README.md docs/sdks/financialstatementsprofitandloss/README.md +docs/sdks/loanwriteback/README.md +docs/sdks/loanwritebackaccounts/README.md +docs/sdks/loanwritebackbankaccounts/README.md +docs/sdks/loanwritebackbanktransactions/README.md +docs/sdks/loanwritebackcreateoperations/README.md +docs/sdks/loanwritebackdirectcosts/README.md +docs/sdks/loanwritebacksuppliers/README.md +docs/sdks/loanwritebacktransfers/README.md docs/sdks/managedata/README.md docs/sdks/managedatapulloperations/README.md docs/sdks/managedatarefresh/README.md @@ -653,6 +706,34 @@ docs/models/operations/getaccountingprofitandlossrequest.md docs/models/operations/getaccountingprofitandlossresponse.md docs/models/operations/getcategorizedprofitandlossstatementrequest.md docs/models/operations/getcategorizedprofitandlossstatementresponse.md +docs/models/operations/createaccountrequest.md +docs/models/operations/createaccountresponse.md +docs/models/operations/getcreatechartofaccountsmodelrequest.md +docs/models/operations/getcreatechartofaccountsmodelresponse.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/getcreateoperationrequest.md +docs/models/operations/getcreateoperationresponse.md +docs/models/operations/listcreateoperationsrequest.md +docs/models/operations/listcreateoperationsresponse.md +docs/models/operations/createdirectcostrequest.md +docs/models/operations/createdirectcostresponse.md +docs/models/operations/getcreatedirectcostsmodelrequest.md +docs/models/operations/getcreatedirectcostsmodelresponse.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/getpulloperationrequest.md docs/models/operations/getpulloperationresponse.md docs/models/operations/listpulloperationsrequest.md @@ -909,10 +990,39 @@ docs/models/shared/reportinput.md docs/models/shared/reportbasis.md docs/models/shared/accountingprofitandlossreport.md docs/models/shared/profitandlossreport.md +docs/models/shared/accountingcreateaccountresponse.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/accountingcreatebankaccountresponse.md +docs/models/shared/accountingcreatebanktransactionsresponse.md +docs/models/shared/accountingcreatebanktransactions.md +docs/models/shared/createbankaccounttransaction.md +docs/models/shared/pushoperation.md +docs/models/shared/pushoperations.md +docs/models/shared/accountingcreatedirectcostresponse.md +docs/models/shared/accountingdirectcost.md +docs/models/shared/directcostlineitem.md +docs/models/shared/tracking.md +docs/models/shared/recordref.md +docs/models/shared/accountingcreatesupplierresponse.md +docs/models/shared/accountingcreatetransferresponse.md +docs/models/shared/accountingtransfercontactref.md +docs/models/shared/accountingtransfer.md +docs/models/shared/transferaccount.md docs/models/shared/pulloperationstatus.md docs/models/shared/pulloperation.md docs/models/shared/pulloperations.md -docs/models/shared/datatype.md docs/models/shared/datastatus.md docs/models/shared/commercecustomer.md docs/models/shared/commercecustomers.md @@ -968,12 +1078,8 @@ docs/models/shared/commercetransactions.md docs/models/shared/accountingaccounttransactionstatus.md docs/models/shared/accountingaccounttransaction.md docs/models/shared/accounttransactionline.md -docs/models/shared/recordref.md docs/models/shared/bankaccountref.md docs/models/shared/accountingaccounttransactions.md -docs/models/shared/accountingdirectcost.md -docs/models/shared/directcostlineitem.md -docs/models/shared/tracking.md docs/models/shared/accountingdirectcosts.md docs/models/shared/accountingjournalentry.md docs/models/shared/journalref.md @@ -983,9 +1089,6 @@ docs/models/shared/accountingjournalentries.md docs/models/shared/accountingjournal.md docs/models/shared/journalstatus.md docs/models/shared/accountingjournals.md -docs/models/shared/accountingtransfercontactref.md -docs/models/shared/accountingtransfer.md -docs/models/shared/transferaccount.md docs/models/shared/accountingtransfers.md docs/models/shared/security.md docs/models/shared/accountcategoriesupdatedwebhook.md diff --git a/lending/fileupload.go b/lending/fileupload.go index 0198679ee..55d7c535e 100755 --- a/lending/fileupload.go +++ b/lending/fileupload.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -130,12 +130,12 @@ func (s *fileUpload) Download(ctx context.Context, request operations.DownloadFi case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -227,7 +227,7 @@ func (s *fileUpload) ListUploaded(ctx context.Context, request operations.ListFi switch { case utils.MatchContentType(contentType, `application/json`): var out []shared.File - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -242,12 +242,12 @@ func (s *fileUpload) ListUploaded(ctx context.Context, request operations.ListFi case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -281,7 +281,7 @@ func (s *fileUpload) Upload(ctx context.Context, request operations.UploadFilesR return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "RequestBody", "multipart") + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "multipart", `multipartForm:"file" request:"mediaType=multipart/form-data"`) if err != nil { return nil, fmt.Errorf("error serializing request body: %w", err) } @@ -358,12 +358,12 @@ func (s *fileUpload) Upload(ctx context.Context, request operations.UploadFilesR case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/financialstatements.go b/lending/financialstatements.go index 4f2394016..8dc30ceef 100755 --- a/lending/financialstatements.go +++ b/lending/financialstatements.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type financialStatements struct { Accounts *financialStatementsAccounts diff --git a/lending/financialstatementsaccounts.go b/lending/financialstatementsaccounts.go index 3a14526f2..265283b4b 100755 --- a/lending/financialstatementsaccounts.go +++ b/lending/financialstatementsaccounts.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *financialStatementsAccounts) Get(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAccount - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAccount + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAccount = out + res.AccountingAccount = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *financialStatementsAccounts) Get(ctx context.Context, request operation case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *financialStatementsAccounts) List(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAccounts - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAccounts + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAccounts = out + res.AccountingAccounts = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *financialStatementsAccounts) List(ctx context.Context, request operatio case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/financialstatementsbalancesheet.go b/lending/financialstatementsbalancesheet.go index bd62be9c1..8ffb942fb 100755 --- a/lending/financialstatementsbalancesheet.go +++ b/lending/financialstatementsbalancesheet.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -110,12 +110,12 @@ func (s *financialStatementsBalanceSheet) Get(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingBalanceSheet - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingBalanceSheet + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingBalanceSheet = out + res.AccountingBalanceSheet = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -128,12 +128,12 @@ func (s *financialStatementsBalanceSheet) Get(ctx context.Context, request opera case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -230,12 +230,12 @@ func (s *financialStatementsBalanceSheet) GetCategorizedAccounts(ctx context.Con case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.EnhancedFinancialReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.EnhancedFinancialReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.EnhancedFinancialReport = out + res.EnhancedFinancialReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -244,12 +244,12 @@ func (s *financialStatementsBalanceSheet) GetCategorizedAccounts(ctx context.Con case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/financialstatementscashflow.go b/lending/financialstatementscashflow.go index 3d1bed7d8..d7f188e87 100755 --- a/lending/financialstatementscashflow.go +++ b/lending/financialstatementscashflow.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -110,12 +110,12 @@ func (s *financialStatementsCashFlow) Get(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingCashFlowStatement - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingCashFlowStatement + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingCashFlowStatement = out + res.AccountingCashFlowStatement = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -128,12 +128,12 @@ func (s *financialStatementsCashFlow) Get(ctx context.Context, request operation case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/financialstatementsprofitandloss.go b/lending/financialstatementsprofitandloss.go index f05eb2950..4b83a2414 100755 --- a/lending/financialstatementsprofitandloss.go +++ b/lending/financialstatementsprofitandloss.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -110,12 +110,12 @@ func (s *financialStatementsProfitAndLoss) Get(ctx context.Context, request oper case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingProfitAndLossReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingProfitAndLossReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingProfitAndLossReport = out + res.AccountingProfitAndLossReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -128,12 +128,12 @@ func (s *financialStatementsProfitAndLoss) Get(ctx context.Context, request oper case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -230,12 +230,12 @@ func (s *financialStatementsProfitAndLoss) GetCategorizedAccounts(ctx context.Co case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.EnhancedFinancialReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.EnhancedFinancialReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.EnhancedFinancialReport = out + res.EnhancedFinancialReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -244,12 +244,12 @@ func (s *financialStatementsProfitAndLoss) GetCategorizedAccounts(ctx context.Co case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/gen.yaml b/lending/gen.yaml index caf8c007e..34ac592dc 100644 --- a/lending/gen.yaml +++ b/lending/gen.yaml @@ -1,16 +1,17 @@ configVersion: 1.0.0 management: - docChecksum: 982c021127b5297fc7c1c1779001c328 + docChecksum: 0add1e087e1653186370d8ee74641f07 docVersion: 3.0.0 - speakeasyVersion: 1.87.0 - generationVersion: 2.116.0 + speakeasyVersion: 1.88.1 + generationVersion: 2.122.1 generation: sdkClassName: CodatLending singleTagPerOp: false telemetryEnabled: true features: go: - core: 2.88.2 + constsAndDefaults: 0.1.0 + core: 2.88.3 deprecations: 2.81.1 examples: 2.81.2 globalSecurity: 2.81.1 @@ -19,6 +20,6 @@ features: nameOverrides: 2.81.1 retries: 2.82.1 go: - version: 4.1.0 + version: 4.2.0 maxMethodParams: 0 packageName: github.com/codatio/client-sdk-go/lending diff --git a/lending/go.mod b/lending/go.mod index 8ab3c461d..1d007117a 100755 --- a/lending/go.mod +++ b/lending/go.mod @@ -4,6 +4,7 @@ go 1.14 require ( github.com/cenkalti/backoff/v4 v4.2.0 - github.com/spyzhov/ajson v0.8.0 // indirect github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/mitchellh/mapstructure v1.5.0 + github.com/spyzhov/ajson v0.8.0 ) diff --git a/lending/go.sum b/lending/go.sum index 1f07f5100..ae03a472a 100755 --- a/lending/go.sum +++ b/lending/go.sum @@ -2,5 +2,7 @@ github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+M github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/spyzhov/ajson v0.8.0 h1:sFXyMbi4Y/BKjrsfkUZHSjA2JM1184enheSjjoT/zCc= github.com/spyzhov/ajson v0.8.0/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA= diff --git a/lending/liabilities.go b/lending/liabilities.go index e79918ad2..9823e2c7e 100755 --- a/lending/liabilities.go +++ b/lending/liabilities.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -111,12 +111,12 @@ func (s *liabilities) GetLoanSummary(ctx context.Context, request operations.Get case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.LoanSummary - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.LoanSummary + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.LoanSummary = out + res.LoanSummary = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -125,12 +125,12 @@ func (s *liabilities) GetLoanSummary(ctx context.Context, request operations.Get case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *liabilities) ListLoanTransactions(ctx context.Context, request operatio case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.LoanTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.LoanTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.LoanTransactions = out + res.LoanTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -243,12 +243,12 @@ func (s *liabilities) ListLoanTransactions(ctx context.Context, request operatio case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/loanwriteback.go b/lending/loanwriteback.go new file mode 100755 index 000000000..aa4d11094 --- /dev/null +++ b/lending/loanwriteback.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +type loanWriteback struct { + Accounts *loanWritebackAccounts + BankAccounts *loanWritebackBankAccounts + BankTransactions *loanWritebackBankTransactions + CreateOperations *loanWritebackCreateOperations + DirectCosts *loanWritebackDirectCosts + Suppliers *loanWritebackSuppliers + Transfers *loanWritebackTransfers + + sdkConfiguration sdkConfiguration +} + +func newLoanWriteback(sdkConfig sdkConfiguration) *loanWriteback { + return &loanWriteback{ + sdkConfiguration: sdkConfig, + Accounts: newLoanWritebackAccounts(sdkConfig), + BankAccounts: newLoanWritebackBankAccounts(sdkConfig), + BankTransactions: newLoanWritebackBankTransactions(sdkConfig), + CreateOperations: newLoanWritebackCreateOperations(sdkConfig), + DirectCosts: newLoanWritebackDirectCosts(sdkConfig), + Suppliers: newLoanWritebackSuppliers(sdkConfig), + Transfers: newLoanWritebackTransfers(sdkConfig), + } +} diff --git a/lending/loanwritebackaccounts.go b/lending/loanwritebackaccounts.go new file mode 100755 index 000000000..b54ec82ba --- /dev/null +++ b/lending/loanwritebackaccounts.go @@ -0,0 +1,278 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackAccounts struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackAccounts(sdkConfig sdkConfiguration) *loanWritebackAccounts { + return &loanWritebackAccounts{ + sdkConfiguration: sdkConfig, + } +} + +// Create account +// The *Create account* endpoint creates a new [account](https://docs.codat.io/accounting-api#/schemas/Account) for a given company's connection. +// +// [Accounts](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackAccounts) Create(ctx context.Context, request operations.CreateAccountRequest, opts ...operations.Option) (*operations.CreateAccountResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/accounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingAccount", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateAccountResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateAccountResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateAccountResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateModel - 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/accounting-api#/schemas/Account) for a given company and integration. +// +// [Accounts](https://docs.codat.io/accounting-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. +func (s *loanWritebackAccounts) GetCreateModel(ctx context.Context, request operations.GetCreateChartOfAccountsModelRequest, opts ...operations.Option) (*operations.GetCreateChartOfAccountsModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateChartOfAccountsModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebackbankaccounts.go b/lending/loanwritebackbankaccounts.go new file mode 100755 index 000000000..7d5a58eb3 --- /dev/null +++ b/lending/loanwritebackbankaccounts.go @@ -0,0 +1,278 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackBankAccounts struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackBankAccounts(sdkConfig sdkConfiguration) *loanWritebackBankAccounts { + return &loanWritebackBankAccounts{ + sdkConfiguration: sdkConfig, + } +} + +// Create bank account +// The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/accounting-api#/schemas/BankAccount) for a given company's connection. +// +// [Bank accounts](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackBankAccounts) Create(ctx context.Context, request operations.CreateBankAccountRequest, opts ...operations.Option) (*operations.CreateBankAccountResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingBankAccount", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateBankAccountResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateBankAccountResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateBankAccountResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateUpdateModel - 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/accounting-api#/schemas/BankAccount) for a given company and integration. +// +// [Bank accounts](https://docs.codat.io/accounting-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. +func (s *loanWritebackBankAccounts) GetCreateUpdateModel(ctx context.Context, request operations.GetCreateUpdateBankAccountsModelRequest, opts ...operations.Option) (*operations.GetCreateUpdateBankAccountsModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateUpdateBankAccountsModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebackbanktransactions.go b/lending/loanwritebackbanktransactions.go new file mode 100755 index 000000000..9658f1d4f --- /dev/null +++ b/lending/loanwritebackbanktransactions.go @@ -0,0 +1,276 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackBankTransactions struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackBankTransactions(sdkConfig sdkConfiguration) *loanWritebackBankTransactions { + return &loanWritebackBankTransactions{ + sdkConfiguration: sdkConfig, + } +} + +// Create bank account transactions +// The *Create bank account transactions* endpoint creates new [bank account transactions](https://docs.codat.io/accounting-api#/schemas/BankTransactions) for a given company's connection. +// +// [Bank account transactions](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackBankTransactions) Create(ctx context.Context, request operations.CreateBankTransactionsRequest, opts ...operations.Option) (*operations.CreateBankTransactionsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/bankAccounts/{accountId}/bankTransactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AccountingCreateBankTransactions", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateBankTransactionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateBankTransactionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateBankTransactionsResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateModel - 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/accounting-api#/schemas/BankTransactions) for a given company and integration. +// +// [Bank account transactions](https://docs.codat.io/accounting-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. +func (s *loanWritebackBankTransactions) GetCreateModel(ctx context.Context, request operations.GetCreateBankTransactionsModelRequest, opts ...operations.Option) (*operations.GetCreateBankTransactionsModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateBankTransactionsModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebackcreateoperations.go b/lending/loanwritebackcreateoperations.go new file mode 100755 index 000000000..902fe03ed --- /dev/null +++ b/lending/loanwritebackcreateoperations.go @@ -0,0 +1,255 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackCreateOperations struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackCreateOperations(sdkConfig sdkConfiguration) *loanWritebackCreateOperations { + return &loanWritebackCreateOperations{ + sdkConfiguration: sdkConfig, + } +} + +// Get create operation +// Retrieve create operation. +func (s *loanWritebackCreateOperations) Get(ctx context.Context, request operations.GetCreateOperationRequest, opts ...operations.Option) (*operations.GetCreateOperationResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push/{pushOperationKey}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateOperationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOperation + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOperation = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// List create operations +// List create operations. +func (s *loanWritebackCreateOperations) List(ctx context.Context, request operations.ListCreateOperationsRequest, opts ...operations.Option) (*operations.ListCreateOperationsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/push", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ListCreateOperationsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOperations + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOperations = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebackdirectcosts.go b/lending/loanwritebackdirectcosts.go new file mode 100755 index 000000000..7582e82a4 --- /dev/null +++ b/lending/loanwritebackdirectcosts.go @@ -0,0 +1,278 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackDirectCosts struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackDirectCosts(sdkConfig sdkConfiguration) *loanWritebackDirectCosts { + return &loanWritebackDirectCosts{ + sdkConfiguration: sdkConfig, + } +} + +// Create direct cost +// The *Create direct cost* endpoint creates a new [direct cost](https://docs.codat.io/accounting-api#/schemas/DirectCost) for a given company's connection. +// +// [Direct costs](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackDirectCosts) Create(ctx context.Context, request operations.CreateDirectCostRequest, opts ...operations.Option) (*operations.CreateDirectCostResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/directCosts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingDirectCost", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateDirectCostResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateDirectCostResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateDirectCostResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateModel - 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/accounting-api#/schemas/DirectCost) for a given company and integration. +// +// [Direct costs](https://docs.codat.io/accounting-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. +func (s *loanWritebackDirectCosts) GetCreateModel(ctx context.Context, request operations.GetCreateDirectCostsModelRequest, opts ...operations.Option) (*operations.GetCreateDirectCostsModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/directCosts", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateDirectCostsModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebacksuppliers.go b/lending/loanwritebacksuppliers.go new file mode 100755 index 000000000..d6ab72d1e --- /dev/null +++ b/lending/loanwritebacksuppliers.go @@ -0,0 +1,278 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackSuppliers struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackSuppliers(sdkConfig sdkConfiguration) *loanWritebackSuppliers { + return &loanWritebackSuppliers{ + sdkConfiguration: sdkConfig, + } +} + +// Create supplier +// The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/accounting-api#/schemas/Supplier) for a given company's connection. +// +// [Suppliers](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackSuppliers) Create(ctx context.Context, request operations.CreateSupplierRequest, opts ...operations.Option) (*operations.CreateSupplierResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/suppliers", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingSupplier", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateSupplierResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateSupplierResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateSupplierResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateUpdateModel - 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/accounting-api#/schemas/Supplier) for a given company and integration. +// +// [Suppliers](https://docs.codat.io/accounting-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. +func (s *loanWritebackSuppliers) GetCreateUpdateModel(ctx context.Context, request operations.GetCreateUpdateSuppliersModelRequest, opts ...operations.Option) (*operations.GetCreateUpdateSuppliersModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/suppliers", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateUpdateSuppliersModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/loanwritebacktransfers.go b/lending/loanwritebacktransfers.go new file mode 100755 index 000000000..24ae64e78 --- /dev/null +++ b/lending/loanwritebacktransfers.go @@ -0,0 +1,278 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package lending + +import ( + "bytes" + "context" + "fmt" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/operations" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/sdkerrors" + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "io" + "net/http" +) + +type loanWritebackTransfers struct { + sdkConfiguration sdkConfiguration +} + +func newLoanWritebackTransfers(sdkConfig sdkConfiguration) *loanWritebackTransfers { + return &loanWritebackTransfers{ + sdkConfiguration: sdkConfig, + } +} + +// Create transfer +// The *Create transfer* endpoint creates a new [transfer](https://docs.codat.io/accounting-api#/schemas/Transfer) for a given company's connection. +// +// [Transfers](https://docs.codat.io/accounting-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/accounting-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. +func (s *loanWritebackTransfers) Create(ctx context.Context, request operations.CreateTransferRequest, opts ...operations.Option) (*operations.CreateTransferResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/push/transfers", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, true, true, "AccountingTransfer", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreateTransferResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.AccountingCreateTransferResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.AccountingCreateTransferResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCreateModel - 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/accounting-api#/schemas/Transfer) for a given company and integration. +// +// [Transfers](https://docs.codat.io/accounting-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. +func (s *loanWritebackTransfers) GetCreateModel(ctx context.Context, request operations.GetCreateTransfersModelRequest, opts ...operations.Option) (*operations.GetCreateTransfersModelResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/companies/{companyId}/connections/{connectionId}/options/transfers", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + client := s.sdkConfiguration.SecurityClient + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig == nil { + retryConfig = &utils.RetryConfig{ + Strategy: "backoff", + Backoff: &utils.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } else { + retryConfig = globalRetryConfig + } + } + + httpRes, err := utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "408", + "429", + "5XX", + }, + }, func() (*http.Response, error) { + return client.Do(req) + }) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCreateTransfersModelResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.PushOption + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.PushOption = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ErrorMessage = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/lending/managedata.go b/lending/managedata.go index 6e161f729..c44426e82 100755 --- a/lending/managedata.go +++ b/lending/managedata.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,7 +112,7 @@ func (s *manageData) GetStatus(ctx context.Context, request operations.GetDataSt switch { case utils.MatchContentType(contentType, `application/json`): var out map[string]shared.DataStatus - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -127,12 +127,12 @@ func (s *manageData) GetStatus(ctx context.Context, request operations.GetDataSt case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/managedatapulloperations.go b/lending/managedatapulloperations.go index a73a67234..baa6d5eca 100755 --- a/lending/managedatapulloperations.go +++ b/lending/managedatapulloperations.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -106,12 +106,12 @@ func (s *manageDataPullOperations) Get(ctx context.Context, request operations.G case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.PullOperation - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.PullOperation + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.PullOperation = out + res.PullOperation = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -122,12 +122,12 @@ func (s *manageDataPullOperations) Get(ctx context.Context, request operations.G case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -222,12 +222,12 @@ func (s *manageDataPullOperations) List(ctx context.Context, request operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.PullOperations - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.PullOperations + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.PullOperations = out + res.PullOperations = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -240,12 +240,12 @@ func (s *manageDataPullOperations) List(ctx context.Context, request operations. case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/managedatarefresh.go b/lending/managedatarefresh.go index 3e3612e0e..100d453f5 100755 --- a/lending/managedatarefresh.go +++ b/lending/managedatarefresh.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -115,12 +115,12 @@ func (s *manageDataRefresh) AllDataTypes(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -217,12 +217,12 @@ func (s *manageDataRefresh) DataType(ctx context.Context, request operations.Ref case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.PullOperation - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.PullOperation + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.PullOperation = out + res.PullOperation = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -233,12 +233,12 @@ func (s *manageDataRefresh) DataType(ctx context.Context, request operations.Ref case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/pkg/models/operations/createaccount.go b/lending/pkg/models/operations/createaccount.go new file mode 100755 index 000000000..285e713b0 --- /dev/null +++ b/lending/pkg/models/operations/createaccount.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateAccountRequest struct { + AccountingAccount *shared.AccountingAccount `request:"mediaType=application/json"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateAccountRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateAccountRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateAccountRequest) GetAccountingAccount() *shared.AccountingAccount { + if o == nil { + return nil + } + return o.AccountingAccount +} + +func (o *CreateAccountRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateAccountRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateAccountRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateAccountRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateAccountRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateAccountResponse struct { + // Success + AccountingCreateAccountResponse *shared.AccountingCreateAccountResponse + ContentType string + // The request made is not valid. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateAccountResponse) GetAccountingCreateAccountResponse() *shared.AccountingCreateAccountResponse { + if o == nil { + return nil + } + return o.AccountingCreateAccountResponse +} + +func (o *CreateAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateAccountResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/createbankaccount.go b/lending/pkg/models/operations/createbankaccount.go new file mode 100755 index 000000000..ed01387f0 --- /dev/null +++ b/lending/pkg/models/operations/createbankaccount.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateBankAccountRequest struct { + AccountingBankAccount *shared.AccountingBankAccount `request:"mediaType=application/json"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateBankAccountRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateBankAccountRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateBankAccountRequest) GetAccountingBankAccount() *shared.AccountingBankAccount { + if o == nil { + return nil + } + return o.AccountingBankAccount +} + +func (o *CreateBankAccountRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateBankAccountRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateBankAccountRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateBankAccountRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateBankAccountRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateBankAccountResponse struct { + // Success + AccountingCreateBankAccountResponse *shared.AccountingCreateBankAccountResponse + ContentType string + // The request made is not valid. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateBankAccountResponse) GetAccountingCreateBankAccountResponse() *shared.AccountingCreateBankAccountResponse { + if o == nil { + return nil + } + return o.AccountingCreateBankAccountResponse +} + +func (o *CreateBankAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateBankAccountResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateBankAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateBankAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/createbanktransactions.go b/lending/pkg/models/operations/createbanktransactions.go new file mode 100755 index 000000000..e7a5baf58 --- /dev/null +++ b/lending/pkg/models/operations/createbanktransactions.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateBankTransactionsRequest struct { + AccountingCreateBankTransactions *shared.AccountingCreateBankTransactions `request:"mediaType=application/json"` + // Unique identifier for an account + AccountID string `pathParam:"style=simple,explode=false,name=accountId"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateBankTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateBankTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateBankTransactionsRequest) GetAccountingCreateBankTransactions() *shared.AccountingCreateBankTransactions { + if o == nil { + return nil + } + return o.AccountingCreateBankTransactions +} + +func (o *CreateBankTransactionsRequest) GetAccountID() string { + if o == nil { + return "" + } + return o.AccountID +} + +func (o *CreateBankTransactionsRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateBankTransactionsRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateBankTransactionsRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateBankTransactionsRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateBankTransactionsRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateBankTransactionsResponse struct { + // Success + AccountingCreateBankTransactionsResponse *shared.AccountingCreateBankTransactionsResponse + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateBankTransactionsResponse) GetAccountingCreateBankTransactionsResponse() *shared.AccountingCreateBankTransactionsResponse { + if o == nil { + return nil + } + return o.AccountingCreateBankTransactionsResponse +} + +func (o *CreateBankTransactionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateBankTransactionsResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateBankTransactionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateBankTransactionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/createdirectcost.go b/lending/pkg/models/operations/createdirectcost.go new file mode 100755 index 000000000..1c84e9648 --- /dev/null +++ b/lending/pkg/models/operations/createdirectcost.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateDirectCostRequest struct { + AccountingDirectCost *shared.AccountingDirectCost `request:"mediaType=application/json"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateDirectCostRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateDirectCostRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateDirectCostRequest) GetAccountingDirectCost() *shared.AccountingDirectCost { + if o == nil { + return nil + } + return o.AccountingDirectCost +} + +func (o *CreateDirectCostRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateDirectCostRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateDirectCostRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateDirectCostRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateDirectCostRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateDirectCostResponse struct { + // Success + AccountingCreateDirectCostResponse *shared.AccountingCreateDirectCostResponse + ContentType string + // The request made is not valid. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateDirectCostResponse) GetAccountingCreateDirectCostResponse() *shared.AccountingCreateDirectCostResponse { + if o == nil { + return nil + } + return o.AccountingCreateDirectCostResponse +} + +func (o *CreateDirectCostResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateDirectCostResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateDirectCostResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateDirectCostResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/createsupplier.go b/lending/pkg/models/operations/createsupplier.go new file mode 100755 index 000000000..e59a83dc2 --- /dev/null +++ b/lending/pkg/models/operations/createsupplier.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateSupplierRequest struct { + AccountingSupplier *shared.AccountingSupplier `request:"mediaType=application/json"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateSupplierRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateSupplierRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateSupplierRequest) GetAccountingSupplier() *shared.AccountingSupplier { + if o == nil { + return nil + } + return o.AccountingSupplier +} + +func (o *CreateSupplierRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateSupplierRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateSupplierRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateSupplierRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateSupplierRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateSupplierResponse struct { + // Success + AccountingCreateSupplierResponse *shared.AccountingCreateSupplierResponse + ContentType string + // The request made is not valid. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateSupplierResponse) GetAccountingCreateSupplierResponse() *shared.AccountingCreateSupplierResponse { + if o == nil { + return nil + } + return o.AccountingCreateSupplierResponse +} + +func (o *CreateSupplierResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateSupplierResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateSupplierResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateSupplierResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/createtransfer.go b/lending/pkg/models/operations/createtransfer.go new file mode 100755 index 000000000..391830c2a --- /dev/null +++ b/lending/pkg/models/operations/createtransfer.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type CreateTransferRequest struct { + AccountingTransfer *shared.AccountingTransfer `request:"mediaType=application/json"` + AllowSyncOnPushComplete *bool `default:"true" queryParam:"style=form,explode=true,name=allowSyncOnPushComplete"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` + // When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. + ForceUpdate *bool `default:"false" queryParam:"style=form,explode=true,name=forceUpdate"` + TimeoutInMinutes *int `queryParam:"style=form,explode=true,name=timeoutInMinutes"` +} + +func (c CreateTransferRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateTransferRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateTransferRequest) GetAccountingTransfer() *shared.AccountingTransfer { + if o == nil { + return nil + } + return o.AccountingTransfer +} + +func (o *CreateTransferRequest) GetAllowSyncOnPushComplete() *bool { + if o == nil { + return nil + } + return o.AllowSyncOnPushComplete +} + +func (o *CreateTransferRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *CreateTransferRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +func (o *CreateTransferRequest) GetForceUpdate() *bool { + if o == nil { + return nil + } + return o.ForceUpdate +} + +func (o *CreateTransferRequest) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +type CreateTransferResponse struct { + // Success + AccountingCreateTransferResponse *shared.AccountingCreateTransferResponse + ContentType string + // The request made is not valid. + ErrorMessage *shared.ErrorMessage + StatusCode int + RawResponse *http.Response +} + +func (o *CreateTransferResponse) GetAccountingCreateTransferResponse() *shared.AccountingCreateTransferResponse { + if o == nil { + return nil + } + return o.AccountingCreateTransferResponse +} + +func (o *CreateTransferResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateTransferResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *CreateTransferResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateTransferResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getaccountingagedcreditorsreport.go b/lending/pkg/models/operations/getaccountingagedcreditorsreport.go index 6d15832cc..ff801ea18 100755 --- a/lending/pkg/models/operations/getaccountingagedcreditorsreport.go +++ b/lending/pkg/models/operations/getaccountingagedcreditorsreport.go @@ -5,6 +5,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -18,6 +19,17 @@ type GetAccountingAgedCreditorsReportRequest struct { ReportDate *types.Date `queryParam:"style=form,explode=true,name=reportDate"` } +func (g GetAccountingAgedCreditorsReportRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAccountingAgedCreditorsReportRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + func (o *GetAccountingAgedCreditorsReportRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/getaccountingageddebtorsreport.go b/lending/pkg/models/operations/getaccountingageddebtorsreport.go index a353b765d..280a46e52 100755 --- a/lending/pkg/models/operations/getaccountingageddebtorsreport.go +++ b/lending/pkg/models/operations/getaccountingageddebtorsreport.go @@ -5,6 +5,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -18,6 +19,17 @@ type GetAccountingAgedDebtorsReportRequest struct { ReportDate *types.Date `queryParam:"style=form,explode=true,name=reportDate"` } +func (g GetAccountingAgedDebtorsReportRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAccountingAgedDebtorsReportRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + func (o *GetAccountingAgedDebtorsReportRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/getcategorizedbankstatement.go b/lending/pkg/models/operations/getcategorizedbankstatement.go index beff2e6e0..f7e40f879 100755 --- a/lending/pkg/models/operations/getcategorizedbankstatement.go +++ b/lending/pkg/models/operations/getcategorizedbankstatement.go @@ -4,19 +4,31 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) type GetCategorizedBankStatementRequest struct { CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (g GetCategorizedBankStatementRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetCategorizedBankStatementRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + func (o *GetCategorizedBankStatementRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/getcreatebanktransactionsmodel.go b/lending/pkg/models/operations/getcreatebanktransactionsmodel.go new file mode 100755 index 000000000..b5678acd6 --- /dev/null +++ b/lending/pkg/models/operations/getcreatebanktransactionsmodel.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateBankTransactionsModelRequest struct { + // Unique identifier for an account + AccountID string `pathParam:"style=simple,explode=false,name=accountId"` + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateBankTransactionsModelRequest) GetAccountID() string { + if o == nil { + return "" + } + return o.AccountID +} + +func (o *GetCreateBankTransactionsModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateBankTransactionsModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateBankTransactionsModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // Success + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateBankTransactionsModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateBankTransactionsModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateBankTransactionsModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateBankTransactionsModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateBankTransactionsModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreatechartofaccountsmodel.go b/lending/pkg/models/operations/getcreatechartofaccountsmodel.go new file mode 100755 index 000000000..88f52e69f --- /dev/null +++ b/lending/pkg/models/operations/getcreatechartofaccountsmodel.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateChartOfAccountsModelRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateChartOfAccountsModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateChartOfAccountsModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateChartOfAccountsModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateChartOfAccountsModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateChartOfAccountsModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateChartOfAccountsModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateChartOfAccountsModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateChartOfAccountsModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreatedirectcostsmodel.go b/lending/pkg/models/operations/getcreatedirectcostsmodel.go new file mode 100755 index 000000000..4157749ed --- /dev/null +++ b/lending/pkg/models/operations/getcreatedirectcostsmodel.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateDirectCostsModelRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateDirectCostsModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateDirectCostsModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateDirectCostsModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateDirectCostsModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateDirectCostsModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateDirectCostsModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateDirectCostsModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateDirectCostsModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreateoperation.go b/lending/pkg/models/operations/getcreateoperation.go new file mode 100755 index 000000000..f807c226f --- /dev/null +++ b/lending/pkg/models/operations/getcreateoperation.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateOperationRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Push operation key. + PushOperationKey string `pathParam:"style=simple,explode=false,name=pushOperationKey"` +} + +func (o *GetCreateOperationRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateOperationRequest) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +type GetCreateOperationResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOperation *shared.PushOperation + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateOperationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateOperationResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateOperationResponse) GetPushOperation() *shared.PushOperation { + if o == nil { + return nil + } + return o.PushOperation +} + +func (o *GetCreateOperationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateOperationResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreatetransfersmodel.go b/lending/pkg/models/operations/getcreatetransfersmodel.go new file mode 100755 index 000000000..c84f3bf1d --- /dev/null +++ b/lending/pkg/models/operations/getcreatetransfersmodel.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateTransfersModelRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateTransfersModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateTransfersModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateTransfersModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateTransfersModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateTransfersModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateTransfersModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateTransfersModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateTransfersModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go b/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go new file mode 100755 index 000000000..7c413ff1f --- /dev/null +++ b/lending/pkg/models/operations/getcreateupdatebankaccountsmodel.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateUpdateBankAccountsModelRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateUpdateBankAccountsModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateUpdateBankAccountsModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateUpdateBankAccountsModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateUpdateBankAccountsModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateUpdateBankAccountsModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateUpdateBankAccountsModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateUpdateBankAccountsModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateUpdateBankAccountsModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go b/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go new file mode 100755 index 000000000..a28ade614 --- /dev/null +++ b/lending/pkg/models/operations/getcreateupdatesuppliersmodel.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "net/http" +) + +type GetCreateUpdateSuppliersModelRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + ConnectionID string `pathParam:"style=simple,explode=false,name=connectionId"` +} + +func (o *GetCreateUpdateSuppliersModelRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *GetCreateUpdateSuppliersModelRequest) GetConnectionID() string { + if o == nil { + return "" + } + return o.ConnectionID +} + +type GetCreateUpdateSuppliersModelResponse struct { + ContentType string + // Your API request was not properly authorized. + ErrorMessage *shared.ErrorMessage + // OK + PushOption *shared.PushOption + StatusCode int + RawResponse *http.Response +} + +func (o *GetCreateUpdateSuppliersModelResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCreateUpdateSuppliersModelResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *GetCreateUpdateSuppliersModelResponse) GetPushOption() *shared.PushOption { + if o == nil { + return nil + } + return o.PushOption +} + +func (o *GetCreateUpdateSuppliersModelResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCreateUpdateSuppliersModelResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/listaccountingaccounts.go b/lending/pkg/models/operations/listaccountingaccounts.go index ae41e65ea..cc3e3ded3 100755 --- a/lending/pkg/models/operations/listaccountingaccounts.go +++ b/lending/pkg/models/operations/listaccountingaccounts.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingAccountsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingAccountsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingaccounttransactions.go b/lending/pkg/models/operations/listaccountingaccounttransactions.go index a7aa45c2f..167b8b513 100755 --- a/lending/pkg/models/operations/listaccountingaccounttransactions.go +++ b/lending/pkg/models/operations/listaccountingaccounttransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListAccountingAccountTransactionsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingAccountTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingAccountTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingAccountTransactionsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingbankaccounts.go b/lending/pkg/models/operations/listaccountingbankaccounts.go index db6477ea5..f3afc2b9e 100755 --- a/lending/pkg/models/operations/listaccountingbankaccounts.go +++ b/lending/pkg/models/operations/listaccountingbankaccounts.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListAccountingBankAccountsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingBankAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingBankAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingBankAccountsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingbankaccounttransactions.go b/lending/pkg/models/operations/listaccountingbankaccounttransactions.go index a9f2d4e6e..a248ed878 100755 --- a/lending/pkg/models/operations/listaccountingbankaccounttransactions.go +++ b/lending/pkg/models/operations/listaccountingbankaccounttransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -15,13 +16,24 @@ type ListAccountingBankAccountTransactionsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingBankAccountTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingBankAccountTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingBankAccountTransactionsRequest) GetAccountID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingbillcreditnotes.go b/lending/pkg/models/operations/listaccountingbillcreditnotes.go index 71f0b0890..ef6b39f2a 100755 --- a/lending/pkg/models/operations/listaccountingbillcreditnotes.go +++ b/lending/pkg/models/operations/listaccountingbillcreditnotes.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingBillCreditNotesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingBillCreditNotesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingBillCreditNotesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingBillCreditNotesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingbillpayments.go b/lending/pkg/models/operations/listaccountingbillpayments.go index 659c4abcd..b785d693e 100755 --- a/lending/pkg/models/operations/listaccountingbillpayments.go +++ b/lending/pkg/models/operations/listaccountingbillpayments.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingBillPaymentsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingBillPaymentsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingBillPaymentsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingBillPaymentsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingbills.go b/lending/pkg/models/operations/listaccountingbills.go index 588cf4cd9..eab3227c1 100755 --- a/lending/pkg/models/operations/listaccountingbills.go +++ b/lending/pkg/models/operations/listaccountingbills.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingBillsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingBillsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingBillsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingBillsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingcreditnotes.go b/lending/pkg/models/operations/listaccountingcreditnotes.go index f5b371a6f..ae37ded72 100755 --- a/lending/pkg/models/operations/listaccountingcreditnotes.go +++ b/lending/pkg/models/operations/listaccountingcreditnotes.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingCreditNotesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingCreditNotesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingCreditNotesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingCreditNotesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingcustomers.go b/lending/pkg/models/operations/listaccountingcustomers.go index 6f8d92586..f5a4d046f 100755 --- a/lending/pkg/models/operations/listaccountingcustomers.go +++ b/lending/pkg/models/operations/listaccountingcustomers.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingCustomersRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingCustomersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingCustomersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingCustomersRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingdirectcosts.go b/lending/pkg/models/operations/listaccountingdirectcosts.go index d524d5bf5..c4404f298 100755 --- a/lending/pkg/models/operations/listaccountingdirectcosts.go +++ b/lending/pkg/models/operations/listaccountingdirectcosts.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListAccountingDirectCostsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingDirectCostsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingDirectCostsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingDirectCostsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingdirectincomes.go b/lending/pkg/models/operations/listaccountingdirectincomes.go index 6f27d8c84..2ac1fde65 100755 --- a/lending/pkg/models/operations/listaccountingdirectincomes.go +++ b/lending/pkg/models/operations/listaccountingdirectincomes.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListAccountingDirectIncomesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingDirectIncomesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingDirectIncomesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingDirectIncomesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountinginvoices.go b/lending/pkg/models/operations/listaccountinginvoices.go index 6680736d3..dd14c8623 100755 --- a/lending/pkg/models/operations/listaccountinginvoices.go +++ b/lending/pkg/models/operations/listaccountinginvoices.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingInvoicesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingInvoicesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingInvoicesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingInvoicesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingjournalentries.go b/lending/pkg/models/operations/listaccountingjournalentries.go index 96c477161..b6e839829 100755 --- a/lending/pkg/models/operations/listaccountingjournalentries.go +++ b/lending/pkg/models/operations/listaccountingjournalentries.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingJournalEntriesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingJournalEntriesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingJournalEntriesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingJournalEntriesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingjournals.go b/lending/pkg/models/operations/listaccountingjournals.go index f5bbfffc4..fa993e270 100755 --- a/lending/pkg/models/operations/listaccountingjournals.go +++ b/lending/pkg/models/operations/listaccountingjournals.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingJournalsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingJournalsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingJournalsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingJournalsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingpayments.go b/lending/pkg/models/operations/listaccountingpayments.go index 3599cb06e..e7551d3da 100755 --- a/lending/pkg/models/operations/listaccountingpayments.go +++ b/lending/pkg/models/operations/listaccountingpayments.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingPaymentsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingPaymentsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingPaymentsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingPaymentsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingsuppliers.go b/lending/pkg/models/operations/listaccountingsuppliers.go index 01f4ecf92..602def76f 100755 --- a/lending/pkg/models/operations/listaccountingsuppliers.go +++ b/lending/pkg/models/operations/listaccountingsuppliers.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListAccountingSuppliersRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingSuppliersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingSuppliersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingSuppliersRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listaccountingtransfers.go b/lending/pkg/models/operations/listaccountingtransfers.go index dec7dae60..b054c6a19 100755 --- a/lending/pkg/models/operations/listaccountingtransfers.go +++ b/lending/pkg/models/operations/listaccountingtransfers.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListAccountingTransfersRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListAccountingTransfersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListAccountingTransfersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListAccountingTransfersRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listbankingaccountbalances.go b/lending/pkg/models/operations/listbankingaccountbalances.go index 202db5e49..2aced95b9 100755 --- a/lending/pkg/models/operations/listbankingaccountbalances.go +++ b/lending/pkg/models/operations/listbankingaccountbalances.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListBankingAccountBalancesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListBankingAccountBalancesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListBankingAccountBalancesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListBankingAccountBalancesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listbankingaccounts.go b/lending/pkg/models/operations/listbankingaccounts.go index 8d2100255..73d05e731 100755 --- a/lending/pkg/models/operations/listbankingaccounts.go +++ b/lending/pkg/models/operations/listbankingaccounts.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListBankingAccountsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListBankingAccountsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListBankingAccountsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListBankingAccountsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listbankingtransactioncategories.go b/lending/pkg/models/operations/listbankingtransactioncategories.go index 4fd113e5a..ce08f1668 100755 --- a/lending/pkg/models/operations/listbankingtransactioncategories.go +++ b/lending/pkg/models/operations/listbankingtransactioncategories.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListBankingTransactionCategoriesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListBankingTransactionCategoriesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListBankingTransactionCategoriesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListBankingTransactionCategoriesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listbankingtransactions.go b/lending/pkg/models/operations/listbankingtransactions.go index 6cb57b00f..59972cdd1 100755 --- a/lending/pkg/models/operations/listbankingtransactions.go +++ b/lending/pkg/models/operations/listbankingtransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListBankingTransactionsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListBankingTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListBankingTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListBankingTransactionsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommercecustomers.go b/lending/pkg/models/operations/listcommercecustomers.go index 102ffce7d..c36deb507 100755 --- a/lending/pkg/models/operations/listcommercecustomers.go +++ b/lending/pkg/models/operations/listcommercecustomers.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceCustomersRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceCustomersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceCustomersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceCustomersRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommercedisputes.go b/lending/pkg/models/operations/listcommercedisputes.go index cfc5d327e..8bd04f7e7 100755 --- a/lending/pkg/models/operations/listcommercedisputes.go +++ b/lending/pkg/models/operations/listcommercedisputes.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceDisputesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceDisputesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceDisputesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceDisputesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommerceorders.go b/lending/pkg/models/operations/listcommerceorders.go index e5e00edf5..5085a9a23 100755 --- a/lending/pkg/models/operations/listcommerceorders.go +++ b/lending/pkg/models/operations/listcommerceorders.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceOrdersRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceOrdersRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceOrdersRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceOrdersRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommercepaymentmethods.go b/lending/pkg/models/operations/listcommercepaymentmethods.go index 11634005d..b80c50f1e 100755 --- a/lending/pkg/models/operations/listcommercepaymentmethods.go +++ b/lending/pkg/models/operations/listcommercepaymentmethods.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommercePaymentMethodsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommercePaymentMethodsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommercePaymentMethodsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommercePaymentMethodsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommercepayments.go b/lending/pkg/models/operations/listcommercepayments.go index e71218ef6..c61b848c5 100755 --- a/lending/pkg/models/operations/listcommercepayments.go +++ b/lending/pkg/models/operations/listcommercepayments.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommercePaymentsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommercePaymentsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommercePaymentsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommercePaymentsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommerceproductcategories.go b/lending/pkg/models/operations/listcommerceproductcategories.go index 4da4da03b..22f523986 100755 --- a/lending/pkg/models/operations/listcommerceproductcategories.go +++ b/lending/pkg/models/operations/listcommerceproductcategories.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceProductCategoriesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceProductCategoriesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceProductCategoriesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceProductCategoriesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommerceproducts.go b/lending/pkg/models/operations/listcommerceproducts.go index 4f76af515..50f32b1d2 100755 --- a/lending/pkg/models/operations/listcommerceproducts.go +++ b/lending/pkg/models/operations/listcommerceproducts.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceProductsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceProductsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceProductsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceProductsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcommercetransactions.go b/lending/pkg/models/operations/listcommercetransactions.go index 9ff717ce9..96a216669 100755 --- a/lending/pkg/models/operations/listcommercetransactions.go +++ b/lending/pkg/models/operations/listcommercetransactions.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -13,13 +14,24 @@ type ListCommerceTransactionsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCommerceTransactionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCommerceTransactionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCommerceTransactionsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcompanies.go b/lending/pkg/models/operations/listcompanies.go index 1ec9cec23..6b25813a1 100755 --- a/lending/pkg/models/operations/listcompanies.go +++ b/lending/pkg/models/operations/listcompanies.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -11,13 +12,24 @@ type ListCompaniesRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListCompaniesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCompaniesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListCompaniesRequest) GetOrderBy() *string { if o == nil { return nil diff --git a/lending/pkg/models/operations/listconnections.go b/lending/pkg/models/operations/listconnections.go index da37dee23..16acca9fc 100755 --- a/lending/pkg/models/operations/listconnections.go +++ b/lending/pkg/models/operations/listconnections.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListConnectionsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListConnectionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListConnectionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListConnectionsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listcreateoperations.go b/lending/pkg/models/operations/listcreateoperations.go new file mode 100755 index 000000000..2bfbe8e63 --- /dev/null +++ b/lending/pkg/models/operations/listcreateoperations.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "net/http" +) + +type ListCreateOperationsRequest struct { + CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` + // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). + OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` + // Page number. [Read more](https://docs.codat.io/using-the-api/paging). + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` + // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` + // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). + Query *string `queryParam:"style=form,explode=true,name=query"` +} + +func (l ListCreateOperationsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListCreateOperationsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListCreateOperationsRequest) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *ListCreateOperationsRequest) GetOrderBy() *string { + if o == nil { + return nil + } + return o.OrderBy +} + +func (o *ListCreateOperationsRequest) GetPage() *int { + if o == nil { + return nil + } + return o.Page +} + +func (o *ListCreateOperationsRequest) GetPageSize() *int { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *ListCreateOperationsRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +type ListCreateOperationsResponse struct { + ContentType string + // Your `query` parameter was not correctly formed + ErrorMessage *shared.ErrorMessage + // OK + PushOperations *shared.PushOperations + StatusCode int + RawResponse *http.Response +} + +func (o *ListCreateOperationsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListCreateOperationsResponse) GetErrorMessage() *shared.ErrorMessage { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *ListCreateOperationsResponse) GetPushOperations() *shared.PushOperations { + if o == nil { + return nil + } + return o.PushOperations +} + +func (o *ListCreateOperationsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListCreateOperationsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/lending/pkg/models/operations/listdataintegritydetails.go b/lending/pkg/models/operations/listdataintegritydetails.go index 82087176a..b54266cb5 100755 --- a/lending/pkg/models/operations/listdataintegritydetails.go +++ b/lending/pkg/models/operations/listdataintegritydetails.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -14,13 +15,24 @@ type ListDataIntegrityDetailsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListDataIntegrityDetailsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListDataIntegrityDetailsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListDataIntegrityDetailsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listpulloperations.go b/lending/pkg/models/operations/listpulloperations.go index 3f48721b6..347c60f1d 100755 --- a/lending/pkg/models/operations/listpulloperations.go +++ b/lending/pkg/models/operations/listpulloperations.go @@ -4,6 +4,7 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) @@ -12,13 +13,24 @@ type ListPullOperationsRequest struct { // Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). OrderBy *string `queryParam:"style=form,explode=true,name=orderBy"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListPullOperationsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPullOperationsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListPullOperationsRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/operations/listreconciledinvoices.go b/lending/pkg/models/operations/listreconciledinvoices.go index aa939a6fa..2e60483fa 100755 --- a/lending/pkg/models/operations/listreconciledinvoices.go +++ b/lending/pkg/models/operations/listreconciledinvoices.go @@ -4,19 +4,31 @@ package operations import ( "github.com/codatio/client-sdk-go/lending/v4/pkg/models/shared" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "net/http" ) type ListReconciledInvoicesRequest struct { CompanyID string `pathParam:"style=simple,explode=false,name=companyId"` // Page number. [Read more](https://docs.codat.io/using-the-api/paging). - Page *int `queryParam:"style=form,explode=true,name=page"` + Page *int `default:"1" queryParam:"style=form,explode=true,name=page"` // Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - PageSize *int `queryParam:"style=form,explode=true,name=pageSize"` + PageSize *int `default:"100" queryParam:"style=form,explode=true,name=pageSize"` // Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). Query *string `queryParam:"style=form,explode=true,name=query"` } +func (l ListReconciledInvoicesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListReconciledInvoicesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + func (o *ListReconciledInvoicesRequest) GetCompanyID() string { if o == nil { return "" diff --git a/lending/pkg/models/shared/accountbalance.go b/lending/pkg/models/shared/accountbalance.go index a3816a859..bbeb94074 100755 --- a/lending/pkg/models/shared/accountbalance.go +++ b/lending/pkg/models/shared/accountbalance.go @@ -3,21 +3,33 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type AccountBalance struct { // The account's current balance - Available *types.Decimal `json:"available,omitempty"` + Available *decimal.Big `decimal:"number" json:"available,omitempty"` // The currency of the account Currency *string `json:"currency,omitempty"` // Funds that are not yet available in the balance - Pending *types.Decimal `json:"pending,omitempty"` + Pending *decimal.Big `decimal:"number" json:"pending,omitempty"` // Funds reserved as holdings Reserved interface{} `json:"reserved,omitempty"` } -func (o *AccountBalance) GetAvailable() *types.Decimal { +func (a AccountBalance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountBalance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountBalance) GetAvailable() *decimal.Big { if o == nil { return nil } @@ -31,7 +43,7 @@ func (o *AccountBalance) GetCurrency() *string { return o.Currency } -func (o *AccountBalance) GetPending() *types.Decimal { +func (o *AccountBalance) GetPending() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountbalanceamounts.go b/lending/pkg/models/shared/accountbalanceamounts.go index edafc8cb8..465c6155b 100755 --- a/lending/pkg/models/shared/accountbalanceamounts.go +++ b/lending/pkg/models/shared/accountbalanceamounts.go @@ -3,34 +3,46 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountBalanceAmounts - Depending on the data provided by the underlying bank, not all balances are always available. type AccountBalanceAmounts struct { // The balance available in the account, including any pending transactions. This doesn't include additional funds available from any overdrafts. - Available *types.Decimal `json:"available,omitempty"` + Available *decimal.Big `decimal:"number" json:"available,omitempty"` // The balance of the account only including cleared transactions. - Current *types.Decimal `json:"current,omitempty"` + Current *decimal.Big `decimal:"number" json:"current,omitempty"` // The minimum allowed balance for the account. For example, a $100.00 overdraft would show as a limit of `-100.00`. - Limit *types.Decimal `json:"limit,omitempty"` + Limit *decimal.Big `decimal:"number" json:"limit,omitempty"` } -func (o *AccountBalanceAmounts) GetAvailable() *types.Decimal { +func (a AccountBalanceAmounts) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountBalanceAmounts) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountBalanceAmounts) GetAvailable() *decimal.Big { if o == nil { return nil } return o.Available } -func (o *AccountBalanceAmounts) GetCurrent() *types.Decimal { +func (o *AccountBalanceAmounts) GetCurrent() *decimal.Big { if o == nil { return nil } return o.Current } -func (o *AccountBalanceAmounts) GetLimit() *types.Decimal { +func (o *AccountBalanceAmounts) GetLimit() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountcategorylevel.go b/lending/pkg/models/shared/accountcategorylevel.go index 44be7853c..57c2954cd 100755 --- a/lending/pkg/models/shared/accountcategorylevel.go +++ b/lending/pkg/models/shared/accountcategorylevel.go @@ -3,18 +3,30 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountCategoryLevel - An object containing an ordered list of account category levels. type AccountCategoryLevel struct { // Confidence level of the category. This will only be populated where `status` is `Suggested`. - Confidence *types.Decimal `json:"confidence,omitempty"` + Confidence *decimal.Big `decimal:"number" json:"confidence,omitempty"` // Account category name. LevelName *string `json:"levelName,omitempty"` } -func (o *AccountCategoryLevel) GetConfidence() *types.Decimal { +func (a AccountCategoryLevel) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountCategoryLevel) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountCategoryLevel) GetConfidence() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingaccount.go b/lending/pkg/models/shared/accountingaccount.go index 57fb7a473..dcbd066cc 100755 --- a/lending/pkg/models/shared/accountingaccount.go +++ b/lending/pkg/models/shared/accountingaccount.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // 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. @@ -105,7 +106,7 @@ type AccountingAccount struct { // There are only a very small number of edge cases where this currency code is returned by the Codat system. Currency *string `json:"currency,omitempty"` // Current balance in the account. - CurrentBalance *types.Decimal `json:"currentBalance,omitempty"` + CurrentBalance *decimal.Big `decimal:"number" json:"currentBalance,omitempty"` // Description for the account. Description *string `json:"description,omitempty"` // Full category of the account. @@ -136,6 +137,17 @@ type AccountingAccount struct { ValidDatatypeLinks []AccountingAccountValidDataTypeLinks `json:"validDatatypeLinks,omitempty"` } +func (a AccountingAccount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingAccount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + func (o *AccountingAccount) GetCurrency() *string { if o == nil { return nil @@ -143,7 +155,7 @@ func (o *AccountingAccount) GetCurrency() *string { return o.Currency } -func (o *AccountingAccount) GetCurrentBalance() *types.Decimal { +func (o *AccountingAccount) GetCurrentBalance() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingaccounttransaction.go b/lending/pkg/models/shared/accountingaccounttransaction.go index 62fccb67b..e7d52e8e8 100755 --- a/lending/pkg/models/shared/accountingaccounttransaction.go +++ b/lending/pkg/models/shared/accountingaccounttransaction.go @@ -5,7 +5,8 @@ package shared import ( "encoding/json" "fmt" - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountingAccountTransactionStatus - The status of the account transaction. @@ -95,7 +96,7 @@ type AccountingAccountTransaction struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -128,11 +129,22 @@ type AccountingAccountTransaction struct { // The status of the account transaction. Status *AccountingAccountTransactionStatus `json:"status,omitempty"` // Total amount of the account transactions, inclusive of tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Identifier of the transaction (unique to the company). TransactionID *string `json:"transactionId,omitempty"` } +func (a AccountingAccountTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingAccountTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + func (o *AccountingAccountTransaction) GetBankAccountRef() *BankAccountRef { if o == nil { return nil @@ -147,7 +159,7 @@ func (o *AccountingAccountTransaction) GetCurrency() *string { return o.Currency } -func (o *AccountingAccountTransaction) GetCurrencyRate() *types.Decimal { +func (o *AccountingAccountTransaction) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -210,7 +222,7 @@ func (o *AccountingAccountTransaction) GetStatus() *AccountingAccountTransaction return o.Status } -func (o *AccountingAccountTransaction) GetTotalAmount() *types.Decimal { +func (o *AccountingAccountTransaction) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingbankaccount.go b/lending/pkg/models/shared/accountingbankaccount.go index a75ce8273..afb5575d9 100755 --- a/lending/pkg/models/shared/accountingbankaccount.go +++ b/lending/pkg/models/shared/accountingbankaccount.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountingBankAccount - > **Accessing Bank Accounts through Banking API** @@ -38,9 +39,9 @@ type AccountingBankAccount struct { // For Debit accounts, positive balances are assets, and positive transactions **increase** assets. AccountType *AccountingBankAccountType `json:"accountType,omitempty"` // 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. - AvailableBalance *types.Decimal `json:"availableBalance,omitempty"` + AvailableBalance *decimal.Big `decimal:"number" json:"availableBalance,omitempty"` // Balance of the bank account. - Balance *types.Decimal `json:"balance,omitempty"` + Balance *decimal.Big `decimal:"number" json:"balance,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -62,7 +63,7 @@ type AccountingBankAccount struct { // 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`. - OverdraftLimit *types.Decimal `json:"overdraftLimit,omitempty"` + OverdraftLimit *decimal.Big `decimal:"number" json:"overdraftLimit,omitempty"` // Sort code for the bank account. // // Xero integrations @@ -71,6 +72,17 @@ type AccountingBankAccount struct { SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` } +func (a AccountingBankAccount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + func (o *AccountingBankAccount) GetAccountName() *string { if o == nil { return nil @@ -92,14 +104,14 @@ func (o *AccountingBankAccount) GetAccountType() *AccountingBankAccountType { return o.AccountType } -func (o *AccountingBankAccount) GetAvailableBalance() *types.Decimal { +func (o *AccountingBankAccount) GetAvailableBalance() *decimal.Big { if o == nil { return nil } return o.AvailableBalance } -func (o *AccountingBankAccount) GetBalance() *types.Decimal { +func (o *AccountingBankAccount) GetBalance() *decimal.Big { if o == nil { return nil } @@ -155,7 +167,7 @@ func (o *AccountingBankAccount) GetNominalCode() *string { return o.NominalCode } -func (o *AccountingBankAccount) GetOverdraftLimit() *types.Decimal { +func (o *AccountingBankAccount) GetOverdraftLimit() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingbanktransaction.go b/lending/pkg/models/shared/accountingbanktransaction.go index fcfbaa056..2b43cd4e9 100755 --- a/lending/pkg/models/shared/accountingbanktransaction.go +++ b/lending/pkg/models/shared/accountingbanktransaction.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountingBankTransaction - > **Accessing Bank Accounts through Banking API** @@ -23,9 +24,9 @@ import ( // * Current account balance. // * Transaction type, for example, credit, debit, or transfer. type AccountingBankTransaction struct { - AccountID *string `json:"accountId,omitempty"` - Amount *types.Decimal `json:"amount,omitempty"` - Balance *types.Decimal `json:"balance,omitempty"` + AccountID *string `json:"accountId,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` + Balance *decimal.Big `decimal:"number" json:"balance,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -55,6 +56,17 @@ type AccountingBankTransaction struct { TransactionType *BankTransactionType `json:"transactionType,omitempty"` } +func (a AccountingBankTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + func (o *AccountingBankTransaction) GetAccountID() *string { if o == nil { return nil @@ -62,14 +74,14 @@ func (o *AccountingBankTransaction) GetAccountID() *string { return o.AccountID } -func (o *AccountingBankTransaction) GetAmount() *types.Decimal { +func (o *AccountingBankTransaction) GetAmount() *decimal.Big { if o == nil { return nil } return o.Amount } -func (o *AccountingBankTransaction) GetBalance() *types.Decimal { +func (o *AccountingBankTransaction) GetBalance() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingbill.go b/lending/pkg/models/shared/accountingbill.go index 347ec14e3..6ed3e2e26 100755 --- a/lending/pkg/models/shared/accountingbill.go +++ b/lending/pkg/models/shared/accountingbill.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -29,13 +29,24 @@ func (o *AccountingBillPurchaseOrderReference) GetPurchaseOrderNumber() *string } type AccountingBillWithholdingTax struct { - Amount types.Decimal `json:"amount"` - Name string `json:"name"` + Amount *decimal.Big `decimal:"number" json:"amount"` + Name string `json:"name"` } -func (o *AccountingBillWithholdingTax) GetAmount() types.Decimal { +func (a AccountingBillWithholdingTax) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBillWithholdingTax) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountingBillWithholdingTax) GetAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Amount } @@ -68,7 +79,7 @@ func (o *AccountingBillWithholdingTax) GetName() string { // You can find these types of transactions in our [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) data model. type AccountingBill struct { // Amount outstanding on the bill. - AmountDue *types.Decimal `json:"amountDue,omitempty"` + AmountDue *decimal.Big `decimal:"number" json:"amountDue,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -102,8 +113,8 @@ type AccountingBill struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` - DueDate *string `json:"dueDate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` + DueDate *string `json:"dueDate,omitempty"` // Identifier for the bill, unique for the company in the accounting platform. ID *string `json:"id,omitempty"` IssueDate string `json:"issueDate"` @@ -122,7 +133,7 @@ type AccountingBill struct { // Current state of the bill. Status BillStatus `json:"status"` // Total amount of the bill, excluding any taxes. - SubTotal types.Decimal `json:"subTotal"` + SubTotal *decimal.Big `decimal:"number" json:"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. @@ -130,13 +141,24 @@ type AccountingBill struct { // Reference to the supplier the record relates to. SupplierRef *SupplierRef `json:"supplierRef,omitempty"` // Amount of tax on the bill. - TaxAmount types.Decimal `json:"taxAmount"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` // Amount of the bill, including tax. - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` WithholdingTax []AccountingBillWithholdingTax `json:"withholdingTax,omitempty"` } -func (o *AccountingBill) GetAmountDue() *types.Decimal { +func (a AccountingBill) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBill) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountingBill) GetAmountDue() *decimal.Big { if o == nil { return nil } @@ -150,7 +172,7 @@ func (o *AccountingBill) GetCurrency() *string { return o.Currency } -func (o *AccountingBill) GetCurrencyRate() *types.Decimal { +func (o *AccountingBill) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -241,9 +263,9 @@ func (o *AccountingBill) GetStatus() BillStatus { return o.Status } -func (o *AccountingBill) GetSubTotal() types.Decimal { +func (o *AccountingBill) GetSubTotal() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.SubTotal } @@ -262,16 +284,16 @@ func (o *AccountingBill) GetSupplierRef() *SupplierRef { return o.SupplierRef } -func (o *AccountingBill) GetTaxAmount() types.Decimal { +func (o *AccountingBill) GetTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TaxAmount } -func (o *AccountingBill) GetTotalAmount() types.Decimal { +func (o *AccountingBill) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } diff --git a/lending/pkg/models/shared/accountingbillcreditnote.go b/lending/pkg/models/shared/accountingbillcreditnote.go index 2851167e3..214ecf2da 100755 --- a/lending/pkg/models/shared/accountingbillcreditnote.go +++ b/lending/pkg/models/shared/accountingbillcreditnote.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -79,9 +79,9 @@ type AccountingBillCreditNote struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Percentage rate of any discount applied to the bill credit note. - DiscountPercentage types.Decimal `json:"discountPercentage"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage"` // Identifier for the bill credit note that is unique to a company in the accounting platform. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -113,12 +113,12 @@ type AccountingBillCreditNote struct { // An array of payment allocations. PaymentAllocations []AccountingPaymentAllocation `json:"paymentAllocations,omitempty"` // Amount of the bill credit note that is still outstanding. - RemainingCredit *types.Decimal `json:"remainingCredit,omitempty"` - SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` + RemainingCredit *decimal.Big `decimal:"number" json:"remainingCredit,omitempty"` + SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // Current state of the bill credit note Status BillCreditNoteStatus `json:"status"` // Total amount of the bill credit note, including discounts but excluding tax. - SubTotal types.Decimal `json:"subTotal"` + SubTotal *decimal.Big `decimal:"number" json:"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. @@ -126,12 +126,23 @@ type AccountingBillCreditNote struct { // Reference to the supplier the record relates to. SupplierRef *SupplierRef `json:"supplierRef,omitempty"` // Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` // Total value of any discounts applied. - TotalDiscount types.Decimal `json:"totalDiscount"` + TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount"` // Amount of tax included in the bill credit note. - TotalTaxAmount types.Decimal `json:"totalTaxAmount"` - WithholdingTax []Items `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` +} + +func (a AccountingBillCreditNote) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBillCreditNote) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingBillCreditNote) GetAllocatedOnDate() *string { @@ -155,16 +166,16 @@ func (o *AccountingBillCreditNote) GetCurrency() *string { return o.Currency } -func (o *AccountingBillCreditNote) GetCurrencyRate() *types.Decimal { +func (o *AccountingBillCreditNote) GetCurrencyRate() *decimal.Big { if o == nil { return nil } return o.CurrencyRate } -func (o *AccountingBillCreditNote) GetDiscountPercentage() types.Decimal { +func (o *AccountingBillCreditNote) GetDiscountPercentage() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.DiscountPercentage } @@ -218,7 +229,7 @@ func (o *AccountingBillCreditNote) GetPaymentAllocations() []AccountingPaymentAl return o.PaymentAllocations } -func (o *AccountingBillCreditNote) GetRemainingCredit() *types.Decimal { +func (o *AccountingBillCreditNote) GetRemainingCredit() *decimal.Big { if o == nil { return nil } @@ -239,9 +250,9 @@ func (o *AccountingBillCreditNote) GetStatus() BillCreditNoteStatus { return o.Status } -func (o *AccountingBillCreditNote) GetSubTotal() types.Decimal { +func (o *AccountingBillCreditNote) GetSubTotal() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.SubTotal } @@ -260,23 +271,23 @@ func (o *AccountingBillCreditNote) GetSupplierRef() *SupplierRef { return o.SupplierRef } -func (o *AccountingBillCreditNote) GetTotalAmount() types.Decimal { +func (o *AccountingBillCreditNote) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } -func (o *AccountingBillCreditNote) GetTotalDiscount() types.Decimal { +func (o *AccountingBillCreditNote) GetTotalDiscount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalDiscount } -func (o *AccountingBillCreditNote) GetTotalTaxAmount() types.Decimal { +func (o *AccountingBillCreditNote) GetTotalTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalTaxAmount } diff --git a/lending/pkg/models/shared/accountingbillpayment.go b/lending/pkg/models/shared/accountingbillpayment.go index c7a07e2c0..53a1dd6bb 100755 --- a/lending/pkg/models/shared/accountingbillpayment.go +++ b/lending/pkg/models/shared/accountingbillpayment.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountingBillPayment - > **Bill payments or payments?** @@ -185,8 +186,8 @@ type AccountingBillPayment struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` - Date string `json:"date"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` + Date string `json:"date"` // Identifier for the bill payment, unique for the company in the accounting platform. ID *string `json:"id,omitempty"` // An array of bill payment lines. @@ -205,7 +206,18 @@ type AccountingBillPayment struct { SupplementalData *SupplementalData `json:"supplementalData,omitempty"` SupplierRef *SupplierRef `json:"supplierRef,omitempty"` // 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. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` +} + +func (a AccountingBillPayment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBillPayment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingBillPayment) GetAccountRef() *AccountRef { @@ -222,7 +234,7 @@ func (o *AccountingBillPayment) GetCurrency() *string { return o.Currency } -func (o *AccountingBillPayment) GetCurrencyRate() *types.Decimal { +func (o *AccountingBillPayment) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -306,7 +318,7 @@ func (o *AccountingBillPayment) GetSupplierRef() *SupplierRef { return o.SupplierRef } -func (o *AccountingBillPayment) GetTotalAmount() *types.Decimal { +func (o *AccountingBillPayment) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingcreateaccountresponse.go b/lending/pkg/models/shared/accountingcreateaccountresponse.go new file mode 100755 index 000000000..270d094eb --- /dev/null +++ b/lending/pkg/models/shared/accountingcreateaccountresponse.go @@ -0,0 +1,192 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateAccountResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // > **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/accounting-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. + Data *AccountingAccount `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateAccountResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateAccountResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateAccountResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateAccountResponse) GetData() *AccountingAccount { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateAccountResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateAccountResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateAccountResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateAccountResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateAccountResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateAccountResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateAccountResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateAccountResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateAccountResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreatebankaccountresponse.go b/lending/pkg/models/shared/accountingcreatebankaccountresponse.go new file mode 100755 index 000000000..41489afec --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatebankaccountresponse.go @@ -0,0 +1,180 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateBankAccountResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // > **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/banking-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. + Data *AccountingBankAccount `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateBankAccountResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateBankAccountResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateBankAccountResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateBankAccountResponse) GetData() *AccountingBankAccount { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateBankAccountResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateBankAccountResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateBankAccountResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateBankAccountResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateBankAccountResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateBankAccountResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateBankAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateBankAccountResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateBankAccountResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateBankAccountResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreatebanktransactions.go b/lending/pkg/models/shared/accountingcreatebanktransactions.go new file mode 100755 index 000000000..6ba026c61 --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatebanktransactions.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateBankTransactions struct { + AccountID *string `json:"accountId,omitempty"` + Transactions []CreateBankAccountTransaction `json:"transactions,omitempty"` +} + +func (o *AccountingCreateBankTransactions) GetAccountID() *string { + if o == nil { + return nil + } + return o.AccountID +} + +func (o *AccountingCreateBankTransactions) GetTransactions() []CreateBankAccountTransaction { + if o == nil { + return nil + } + return o.Transactions +} diff --git a/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go b/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go new file mode 100755 index 000000000..c87bc96e6 --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatebanktransactionsresponse.go @@ -0,0 +1,164 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateBankTransactionsResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + Data *AccountingCreateBankTransactions `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateBankTransactionsResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateBankTransactionsResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateBankTransactionsResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateBankTransactionsResponse) GetData() *AccountingCreateBankTransactions { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateBankTransactionsResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateBankTransactionsResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateBankTransactionsResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateBankTransactionsResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateBankTransactionsResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateBankTransactionsResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateBankTransactionsResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateBankTransactionsResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateBankTransactionsResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateBankTransactionsResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreatedirectcostresponse.go b/lending/pkg/models/shared/accountingcreatedirectcostresponse.go new file mode 100755 index 000000000..b4e0b5d41 --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatedirectcostresponse.go @@ -0,0 +1,179 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateDirectCostResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // > **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/accounting-api#/schemas/AccountTransaction). + Data *AccountingDirectCost `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateDirectCostResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateDirectCostResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateDirectCostResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateDirectCostResponse) GetData() *AccountingDirectCost { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateDirectCostResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateDirectCostResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateDirectCostResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateDirectCostResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateDirectCostResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateDirectCostResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateDirectCostResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateDirectCostResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateDirectCostResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateDirectCostResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreatesupplierresponse.go b/lending/pkg/models/shared/accountingcreatesupplierresponse.go new file mode 100755 index 000000000..d268c5476 --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatesupplierresponse.go @@ -0,0 +1,169 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateSupplierResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // > 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). + Data *AccountingSupplier `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateSupplierResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateSupplierResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateSupplierResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateSupplierResponse) GetData() *AccountingSupplier { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateSupplierResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateSupplierResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateSupplierResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateSupplierResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateSupplierResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateSupplierResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateSupplierResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateSupplierResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateSupplierResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateSupplierResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreatetransferresponse.go b/lending/pkg/models/shared/accountingcreatetransferresponse.go new file mode 100755 index 000000000..843a7c057 --- /dev/null +++ b/lending/pkg/models/shared/accountingcreatetransferresponse.go @@ -0,0 +1,167 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type AccountingCreateTransferResponse struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // > 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/accounting-api#/schemas/AccountTransaction). + Data *AccountingTransfer `json:"data,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *AccountingCreateTransferResponse) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *AccountingCreateTransferResponse) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *AccountingCreateTransferResponse) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *AccountingCreateTransferResponse) GetData() *AccountingTransfer { + if o == nil { + return nil + } + return o.Data +} + +func (o *AccountingCreateTransferResponse) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *AccountingCreateTransferResponse) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *AccountingCreateTransferResponse) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *AccountingCreateTransferResponse) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *AccountingCreateTransferResponse) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *AccountingCreateTransferResponse) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *AccountingCreateTransferResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AccountingCreateTransferResponse) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *AccountingCreateTransferResponse) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *AccountingCreateTransferResponse) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/accountingcreditnote.go b/lending/pkg/models/shared/accountingcreditnote.go index 82e3fc31f..e2c43f2b8 100755 --- a/lending/pkg/models/shared/accountingcreditnote.go +++ b/lending/pkg/models/shared/accountingcreditnote.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -20,8 +20,8 @@ import ( // * Payment allocations against the payments type, in this case an invoice. // * Which customers the credit notes have been issued to. type AccountingCreditNote struct { - AdditionalTaxAmount *types.Decimal `json:"additionalTaxAmount,omitempty"` - AdditionalTaxPercentage *types.Decimal `json:"additionalTaxPercentage,omitempty"` + AdditionalTaxAmount *decimal.Big `decimal:"number" json:"additionalTaxAmount,omitempty"` + AdditionalTaxPercentage *decimal.Big `decimal:"number" json:"additionalTaxPercentage,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -77,10 +77,10 @@ type AccountingCreditNote struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // Percentage rate (from 0 to 100) of discounts applied to the credit note. - DiscountPercentage types.Decimal `json:"discountPercentage"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage"` // Identifier for the credit note, unique to the company in the accounting platform. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -111,32 +111,43 @@ type AccountingCreditNote struct { // An array of payment allocations. PaymentAllocations []AccountingPaymentAllocation `json:"paymentAllocations,omitempty"` // Unused balance of totalAmount originally raised. - RemainingCredit types.Decimal `json:"remainingCredit"` + RemainingCredit *decimal.Big `decimal:"number" json:"remainingCredit"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` Status CreditNoteStatus `json:"status"` // Value of the credit note, including discounts and excluding tax. - SubTotal types.Decimal `json:"subTotal"` + SubTotal *decimal.Big `decimal:"number" json:"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. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Total amount of credit that has been applied to the customer's accounts receivable - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` // Any discounts applied to the credit note amount. - TotalDiscount types.Decimal `json:"totalDiscount"` + TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount"` // Any tax applied to the credit note amount. - TotalTaxAmount types.Decimal `json:"totalTaxAmount"` - WithholdingTax []Items `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` } -func (o *AccountingCreditNote) GetAdditionalTaxAmount() *types.Decimal { +func (a AccountingCreditNote) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingCreditNote) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountingCreditNote) GetAdditionalTaxAmount() *decimal.Big { if o == nil { return nil } return o.AdditionalTaxAmount } -func (o *AccountingCreditNote) GetAdditionalTaxPercentage() *types.Decimal { +func (o *AccountingCreditNote) GetAdditionalTaxPercentage() *decimal.Big { if o == nil { return nil } @@ -164,7 +175,7 @@ func (o *AccountingCreditNote) GetCurrency() *string { return o.Currency } -func (o *AccountingCreditNote) GetCurrencyRate() *types.Decimal { +func (o *AccountingCreditNote) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -178,9 +189,9 @@ func (o *AccountingCreditNote) GetCustomerRef() *AccountingCustomerRef { return o.CustomerRef } -func (o *AccountingCreditNote) GetDiscountPercentage() types.Decimal { +func (o *AccountingCreditNote) GetDiscountPercentage() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.DiscountPercentage } @@ -234,9 +245,9 @@ func (o *AccountingCreditNote) GetPaymentAllocations() []AccountingPaymentAlloca return o.PaymentAllocations } -func (o *AccountingCreditNote) GetRemainingCredit() types.Decimal { +func (o *AccountingCreditNote) GetRemainingCredit() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.RemainingCredit } @@ -255,9 +266,9 @@ func (o *AccountingCreditNote) GetStatus() CreditNoteStatus { return o.Status } -func (o *AccountingCreditNote) GetSubTotal() types.Decimal { +func (o *AccountingCreditNote) GetSubTotal() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.SubTotal } @@ -269,23 +280,23 @@ func (o *AccountingCreditNote) GetSupplementalData() *SupplementalData { return o.SupplementalData } -func (o *AccountingCreditNote) GetTotalAmount() types.Decimal { +func (o *AccountingCreditNote) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } -func (o *AccountingCreditNote) GetTotalDiscount() types.Decimal { +func (o *AccountingCreditNote) GetTotalDiscount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalDiscount } -func (o *AccountingCreditNote) GetTotalTaxAmount() types.Decimal { +func (o *AccountingCreditNote) GetTotalTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalTaxAmount } diff --git a/lending/pkg/models/shared/accountingdirectcost.go b/lending/pkg/models/shared/accountingdirectcost.go index d64505054..c062f1f0a 100755 --- a/lending/pkg/models/shared/accountingdirectcost.go +++ b/lending/pkg/models/shared/accountingdirectcost.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -58,7 +58,7 @@ type AccountingDirectCost struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the direct cost, unique for the company. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -93,15 +93,26 @@ type AccountingDirectCost struct { Reference *string `json:"reference,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // The total amount of the direct costs, excluding any taxes. - SubTotal types.Decimal `json:"subTotal"` + SubTotal *decimal.Big `decimal:"number" json:"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. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct costs. - TaxAmount types.Decimal `json:"taxAmount"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` // The amount of the direct costs, inclusive of tax. - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` +} + +func (a AccountingDirectCost) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingDirectCost) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingDirectCost) GetContactRef() *ContactRef { @@ -118,7 +129,7 @@ func (o *AccountingDirectCost) GetCurrency() string { return o.Currency } -func (o *AccountingDirectCost) GetCurrencyRate() *types.Decimal { +func (o *AccountingDirectCost) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -188,9 +199,9 @@ func (o *AccountingDirectCost) GetSourceModifiedDate() *string { return o.SourceModifiedDate } -func (o *AccountingDirectCost) GetSubTotal() types.Decimal { +func (o *AccountingDirectCost) GetSubTotal() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.SubTotal } @@ -202,16 +213,16 @@ func (o *AccountingDirectCost) GetSupplementalData() *SupplementalData { return o.SupplementalData } -func (o *AccountingDirectCost) GetTaxAmount() types.Decimal { +func (o *AccountingDirectCost) GetTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TaxAmount } -func (o *AccountingDirectCost) GetTotalAmount() types.Decimal { +func (o *AccountingDirectCost) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } diff --git a/lending/pkg/models/shared/accountingdirectincome.go b/lending/pkg/models/shared/accountingdirectincome.go index 7fc01cbc2..e60c649ed 100755 --- a/lending/pkg/models/shared/accountingdirectincome.go +++ b/lending/pkg/models/shared/accountingdirectincome.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -58,7 +58,7 @@ type AccountingDirectIncome struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the direct income, unique for the company. ID *string `json:"id,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -91,15 +91,26 @@ type AccountingDirectIncome struct { Reference *string `json:"reference,omitempty"` SourceModifiedDate *string `json:"sourceModifiedDate,omitempty"` // The total amount of the direct incomes, excluding any taxes. - SubTotal types.Decimal `json:"subTotal"` + SubTotal *decimal.Big `decimal:"number" json:"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. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // The total amount of tax on the direct incomes. - TaxAmount types.Decimal `json:"taxAmount"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount"` // The amount of the direct incomes, inclusive of tax. - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` +} + +func (a AccountingDirectIncome) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingDirectIncome) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingDirectIncome) GetContactRef() *ContactRef { @@ -116,7 +127,7 @@ func (o *AccountingDirectIncome) GetCurrency() string { return o.Currency } -func (o *AccountingDirectIncome) GetCurrencyRate() *types.Decimal { +func (o *AccountingDirectIncome) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -186,9 +197,9 @@ func (o *AccountingDirectIncome) GetSourceModifiedDate() *string { return o.SourceModifiedDate } -func (o *AccountingDirectIncome) GetSubTotal() types.Decimal { +func (o *AccountingDirectIncome) GetSubTotal() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.SubTotal } @@ -200,16 +211,16 @@ func (o *AccountingDirectIncome) GetSupplementalData() *SupplementalData { return o.SupplementalData } -func (o *AccountingDirectIncome) GetTaxAmount() types.Decimal { +func (o *AccountingDirectIncome) GetTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TaxAmount } -func (o *AccountingDirectIncome) GetTotalAmount() types.Decimal { +func (o *AccountingDirectIncome) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } diff --git a/lending/pkg/models/shared/accountinginvoice.go b/lending/pkg/models/shared/accountinginvoice.go index 777c7f84c..05dde3db9 100755 --- a/lending/pkg/models/shared/accountinginvoice.go +++ b/lending/pkg/models/shared/accountinginvoice.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -56,10 +56,10 @@ func (o *AccountingInvoiceSalesOrderReference) GetID() *string { // > // > 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. type AccountingInvoice struct { - AdditionalTaxAmount *types.Decimal `json:"additionalTaxAmount,omitempty"` - AdditionalTaxPercentage *types.Decimal `json:"additionalTaxPercentage,omitempty"` + AdditionalTaxAmount *decimal.Big `decimal:"number" json:"additionalTaxAmount,omitempty"` + AdditionalTaxPercentage *decimal.Big `decimal:"number" json:"additionalTaxPercentage,omitempty"` // Amount outstanding on the invoice. - AmountDue types.Decimal `json:"amountDue"` + AmountDue *decimal.Big `decimal:"number" json:"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 @@ -93,10 +93,10 @@ type AccountingInvoice struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // 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`. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -181,37 +181,48 @@ type AccountingInvoice struct { // - `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. Status InvoiceStatus `json:"status"` // Total amount of the invoice excluding any taxes. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // 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. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // Amount of the invoice, inclusive of tax. - TotalAmount types.Decimal `json:"totalAmount"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount"` // Numerical value of discounts applied to the invoice. - TotalDiscount *types.Decimal `json:"totalDiscount,omitempty"` + TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount,omitempty"` // Amount of tax on the invoice. - TotalTaxAmount types.Decimal `json:"totalTaxAmount"` - WithholdingTax []Items `json:"withholdingTax,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount"` + WithholdingTax []Items `json:"withholdingTax,omitempty"` } -func (o *AccountingInvoice) GetAdditionalTaxAmount() *types.Decimal { +func (a AccountingInvoice) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingInvoice) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountingInvoice) GetAdditionalTaxAmount() *decimal.Big { if o == nil { return nil } return o.AdditionalTaxAmount } -func (o *AccountingInvoice) GetAdditionalTaxPercentage() *types.Decimal { +func (o *AccountingInvoice) GetAdditionalTaxPercentage() *decimal.Big { if o == nil { return nil } return o.AdditionalTaxPercentage } -func (o *AccountingInvoice) GetAmountDue() types.Decimal { +func (o *AccountingInvoice) GetAmountDue() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.AmountDue } @@ -223,7 +234,7 @@ func (o *AccountingInvoice) GetCurrency() *string { return o.Currency } -func (o *AccountingInvoice) GetCurrencyRate() *types.Decimal { +func (o *AccountingInvoice) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -237,7 +248,7 @@ func (o *AccountingInvoice) GetCustomerRef() *AccountingCustomerRef { return o.CustomerRef } -func (o *AccountingInvoice) GetDiscountPercentage() *types.Decimal { +func (o *AccountingInvoice) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -335,7 +346,7 @@ func (o *AccountingInvoice) GetStatus() InvoiceStatus { return o.Status } -func (o *AccountingInvoice) GetSubTotal() *types.Decimal { +func (o *AccountingInvoice) GetSubTotal() *decimal.Big { if o == nil { return nil } @@ -349,23 +360,23 @@ func (o *AccountingInvoice) GetSupplementalData() *SupplementalData { return o.SupplementalData } -func (o *AccountingInvoice) GetTotalAmount() types.Decimal { +func (o *AccountingInvoice) GetTotalAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalAmount } -func (o *AccountingInvoice) GetTotalDiscount() *types.Decimal { +func (o *AccountingInvoice) GetTotalDiscount() *decimal.Big { if o == nil { return nil } return o.TotalDiscount } -func (o *AccountingInvoice) GetTotalTaxAmount() types.Decimal { +func (o *AccountingInvoice) GetTotalTaxAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.TotalTaxAmount } diff --git a/lending/pkg/models/shared/accountingpayment.go b/lending/pkg/models/shared/accountingpayment.go index dedfcd087..35b39e1ea 100755 --- a/lending/pkg/models/shared/accountingpayment.go +++ b/lending/pkg/models/shared/accountingpayment.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // AccountingPayment - > **Payments or bill payments?** @@ -724,7 +725,7 @@ type AccountingPayment struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` CustomerRef *AccountingCustomerRef `json:"customerRef,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // @@ -763,7 +764,18 @@ type AccountingPayment struct { // 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. SupplementalData *SupplementalData `json:"supplementalData,omitempty"` // 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. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` +} + +func (a AccountingPayment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingPayment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingPayment) GetAccountRef() *AccountRef { @@ -780,7 +792,7 @@ func (o *AccountingPayment) GetCurrency() *string { return o.Currency } -func (o *AccountingPayment) GetCurrencyRate() *types.Decimal { +func (o *AccountingPayment) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -864,7 +876,7 @@ func (o *AccountingPayment) GetSupplementalData() *SupplementalData { return o.SupplementalData } -func (o *AccountingPayment) GetTotalAmount() *types.Decimal { +func (o *AccountingPayment) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accountingpaymentallocation.go b/lending/pkg/models/shared/accountingpaymentallocation.go index 8b7d26208..30c8f1402 100755 --- a/lending/pkg/models/shared/accountingpaymentallocation.go +++ b/lending/pkg/models/shared/accountingpaymentallocation.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type AccountingPaymentAllocationAllocation struct { @@ -60,9 +61,20 @@ type AccountingPaymentAllocationAllocation struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // The total amount that has been allocated. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` +} + +func (a AccountingPaymentAllocationAllocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingPaymentAllocationAllocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil } func (o *AccountingPaymentAllocationAllocation) GetAllocatedOnDate() *string { @@ -79,14 +91,14 @@ func (o *AccountingPaymentAllocationAllocation) GetCurrency() *string { return o.Currency } -func (o *AccountingPaymentAllocationAllocation) GetCurrencyRate() *types.Decimal { +func (o *AccountingPaymentAllocationAllocation) GetCurrencyRate() *decimal.Big { if o == nil { return nil } return o.CurrencyRate } -func (o *AccountingPaymentAllocationAllocation) GetTotalAmount() *types.Decimal { +func (o *AccountingPaymentAllocationAllocation) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accounts.go b/lending/pkg/models/shared/accounts.go index 858e05c55..615685eba 100755 --- a/lending/pkg/models/shared/accounts.go +++ b/lending/pkg/models/shared/accounts.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type Accounts struct { @@ -22,13 +23,24 @@ type Accounts struct { // There are only a very small number of edge cases where this currency code is returned by the Codat system. Currency *string `json:"currency,omitempty"` // The balance of the bank account. - CurrentBalance *types.Decimal `json:"currentBalance,omitempty"` + CurrentBalance *decimal.Big `decimal:"number" json:"currentBalance,omitempty"` // Name of the banking data source, e.g. "Plaid". PlatformName *string `json:"platformName,omitempty"` // A source reference containing the `sourceType` object "Banking". SourceRef *SourceRef `json:"sourceRef,omitempty"` } +func (a Accounts) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *Accounts) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + func (o *Accounts) GetAccountName() *string { if o == nil { return nil @@ -57,7 +69,7 @@ func (o *Accounts) GetCurrency() *string { return o.Currency } -func (o *Accounts) GetCurrentBalance() *types.Decimal { +func (o *Accounts) GetCurrentBalance() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/accounttransactionline.go b/lending/pkg/models/shared/accounttransactionline.go index d9fe53367..ced0f0b6a 100755 --- a/lending/pkg/models/shared/accounttransactionline.go +++ b/lending/pkg/models/shared/accounttransactionline.go @@ -3,12 +3,13 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type AccountTransactionLine struct { // Amount in the bill payment currency. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // Description of the account transaction. Description *string `json:"description,omitempty"` // Links the current record to the underlying record or data type that created it. @@ -17,7 +18,18 @@ type AccountTransactionLine struct { RecordRef *RecordRef `json:"recordRef,omitempty"` } -func (o *AccountTransactionLine) GetAmount() *types.Decimal { +func (a AccountTransactionLine) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountTransactionLine) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AccountTransactionLine) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/agedoutstandingamount.go b/lending/pkg/models/shared/agedoutstandingamount.go index f51838cf6..8bee45c7b 100755 --- a/lending/pkg/models/shared/agedoutstandingamount.go +++ b/lending/pkg/models/shared/agedoutstandingamount.go @@ -3,12 +3,13 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type AgedOutstandingAmount struct { // The amount outstanding. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // Array of details. Details []AgedOutstandingAmountDetail `json:"details,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -53,7 +54,18 @@ type AgedOutstandingAmount struct { ToDate *string `json:"toDate,omitempty"` } -func (o *AgedOutstandingAmount) GetAmount() *types.Decimal { +func (a AgedOutstandingAmount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AgedOutstandingAmount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AgedOutstandingAmount) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/agedoutstandingamountdetail.go b/lending/pkg/models/shared/agedoutstandingamountdetail.go index eec2e8bc0..71f374577 100755 --- a/lending/pkg/models/shared/agedoutstandingamountdetail.go +++ b/lending/pkg/models/shared/agedoutstandingamountdetail.go @@ -3,17 +3,29 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type AgedOutstandingAmountDetail struct { // The amount outstanding. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // Name of data type with outstanding amount for given period. Name *string `json:"name,omitempty"` } -func (o *AgedOutstandingAmountDetail) GetAmount() *types.Decimal { +func (a AgedOutstandingAmountDetail) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AgedOutstandingAmountDetail) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { + return err + } + return nil +} + +func (o *AgedOutstandingAmountDetail) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/balancesheet.go b/lending/pkg/models/shared/balancesheet.go index 4a1139486..a47c6b0a9 100755 --- a/lending/pkg/models/shared/balancesheet.go +++ b/lending/pkg/models/shared/balancesheet.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -32,7 +32,18 @@ type BalanceSheet struct { Equity *ReportLine `json:"equity,omitempty"` Liabilities *ReportLine `json:"liabilities,omitempty"` // Value of net assets for a company in their base currency. - NetAssets types.Decimal `json:"netAssets"` + NetAssets *decimal.Big `decimal:"number" json:"netAssets"` +} + +func (b BalanceSheet) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BalanceSheet) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil } func (o *BalanceSheet) GetAssets() *ReportLine { @@ -63,9 +74,9 @@ func (o *BalanceSheet) GetLiabilities() *ReportLine { return o.Liabilities } -func (o *BalanceSheet) GetNetAssets() types.Decimal { +func (o *BalanceSheet) GetNetAssets() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.NetAssets } diff --git a/lending/pkg/models/shared/bankingtransaction.go b/lending/pkg/models/shared/bankingtransaction.go index a8613d56a..4be67cf9e 100755 --- a/lending/pkg/models/shared/bankingtransaction.go +++ b/lending/pkg/models/shared/bankingtransaction.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // BankingTransaction - The Banking Transactions data type provides an immutable source of up-to-date information on income and expenditure. @@ -15,7 +16,7 @@ type BankingTransaction struct { // The unique identifier of the bank account. AccountID string `json:"accountId"` // The amount of the bank transaction. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -72,6 +73,17 @@ type BankingTransaction struct { TransactionCategoryRef *TransactionCategoryRef `json:"transactionCategoryRef,omitempty"` } +func (b BankingTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BankingTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + func (o *BankingTransaction) GetAccountID() string { if o == nil { return "" @@ -79,7 +91,7 @@ func (o *BankingTransaction) GetAccountID() string { return o.AccountID } -func (o *BankingTransaction) GetAmount() *types.Decimal { +func (o *BankingTransaction) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/bankingtransactionref.go b/lending/pkg/models/shared/bankingtransactionref.go index c18269e9b..d3b554ff6 100755 --- a/lending/pkg/models/shared/bankingtransactionref.go +++ b/lending/pkg/models/shared/bankingtransactionref.go @@ -3,14 +3,15 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type BankingTransactionRef struct { - AccountID *string `json:"accountId,omitempty"` - AccountName *string `json:"accountName,omitempty"` - Amount *types.Decimal `json:"amount,omitempty"` - DataConnectionID *string `json:"dataConnectionId,omitempty"` + AccountID *string `json:"accountId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` + DataConnectionID *string `json:"dataConnectionId,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -35,6 +36,17 @@ type BankingTransactionRef struct { ID *string `json:"id,omitempty"` } +func (b BankingTransactionRef) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BankingTransactionRef) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + func (o *BankingTransactionRef) GetAccountID() *string { if o == nil { return nil @@ -49,7 +61,7 @@ func (o *BankingTransactionRef) GetAccountName() *string { return o.AccountName } -func (o *BankingTransactionRef) GetAmount() *types.Decimal { +func (o *BankingTransactionRef) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/billcreditnotelineitem.go b/lending/pkg/models/shared/billcreditnotelineitem.go index 63e7f1611..b5ca3edce 100755 --- a/lending/pkg/models/shared/billcreditnotelineitem.go +++ b/lending/pkg/models/shared/billcreditnotelineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -41,14 +41,25 @@ func (o *BillCreditNoteLineItemItemReference) GetName() *string { // - Items type BillCreditNoteLineItemTaxRateReference struct { // Applicable tax rate. - EffectiveTaxRate *types.Decimal `json:"effectiveTaxRate,omitempty"` + EffectiveTaxRate *decimal.Big `decimal:"number" json:"effectiveTaxRate,omitempty"` // Unique identifier for the tax rate in the accounting platform. ID *string `json:"id,omitempty"` // Name of the tax rate in the accounting platform. Name *string `json:"name,omitempty"` } -func (o *BillCreditNoteLineItemTaxRateReference) GetEffectiveTaxRate() *types.Decimal { +func (b BillCreditNoteLineItemTaxRateReference) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BillCreditNoteLineItemTaxRateReference) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + +func (o *BillCreditNoteLineItemTaxRateReference) GetEffectiveTaxRate() *decimal.Big { if o == nil { return nil } @@ -75,17 +86,17 @@ type BillCreditNoteLineItem struct { // Friendly name of each line item. For example, the goods or service for which credit has been received. Description *string `json:"description,omitempty"` // Value of any discounts applied. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` // Percentage rate of any discount applied to the line item. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` // Reference to the item the line is linked to. ItemRef *BillCreditNoteLineItemItemReference `json:"itemRef,omitempty"` // Number of units of the goods or service for which credit has been received. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // Amount of credit associated with the line item, including discounts but excluding tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // Amount of tax associated with the line item. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -98,7 +109,7 @@ type BillCreditNoteLineItem struct { // - Items TaxRateRef *BillCreditNoteLineItemTaxRateReference `json:"taxRateRef,omitempty"` // Total amount of the line item, including discounts and tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Categories, and a project and customer, against which the item is tracked. Tracking *AccountsPayableTracking `json:"tracking,omitempty"` // Reference to the tracking categories to which the line item is linked. @@ -106,7 +117,18 @@ type BillCreditNoteLineItem struct { // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // Unit price of the goods or service. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (b BillCreditNoteLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BillCreditNoteLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil } func (o *BillCreditNoteLineItem) GetAccountRef() *AccountRef { @@ -123,14 +145,14 @@ func (o *BillCreditNoteLineItem) GetDescription() *string { return o.Description } -func (o *BillCreditNoteLineItem) GetDiscountAmount() *types.Decimal { +func (o *BillCreditNoteLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *BillCreditNoteLineItem) GetDiscountPercentage() *types.Decimal { +func (o *BillCreditNoteLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -144,21 +166,21 @@ func (o *BillCreditNoteLineItem) GetItemRef() *BillCreditNoteLineItemItemReferen return o.ItemRef } -func (o *BillCreditNoteLineItem) GetQuantity() types.Decimal { +func (o *BillCreditNoteLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *BillCreditNoteLineItem) GetSubTotal() *types.Decimal { +func (o *BillCreditNoteLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *BillCreditNoteLineItem) GetTaxAmount() *types.Decimal { +func (o *BillCreditNoteLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -172,7 +194,7 @@ func (o *BillCreditNoteLineItem) GetTaxRateRef() *BillCreditNoteLineItemTaxRateR return o.TaxRateRef } -func (o *BillCreditNoteLineItem) GetTotalAmount() *types.Decimal { +func (o *BillCreditNoteLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -193,9 +215,9 @@ func (o *BillCreditNoteLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef return o.TrackingCategoryRefs } -func (o *BillCreditNoteLineItem) GetUnitAmount() types.Decimal { +func (o *BillCreditNoteLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/billlineitem.go b/lending/pkg/models/shared/billlineitem.go index b87c4fe79..4b5f7d850 100755 --- a/lending/pkg/models/shared/billlineitem.go +++ b/lending/pkg/models/shared/billlineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -15,17 +15,17 @@ type BillLineItem struct { // Numerical value of any discounts applied. // // Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` - IsDirectCost *bool `json:"isDirectCost,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` + IsDirectCost *bool `json:"isDirectCost,omitempty"` // Reference to the item the line is linked to. ItemRef *ItemRef `json:"itemRef,omitempty"` // Number of units of goods or services received. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // Amount of the line, inclusive of discounts but exclusive of tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // Amount of tax for the line. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -38,13 +38,24 @@ type BillLineItem struct { // - Items TaxRateRef *TaxRateRef `json:"taxRateRef,omitempty"` // Total amount of the line, including tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Categories, and a project and customer, against which the item is tracked. Tracking *AccountsPayableTracking `json:"tracking,omitempty"` // Collection of categories against which this item is tracked. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // Price of each unit of goods or services. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (b BillLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BillLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil } func (o *BillLineItem) GetAccountRef() *AccountRef { @@ -61,14 +72,14 @@ func (o *BillLineItem) GetDescription() *string { return o.Description } -func (o *BillLineItem) GetDiscountAmount() *types.Decimal { +func (o *BillLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *BillLineItem) GetDiscountPercentage() *types.Decimal { +func (o *BillLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -89,21 +100,21 @@ func (o *BillLineItem) GetItemRef() *ItemRef { return o.ItemRef } -func (o *BillLineItem) GetQuantity() types.Decimal { +func (o *BillLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *BillLineItem) GetSubTotal() *types.Decimal { +func (o *BillLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *BillLineItem) GetTaxAmount() *types.Decimal { +func (o *BillLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -117,7 +128,7 @@ func (o *BillLineItem) GetTaxRateRef() *TaxRateRef { return o.TaxRateRef } -func (o *BillLineItem) GetTotalAmount() *types.Decimal { +func (o *BillLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -138,9 +149,9 @@ func (o *BillLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef { return o.TrackingCategoryRefs } -func (o *BillLineItem) GetUnitAmount() types.Decimal { +func (o *BillLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/billpaymentline.go b/lending/pkg/models/shared/billpaymentline.go index b6e17ce2f..300285e81 100755 --- a/lending/pkg/models/shared/billpaymentline.go +++ b/lending/pkg/models/shared/billpaymentline.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -29,10 +29,21 @@ type BillPaymentLine struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. AllocatedOnDate *string `json:"allocatedOnDate,omitempty"` // Amount in the bill payment currency. - Amount types.Decimal `json:"amount"` + Amount *decimal.Big `decimal:"number" json:"amount"` Links []BillPaymentLineLink `json:"links,omitempty"` } +func (b BillPaymentLine) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BillPaymentLine) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + func (o *BillPaymentLine) GetAllocatedOnDate() *string { if o == nil { return nil @@ -40,9 +51,9 @@ func (o *BillPaymentLine) GetAllocatedOnDate() *string { return o.AllocatedOnDate } -func (o *BillPaymentLine) GetAmount() types.Decimal { +func (o *BillPaymentLine) GetAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Amount } diff --git a/lending/pkg/models/shared/billpaymentlinelink.go b/lending/pkg/models/shared/billpaymentlinelink.go index 8dc675598..010b628e5 100755 --- a/lending/pkg/models/shared/billpaymentlinelink.go +++ b/lending/pkg/models/shared/billpaymentlinelink.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type BillPaymentLineLink struct { @@ -11,7 +12,7 @@ type BillPaymentLineLink struct { // // - 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. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // 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. @@ -37,21 +38,32 @@ type BillPaymentLineLink struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Unique identifier of the transaction represented by the link. ID *string `json:"id,omitempty"` // Types of links to bill payment lines. Type BillPaymentLineLinkType `json:"type"` } -func (o *BillPaymentLineLink) GetAmount() *types.Decimal { +func (b BillPaymentLineLink) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BillPaymentLineLink) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { + return err + } + return nil +} + +func (o *BillPaymentLineLink) GetAmount() *decimal.Big { if o == nil { return nil } return o.Amount } -func (o *BillPaymentLineLink) GetCurrencyRate() *types.Decimal { +func (o *BillPaymentLineLink) GetCurrencyRate() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/commerceorder.go b/lending/pkg/models/shared/commerceorder.go index 2f5bdafd7..766832d2c 100755 --- a/lending/pkg/models/shared/commerceorder.go +++ b/lending/pkg/models/shared/commerceorder.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // CommerceOrderSupplementalData - Supplemental data is additional data you can include in our standard data types. @@ -89,15 +90,26 @@ type CommerceOrder struct { // 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. SupplementalData *CommerceOrderSupplementalData `json:"supplementalData,omitempty"` // Total amount of the order, including tax, net of any discounts and refunds. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Total amount of discount applied to the order. - TotalDiscount *types.Decimal `json:"totalDiscount,omitempty"` + TotalDiscount *decimal.Big `decimal:"number" json:"totalDiscount,omitempty"` // Extra amount added to a bill. - TotalGratuity *types.Decimal `json:"totalGratuity,omitempty"` + TotalGratuity *decimal.Big `decimal:"number" json:"totalGratuity,omitempty"` // Total amount refunded issued by a merchant on an order (always a negative value). - TotalRefund *types.Decimal `json:"totalRefund,omitempty"` + TotalRefund *decimal.Big `decimal:"number" json:"totalRefund,omitempty"` // Total amount of tax applied to the order. - TotalTaxAmount *types.Decimal `json:"totalTaxAmount,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount,omitempty"` +} + +func (c CommerceOrder) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CommerceOrder) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil } func (o *CommerceOrder) GetClosedDate() *string { @@ -198,35 +210,35 @@ func (o *CommerceOrder) GetSupplementalData() *CommerceOrderSupplementalData { return o.SupplementalData } -func (o *CommerceOrder) GetTotalAmount() *types.Decimal { +func (o *CommerceOrder) GetTotalAmount() *decimal.Big { if o == nil { return nil } return o.TotalAmount } -func (o *CommerceOrder) GetTotalDiscount() *types.Decimal { +func (o *CommerceOrder) GetTotalDiscount() *decimal.Big { if o == nil { return nil } return o.TotalDiscount } -func (o *CommerceOrder) GetTotalGratuity() *types.Decimal { +func (o *CommerceOrder) GetTotalGratuity() *decimal.Big { if o == nil { return nil } return o.TotalGratuity } -func (o *CommerceOrder) GetTotalRefund() *types.Decimal { +func (o *CommerceOrder) GetTotalRefund() *decimal.Big { if o == nil { return nil } return o.TotalRefund } -func (o *CommerceOrder) GetTotalTaxAmount() *types.Decimal { +func (o *CommerceOrder) GetTotalTaxAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/commercepayment.go b/lending/pkg/models/shared/commercepayment.go index 68ab9fb73..57a5befb1 100755 --- a/lending/pkg/models/shared/commercepayment.go +++ b/lending/pkg/models/shared/commercepayment.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // CommercePayment - Payments contain details of all payments made by customers to a company, including: amounts, currency used, payment method, payment provider, and payment status. @@ -15,7 +16,7 @@ import ( // Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-payments) for this data type. type CommercePayment struct { // Payment Amount (including gratuity) - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -75,7 +76,18 @@ type CommercePayment struct { Status *PaymentStatus `json:"status,omitempty"` } -func (o *CommercePayment) GetAmount() *types.Decimal { +func (c CommercePayment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CommercePayment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CommercePayment) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/commercetransaction.go b/lending/pkg/models/shared/commercetransaction.go index 32780741f..cd70a18dd 100755 --- a/lending/pkg/models/shared/commercetransaction.go +++ b/lending/pkg/models/shared/commercetransaction.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // 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. @@ -72,7 +73,7 @@ type CommerceTransaction struct { // Non-standardised transaction type data from the commerce platform SubType *string `json:"subType,omitempty"` // The total transaction amount - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Link to the source event which triggered this transaction TransactionSourceRef *TransactionSourceRef `json:"transactionSourceRef,omitempty"` // The type of the platform transaction: @@ -87,6 +88,17 @@ type CommerceTransaction struct { Type *TransactionType `json:"type,omitempty"` } +func (c CommerceTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CommerceTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + func (o *CommerceTransaction) GetCreatedDate() *string { if o == nil { return nil @@ -136,7 +148,7 @@ func (o *CommerceTransaction) GetSubType() *string { return o.SubType } -func (o *CommerceTransaction) GetTotalAmount() *types.Decimal { +func (o *CommerceTransaction) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/createbankaccounttransaction.go b/lending/pkg/models/shared/createbankaccounttransaction.go new file mode 100755 index 000000000..e26bce8c1 --- /dev/null +++ b/lending/pkg/models/shared/createbankaccounttransaction.go @@ -0,0 +1,81 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" +) + +type CreateBankAccountTransaction struct { + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` + Balance *decimal.Big `decimal:"number" json:"balance,omitempty"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + Date *string `json:"date,omitempty"` + Description *string `json:"description,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (c CreateBankAccountTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateBankAccountTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil +} + +func (o *CreateBankAccountTransaction) GetAmount() *decimal.Big { + if o == nil { + return nil + } + return o.Amount +} + +func (o *CreateBankAccountTransaction) GetBalance() *decimal.Big { + if o == nil { + return nil + } + return o.Balance +} + +func (o *CreateBankAccountTransaction) GetDate() *string { + if o == nil { + return nil + } + return o.Date +} + +func (o *CreateBankAccountTransaction) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *CreateBankAccountTransaction) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/lending/pkg/models/shared/creditnotelineitem.go b/lending/pkg/models/shared/creditnotelineitem.go index 31e45bae0..eafe5ec03 100755 --- a/lending/pkg/models/shared/creditnotelineitem.go +++ b/lending/pkg/models/shared/creditnotelineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -13,18 +13,18 @@ type CreditNoteLineItem struct { // Friendly name of each line item. For example, the goods or service for which credit has been issued. Description *string `json:"description,omitempty"` // Value of any discounts applied. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` // Percentage rate of any discount applied to the line item. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` - IsDirectIncome *bool `json:"isDirectIncome,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` + IsDirectIncome *bool `json:"isDirectIncome,omitempty"` // Reference to the item the line is linked to. ItemRef *ItemRef `json:"itemRef,omitempty"` // Number of units of the goods or service for which credit has been issued. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // Amount of credit associated with the line item, including discounts but excluding tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // Amount of tax associated with the line item. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -37,7 +37,7 @@ type CreditNoteLineItem struct { // - Items TaxRateRef *TaxRateRef `json:"taxRateRef,omitempty"` // Total amount of the line item, including discounts and tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Categories, and a project and customer, against which the item is tracked. Tracking *AccountsReceivableTracking `json:"tracking,omitempty"` // Reference to the tracking categories to which the line item is linked. @@ -45,7 +45,18 @@ type CreditNoteLineItem struct { // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // Unit price of the goods or service. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (c CreditNoteLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreditNoteLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { + return err + } + return nil } func (o *CreditNoteLineItem) GetAccountRef() *AccountRef { @@ -62,14 +73,14 @@ func (o *CreditNoteLineItem) GetDescription() *string { return o.Description } -func (o *CreditNoteLineItem) GetDiscountAmount() *types.Decimal { +func (o *CreditNoteLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *CreditNoteLineItem) GetDiscountPercentage() *types.Decimal { +func (o *CreditNoteLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -90,21 +101,21 @@ func (o *CreditNoteLineItem) GetItemRef() *ItemRef { return o.ItemRef } -func (o *CreditNoteLineItem) GetQuantity() types.Decimal { +func (o *CreditNoteLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *CreditNoteLineItem) GetSubTotal() *types.Decimal { +func (o *CreditNoteLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *CreditNoteLineItem) GetTaxAmount() *types.Decimal { +func (o *CreditNoteLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -118,7 +129,7 @@ func (o *CreditNoteLineItem) GetTaxRateRef() *TaxRateRef { return o.TaxRateRef } -func (o *CreditNoteLineItem) GetTotalAmount() *types.Decimal { +func (o *CreditNoteLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -139,9 +150,9 @@ func (o *CreditNoteLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef { return o.TrackingCategoryRefs } -func (o *CreditNoteLineItem) GetUnitAmount() types.Decimal { +func (o *CreditNoteLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/dataintegrityamounts.go b/lending/pkg/models/shared/dataintegrityamounts.go index 327da6106..78445ba4c 100755 --- a/lending/pkg/models/shared/dataintegrityamounts.go +++ b/lending/pkg/models/shared/dataintegrityamounts.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // DataIntegrityAmounts - Only returned for transactions. For accounts, there is nothing returned. @@ -17,9 +18,20 @@ type DataIntegrityAmounts struct { // There are only a very small number of edge cases where this currency code is returned by the Codat system. Currency *string `json:"currency,omitempty"` // Highest value of transaction set. - Max *types.Decimal `json:"max,omitempty"` + Max *decimal.Big `decimal:"number" json:"max,omitempty"` // Lowest value of transaction set. - Min *types.Decimal `json:"min,omitempty"` + Min *decimal.Big `decimal:"number" json:"min,omitempty"` +} + +func (d DataIntegrityAmounts) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DataIntegrityAmounts) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil } func (o *DataIntegrityAmounts) GetCurrency() *string { @@ -29,14 +41,14 @@ func (o *DataIntegrityAmounts) GetCurrency() *string { return o.Currency } -func (o *DataIntegrityAmounts) GetMax() *types.Decimal { +func (o *DataIntegrityAmounts) GetMax() *decimal.Big { if o == nil { return nil } return o.Max } -func (o *DataIntegrityAmounts) GetMin() *types.Decimal { +func (o *DataIntegrityAmounts) GetMin() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/dataintegritybyamount.go b/lending/pkg/models/shared/dataintegritybyamount.go index e87e9a11e..6c89422fb 100755 --- a/lending/pkg/models/shared/dataintegritybyamount.go +++ b/lending/pkg/models/shared/dataintegritybyamount.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type DataIntegrityByAmount struct { @@ -16,13 +17,24 @@ type DataIntegrityByAmount struct { // There are only a very small number of edge cases where this currency code is returned by the Codat system. Currency *string `json:"currency,omitempty"` // The percentage of the absolute value of transactions of the type specified in the route which have a match. - MatchPercentage *types.Decimal `json:"matchPercentage,omitempty"` + MatchPercentage *decimal.Big `decimal:"number" json:"matchPercentage,omitempty"` // The sum of the absolute value of transactions of the type specified in the route which have a match. - Matched *types.Decimal `json:"matched,omitempty"` + Matched *decimal.Big `decimal:"number" json:"matched,omitempty"` // The total of unmatched and matched. - Total *types.Decimal `json:"total,omitempty"` + Total *decimal.Big `decimal:"number" json:"total,omitempty"` // The sum of the absolute value of transactions of the type specified in the route which don't have a match. - Unmatched *types.Decimal `json:"unmatched,omitempty"` + Unmatched *decimal.Big `decimal:"number" json:"unmatched,omitempty"` +} + +func (d DataIntegrityByAmount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DataIntegrityByAmount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil } func (o *DataIntegrityByAmount) GetCurrency() *string { @@ -32,28 +44,28 @@ func (o *DataIntegrityByAmount) GetCurrency() *string { return o.Currency } -func (o *DataIntegrityByAmount) GetMatchPercentage() *types.Decimal { +func (o *DataIntegrityByAmount) GetMatchPercentage() *decimal.Big { if o == nil { return nil } return o.MatchPercentage } -func (o *DataIntegrityByAmount) GetMatched() *types.Decimal { +func (o *DataIntegrityByAmount) GetMatched() *decimal.Big { if o == nil { return nil } return o.Matched } -func (o *DataIntegrityByAmount) GetTotal() *types.Decimal { +func (o *DataIntegrityByAmount) GetTotal() *decimal.Big { if o == nil { return nil } return o.Total } -func (o *DataIntegrityByAmount) GetUnmatched() *types.Decimal { +func (o *DataIntegrityByAmount) GetUnmatched() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/dataintegritybycount.go b/lending/pkg/models/shared/dataintegritybycount.go index a21743a9a..28e072999 100755 --- a/lending/pkg/models/shared/dataintegritybycount.go +++ b/lending/pkg/models/shared/dataintegritybycount.go @@ -3,42 +3,54 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type DataIntegrityByCount struct { // The percentage of records of the type specified in the route which have a match. - MatchPercentage *types.Decimal `json:"matchPercentage,omitempty"` + MatchPercentage *decimal.Big `decimal:"number" json:"matchPercentage,omitempty"` // The number of records of the type specified in the route which do have a match. - Matched *types.Decimal `json:"matched,omitempty"` + Matched *decimal.Big `decimal:"number" json:"matched,omitempty"` // The total of unmatched and matched. - Total *types.Decimal `json:"total,omitempty"` + Total *decimal.Big `decimal:"number" json:"total,omitempty"` // The number of records of the type specified in the route which don't have a match. - Unmatched *types.Decimal `json:"unmatched,omitempty"` + Unmatched *decimal.Big `decimal:"number" json:"unmatched,omitempty"` } -func (o *DataIntegrityByCount) GetMatchPercentage() *types.Decimal { +func (d DataIntegrityByCount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DataIntegrityByCount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil +} + +func (o *DataIntegrityByCount) GetMatchPercentage() *decimal.Big { if o == nil { return nil } return o.MatchPercentage } -func (o *DataIntegrityByCount) GetMatched() *types.Decimal { +func (o *DataIntegrityByCount) GetMatched() *decimal.Big { if o == nil { return nil } return o.Matched } -func (o *DataIntegrityByCount) GetTotal() *types.Decimal { +func (o *DataIntegrityByCount) GetTotal() *decimal.Big { if o == nil { return nil } return o.Total } -func (o *DataIntegrityByCount) GetUnmatched() *types.Decimal { +func (o *DataIntegrityByCount) GetUnmatched() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/dataintegritydetail.go b/lending/pkg/models/shared/dataintegritydetail.go index 459e79388..ba90e36a5 100755 --- a/lending/pkg/models/shared/dataintegritydetail.go +++ b/lending/pkg/models/shared/dataintegritydetail.go @@ -3,12 +3,13 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type DataIntegrityDetail struct { // The transaction value. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // ID GUID representing the connection of the accounting or banking platform. ConnectionID *string `json:"connectionId,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. @@ -48,7 +49,18 @@ type DataIntegrityDetail struct { Type *string `json:"type,omitempty"` } -func (o *DataIntegrityDetail) GetAmount() *types.Decimal { +func (d DataIntegrityDetail) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DataIntegrityDetail) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil +} + +func (o *DataIntegrityDetail) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/directcostlineitem.go b/lending/pkg/models/shared/directcostlineitem.go index e7c775215..a2cd3037b 100755 --- a/lending/pkg/models/shared/directcostlineitem.go +++ b/lending/pkg/models/shared/directcostlineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -13,19 +13,19 @@ type DirectCostLineItem struct { // Friendly name of the goods or services. Description *string `json:"description,omitempty"` // Discount amount for the line before tax. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` // Discount percentage for the line before tax. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` // Reference to the item the line is linked to. ItemRef *ItemRef `json:"itemRef,omitempty"` // Number of units of goods or services received. // // Note: If the platform does not provide this information, the quantity will be mapped as 1. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // Amount of the line, inclusive of discounts but exclusive of tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // Amount of tax for the line. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -38,15 +38,26 @@ type DirectCostLineItem struct { // - Items TaxRateRef *TaxRateRef `json:"taxRateRef,omitempty"` // Total amount of the line, including tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` - Tracking *Tracking `json:"tracking,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` + Tracking *Tracking `json:"tracking,omitempty"` // 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. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // 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. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (d DirectCostLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DirectCostLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil } func (o *DirectCostLineItem) GetAccountRef() *AccountRef { @@ -63,14 +74,14 @@ func (o *DirectCostLineItem) GetDescription() *string { return o.Description } -func (o *DirectCostLineItem) GetDiscountAmount() *types.Decimal { +func (o *DirectCostLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *DirectCostLineItem) GetDiscountPercentage() *types.Decimal { +func (o *DirectCostLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -84,21 +95,21 @@ func (o *DirectCostLineItem) GetItemRef() *ItemRef { return o.ItemRef } -func (o *DirectCostLineItem) GetQuantity() types.Decimal { +func (o *DirectCostLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *DirectCostLineItem) GetSubTotal() *types.Decimal { +func (o *DirectCostLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *DirectCostLineItem) GetTaxAmount() *types.Decimal { +func (o *DirectCostLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -112,7 +123,7 @@ func (o *DirectCostLineItem) GetTaxRateRef() *TaxRateRef { return o.TaxRateRef } -func (o *DirectCostLineItem) GetTotalAmount() *types.Decimal { +func (o *DirectCostLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -133,9 +144,9 @@ func (o *DirectCostLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef { return o.TrackingCategoryRefs } -func (o *DirectCostLineItem) GetUnitAmount() types.Decimal { +func (o *DirectCostLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/directincomelineitem.go b/lending/pkg/models/shared/directincomelineitem.go index 56f51db37..ec25f1e95 100755 --- a/lending/pkg/models/shared/directincomelineitem.go +++ b/lending/pkg/models/shared/directincomelineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -13,20 +13,20 @@ type DirectIncomeLineItem struct { // A user-friendly name of the goods or services. Description *string `json:"description,omitempty"` // Discount amount for the line before tax. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` // Discount percentage for the line before tax. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` // Reference to the item the line is linked to. ItemRef *ItemRef `json:"itemRef,omitempty"` // 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. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // The amount of the line, inclusive of discounts, but exclusive of tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // The amount of tax for the line. // Note: If the platform does not provide this information, the quantity will be mapped as 0.00. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -39,12 +39,23 @@ type DirectIncomeLineItem struct { // - Items TaxRateRef *TaxRateRef `json:"taxRateRef,omitempty"` // The total amount of the line, including tax. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // An array of categories against which this direct cost is tracked. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // 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. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (d DirectIncomeLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DirectIncomeLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { + return err + } + return nil } func (o *DirectIncomeLineItem) GetAccountRef() *AccountRef { @@ -61,14 +72,14 @@ func (o *DirectIncomeLineItem) GetDescription() *string { return o.Description } -func (o *DirectIncomeLineItem) GetDiscountAmount() *types.Decimal { +func (o *DirectIncomeLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *DirectIncomeLineItem) GetDiscountPercentage() *types.Decimal { +func (o *DirectIncomeLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -82,21 +93,21 @@ func (o *DirectIncomeLineItem) GetItemRef() *ItemRef { return o.ItemRef } -func (o *DirectIncomeLineItem) GetQuantity() types.Decimal { +func (o *DirectIncomeLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *DirectIncomeLineItem) GetSubTotal() *types.Decimal { +func (o *DirectIncomeLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *DirectIncomeLineItem) GetTaxAmount() *types.Decimal { +func (o *DirectIncomeLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -110,7 +121,7 @@ func (o *DirectIncomeLineItem) GetTaxRateRef() *TaxRateRef { return o.TaxRateRef } -func (o *DirectIncomeLineItem) GetTotalAmount() *types.Decimal { +func (o *DirectIncomeLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -124,9 +135,9 @@ func (o *DirectIncomeLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef { return o.TrackingCategoryRefs } -func (o *DirectIncomeLineItem) GetUnitAmount() types.Decimal { +func (o *DirectIncomeLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/enhancedcashflowtransaction.go b/lending/pkg/models/shared/enhancedcashflowtransaction.go index 7adc1c660..e2af87b3f 100755 --- a/lending/pkg/models/shared/enhancedcashflowtransaction.go +++ b/lending/pkg/models/shared/enhancedcashflowtransaction.go @@ -3,15 +3,16 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type EnhancedCashFlowTransaction struct { // An account reference containing the account id and name. AccountRef *AccountRef `json:"accountRef,omitempty"` // The bank transaction amount. - Amount *types.Decimal `json:"amount,omitempty"` - Currency *string `json:"currency,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -43,6 +44,17 @@ type EnhancedCashFlowTransaction struct { TransactionCategory *TransactionCategory `json:"transactionCategory,omitempty"` } +func (e EnhancedCashFlowTransaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnhancedCashFlowTransaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + func (o *EnhancedCashFlowTransaction) GetAccountRef() *AccountRef { if o == nil { return nil @@ -50,7 +62,7 @@ func (o *EnhancedCashFlowTransaction) GetAccountRef() *AccountRef { return o.AccountRef } -func (o *EnhancedCashFlowTransaction) GetAmount() *types.Decimal { +func (o *EnhancedCashFlowTransaction) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/enhancedfinancialreport.go b/lending/pkg/models/shared/enhancedfinancialreport.go index e8dac7ae5..bdcad9f80 100755 --- a/lending/pkg/models/shared/enhancedfinancialreport.go +++ b/lending/pkg/models/shared/enhancedfinancialreport.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type EnhancedFinancialReportReportItem struct { @@ -13,7 +14,7 @@ type EnhancedFinancialReportReportItem struct { // Name of the account. AccountName *string `json:"accountName,omitempty"` // Balance of the account as reported on the profit and loss or Balance sheet. - Balance *types.Decimal `json:"balance,omitempty"` + Balance *decimal.Big `decimal:"number" json:"balance,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -36,6 +37,17 @@ type EnhancedFinancialReportReportItem struct { Date *string `json:"date,omitempty"` } +func (e EnhancedFinancialReportReportItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnhancedFinancialReportReportItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + func (o *EnhancedFinancialReportReportItem) GetAccountCategory() *EnhancedReportAccountCategory { if o == nil { return nil @@ -57,7 +69,7 @@ func (o *EnhancedFinancialReportReportItem) GetAccountName() *string { return o.AccountName } -func (o *EnhancedFinancialReportReportItem) GetBalance() *types.Decimal { +func (o *EnhancedFinancialReportReportItem) GetBalance() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/enhancedinvoicereportitem.go b/lending/pkg/models/shared/enhancedinvoicereportitem.go index 999526250..4c48cff67 100755 --- a/lending/pkg/models/shared/enhancedinvoicereportitem.go +++ b/lending/pkg/models/shared/enhancedinvoicereportitem.go @@ -3,11 +3,12 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type EnhancedInvoiceReportItem struct { - AmountDue *types.Decimal `json:"amountDue,omitempty"` + AmountDue *decimal.Big `decimal:"number" json:"amountDue,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -91,10 +92,21 @@ type EnhancedInvoiceReportItem struct { // - `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. Status *InvoiceStatus `json:"status,omitempty"` - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` } -func (o *EnhancedInvoiceReportItem) GetAmountDue() *types.Decimal { +func (e EnhancedInvoiceReportItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnhancedInvoiceReportItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { + return err + } + return nil +} + +func (o *EnhancedInvoiceReportItem) GetAmountDue() *decimal.Big { if o == nil { return nil } @@ -178,7 +190,7 @@ func (o *EnhancedInvoiceReportItem) GetStatus() *InvoiceStatus { return o.Status } -func (o *EnhancedInvoiceReportItem) GetTotalAmount() *types.Decimal { +func (o *EnhancedInvoiceReportItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/invoicelineitem.go b/lending/pkg/models/shared/invoicelineitem.go index e1283bbf3..949f5debc 100755 --- a/lending/pkg/models/shared/invoicelineitem.go +++ b/lending/pkg/models/shared/invoicelineitem.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -13,18 +13,18 @@ type InvoiceLineItem struct { // Friendly name of the goods or services provided. Description *string `json:"description,omitempty"` // Numerical value of any discounts applied. - DiscountAmount *types.Decimal `json:"discountAmount,omitempty"` + DiscountAmount *decimal.Big `decimal:"number" json:"discountAmount,omitempty"` // Percentage rate (from 0 to 100) of any discounts applied to the unit amount. - DiscountPercentage *types.Decimal `json:"discountPercentage,omitempty"` - IsDirectIncome *bool `json:"isDirectIncome,omitempty"` + DiscountPercentage *decimal.Big `decimal:"number" json:"discountPercentage,omitempty"` + IsDirectIncome *bool `json:"isDirectIncome,omitempty"` // Reference to the item the line is linked to. ItemRef *ItemRef `json:"itemRef,omitempty"` // Number of units of goods or services provided. - Quantity types.Decimal `json:"quantity"` + Quantity *decimal.Big `decimal:"number" json:"quantity"` // Amount of the line, inclusive of discounts but exclusive of tax. - SubTotal *types.Decimal `json:"subTotal,omitempty"` + SubTotal *decimal.Big `decimal:"number" json:"subTotal,omitempty"` // Amount of tax for the line. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // 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: @@ -37,7 +37,7 @@ type InvoiceLineItem struct { // - Items TaxRateRef *TaxRateRef `json:"taxRateRef,omitempty"` // 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. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Categories, and a project and customer, against which the item is tracked. Tracking *AccountsReceivableTracking `json:"tracking,omitempty"` // Reference to the tracking categories to which the line item is linked. @@ -45,7 +45,18 @@ type InvoiceLineItem struct { // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. TrackingCategoryRefs []TrackingCategoryRef `json:"trackingCategoryRefs,omitempty"` // Price of each unit of goods or services. - UnitAmount types.Decimal `json:"unitAmount"` + UnitAmount *decimal.Big `decimal:"number" json:"unitAmount"` +} + +func (i InvoiceLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *InvoiceLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { + return err + } + return nil } func (o *InvoiceLineItem) GetAccountRef() *AccountRef { @@ -62,14 +73,14 @@ func (o *InvoiceLineItem) GetDescription() *string { return o.Description } -func (o *InvoiceLineItem) GetDiscountAmount() *types.Decimal { +func (o *InvoiceLineItem) GetDiscountAmount() *decimal.Big { if o == nil { return nil } return o.DiscountAmount } -func (o *InvoiceLineItem) GetDiscountPercentage() *types.Decimal { +func (o *InvoiceLineItem) GetDiscountPercentage() *decimal.Big { if o == nil { return nil } @@ -90,21 +101,21 @@ func (o *InvoiceLineItem) GetItemRef() *ItemRef { return o.ItemRef } -func (o *InvoiceLineItem) GetQuantity() types.Decimal { +func (o *InvoiceLineItem) GetQuantity() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Quantity } -func (o *InvoiceLineItem) GetSubTotal() *types.Decimal { +func (o *InvoiceLineItem) GetSubTotal() *decimal.Big { if o == nil { return nil } return o.SubTotal } -func (o *InvoiceLineItem) GetTaxAmount() *types.Decimal { +func (o *InvoiceLineItem) GetTaxAmount() *decimal.Big { if o == nil { return nil } @@ -118,7 +129,7 @@ func (o *InvoiceLineItem) GetTaxRateRef() *TaxRateRef { return o.TaxRateRef } -func (o *InvoiceLineItem) GetTotalAmount() *types.Decimal { +func (o *InvoiceLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } @@ -139,9 +150,9 @@ func (o *InvoiceLineItem) GetTrackingCategoryRefs() []TrackingCategoryRef { return o.TrackingCategoryRefs } -func (o *InvoiceLineItem) GetUnitAmount() types.Decimal { +func (o *InvoiceLineItem) GetUnitAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.UnitAmount } diff --git a/lending/pkg/models/shared/items.go b/lending/pkg/models/shared/items.go index bf93693ba..8d84809b9 100755 --- a/lending/pkg/models/shared/items.go +++ b/lending/pkg/models/shared/items.go @@ -3,18 +3,29 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) type Items struct { - Amount types.Decimal `json:"amount"` - Name string `json:"name"` + Amount *decimal.Big `decimal:"number" json:"amount"` + Name string `json:"name"` } -func (o *Items) GetAmount() types.Decimal { +func (i Items) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *Items) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Items) GetAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Amount } diff --git a/lending/pkg/models/shared/journalline.go b/lending/pkg/models/shared/journalline.go index 7e70bb9ab..6b50de8eb 100755 --- a/lending/pkg/models/shared/journalline.go +++ b/lending/pkg/models/shared/journalline.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -27,11 +27,22 @@ type JournalLine struct { // Description of the journal line item. Description *string `json:"description,omitempty"` // Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. - NetAmount types.Decimal `json:"netAmount"` + NetAmount *decimal.Big `decimal:"number" json:"netAmount"` // List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) Tracking *JournalLineTracking `json:"tracking,omitempty"` } +func (j JournalLine) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(j, "", false) +} + +func (j *JournalLine) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { + return err + } + return nil +} + func (o *JournalLine) GetAccountRef() *AccountRef { if o == nil { return nil @@ -53,9 +64,9 @@ func (o *JournalLine) GetDescription() *string { return o.Description } -func (o *JournalLine) GetNetAmount() types.Decimal { +func (o *JournalLine) GetNetAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.NetAmount } diff --git a/lending/pkg/models/shared/loansummaryreportitem.go b/lending/pkg/models/shared/loansummaryreportitem.go index 98c03ec84..4c1d85377 100755 --- a/lending/pkg/models/shared/loansummaryreportitem.go +++ b/lending/pkg/models/shared/loansummaryreportitem.go @@ -3,12 +3,13 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type LoanSummaryReportItem struct { // The loan outstanding balance. This may not equal totalDrawdowns - totalRepayments due to interest which has been accrued. - Balance *types.Decimal `json:"balance,omitempty"` + Balance *decimal.Big `decimal:"number" json:"balance,omitempty"` // The description of the object being referred to. E.g. the account. Description *string `json:"description,omitempty"` RecordRef *LoanSummaryRecordRef `json:"recordRef,omitempty"` @@ -33,12 +34,23 @@ type LoanSummaryReportItem struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. StartDate *string `json:"startDate,omitempty"` // The total loan drawdowns. - TotalDrawdowns *types.Decimal `json:"totalDrawdowns,omitempty"` + TotalDrawdowns *decimal.Big `decimal:"number" json:"totalDrawdowns,omitempty"` // The total loan repayments which includes capital plus any interest. - TotalRepayments *types.Decimal `json:"totalRepayments,omitempty"` + TotalRepayments *decimal.Big `decimal:"number" json:"totalRepayments,omitempty"` } -func (o *LoanSummaryReportItem) GetBalance() *types.Decimal { +func (l LoanSummaryReportItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *LoanSummaryReportItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *LoanSummaryReportItem) GetBalance() *decimal.Big { if o == nil { return nil } @@ -66,14 +78,14 @@ func (o *LoanSummaryReportItem) GetStartDate() *string { return o.StartDate } -func (o *LoanSummaryReportItem) GetTotalDrawdowns() *types.Decimal { +func (o *LoanSummaryReportItem) GetTotalDrawdowns() *decimal.Big { if o == nil { return nil } return o.TotalDrawdowns } -func (o *LoanSummaryReportItem) GetTotalRepayments() *types.Decimal { +func (o *LoanSummaryReportItem) GetTotalRepayments() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/orderdiscountallocation.go b/lending/pkg/models/shared/orderdiscountallocation.go index 63e6b2509..d5738bb52 100755 --- a/lending/pkg/models/shared/orderdiscountallocation.go +++ b/lending/pkg/models/shared/orderdiscountallocation.go @@ -3,14 +3,26 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type OrderDiscountAllocation struct { // Name of the discount in the commerce or point of sale platform. Name *string `json:"name,omitempty"` // Total amount of discount applied. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` +} + +func (o OrderDiscountAllocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OrderDiscountAllocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { + return err + } + return nil } func (o *OrderDiscountAllocation) GetName() *string { @@ -20,7 +32,7 @@ func (o *OrderDiscountAllocation) GetName() *string { return o.Name } -func (o *OrderDiscountAllocation) GetTotalAmount() *types.Decimal { +func (o *OrderDiscountAllocation) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/orderlineitem.go b/lending/pkg/models/shared/orderlineitem.go index d7b289a7b..75f0ec0f5 100755 --- a/lending/pkg/models/shared/orderlineitem.go +++ b/lending/pkg/models/shared/orderlineitem.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type OrderLineItem struct { @@ -17,17 +18,28 @@ type OrderLineItem struct { // Number of units of the product sold. // For refunds, quantity is a negative value. // - Quantity *types.Decimal `json:"quantity,omitempty"` + Quantity *decimal.Big `decimal:"number" json:"quantity,omitempty"` // Percentage rate (from 0 to 100) of any sale tax applied to the unit amount. - TaxPercentage *types.Decimal `json:"taxPercentage,omitempty"` + TaxPercentage *decimal.Big `decimal:"number" json:"taxPercentage,omitempty"` // Taxes breakdown as applied to order lines. Taxes []TaxComponentAllocation `json:"taxes,omitempty"` // Total price of the line item, including discounts, tax and minus any refunds. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // Total amount of tax applied to the line item. - TotalTaxAmount *types.Decimal `json:"totalTaxAmount,omitempty"` + TotalTaxAmount *decimal.Big `decimal:"number" json:"totalTaxAmount,omitempty"` // Price per unit of goods or service. - UnitPrice *types.Decimal `json:"unitPrice,omitempty"` + UnitPrice *decimal.Big `decimal:"number" json:"unitPrice,omitempty"` +} + +func (o OrderLineItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OrderLineItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { + return err + } + return nil } func (o *OrderLineItem) GetDiscountAllocations() []OrderDiscountAllocation { @@ -58,14 +70,14 @@ func (o *OrderLineItem) GetProductVariantRef() *ProductVariantRef { return o.ProductVariantRef } -func (o *OrderLineItem) GetQuantity() *types.Decimal { +func (o *OrderLineItem) GetQuantity() *decimal.Big { if o == nil { return nil } return o.Quantity } -func (o *OrderLineItem) GetTaxPercentage() *types.Decimal { +func (o *OrderLineItem) GetTaxPercentage() *decimal.Big { if o == nil { return nil } @@ -79,21 +91,21 @@ func (o *OrderLineItem) GetTaxes() []TaxComponentAllocation { return o.Taxes } -func (o *OrderLineItem) GetTotalAmount() *types.Decimal { +func (o *OrderLineItem) GetTotalAmount() *decimal.Big { if o == nil { return nil } return o.TotalAmount } -func (o *OrderLineItem) GetTotalTaxAmount() *types.Decimal { +func (o *OrderLineItem) GetTotalTaxAmount() *decimal.Big { if o == nil { return nil } return o.TotalTaxAmount } -func (o *OrderLineItem) GetUnitPrice() *types.Decimal { +func (o *OrderLineItem) GetUnitPrice() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/payment.go b/lending/pkg/models/shared/payment.go index 840ca5348..346a44585 100755 --- a/lending/pkg/models/shared/payment.go +++ b/lending/pkg/models/shared/payment.go @@ -3,11 +3,12 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type Payment struct { - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` BankingTransactionRefs []BankingTransactionRef `json:"bankingTransactionRefs,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // @@ -42,7 +43,7 @@ type Payment struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -68,7 +69,18 @@ type Payment struct { PaymentType *string `json:"paymentType,omitempty"` } -func (o *Payment) GetAmount() *types.Decimal { +func (p Payment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *Payment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Payment) GetAmount() *decimal.Big { if o == nil { return nil } @@ -89,7 +101,7 @@ func (o *Payment) GetCurrency() *string { return o.Currency } -func (o *Payment) GetCurrencyRate() *types.Decimal { +func (o *Payment) GetCurrencyRate() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/paymentallocationpayment.go b/lending/pkg/models/shared/paymentallocationpayment.go index abd0f30df..190de4627 100755 --- a/lending/pkg/models/shared/paymentallocationpayment.go +++ b/lending/pkg/models/shared/paymentallocationpayment.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type PaymentAllocationPayment struct { @@ -42,7 +43,7 @@ type PaymentAllocationPayment struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Identifier of the allocated payment. ID *string `json:"id,omitempty"` // Notes attached to the allocated payment. @@ -70,7 +71,18 @@ type PaymentAllocationPayment struct { // Reference to the allocated payment. Reference *string `json:"reference,omitempty"` // Total amount that was paid. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` +} + +func (p PaymentAllocationPayment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentAllocationPayment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil } func (o *PaymentAllocationPayment) GetAccountRef() *AccountRef { @@ -87,7 +99,7 @@ func (o *PaymentAllocationPayment) GetCurrency() *string { return o.Currency } -func (o *PaymentAllocationPayment) GetCurrencyRate() *types.Decimal { +func (o *PaymentAllocationPayment) GetCurrencyRate() *decimal.Big { if o == nil { return nil } @@ -122,7 +134,7 @@ func (o *PaymentAllocationPayment) GetReference() *string { return o.Reference } -func (o *PaymentAllocationPayment) GetTotalAmount() *types.Decimal { +func (o *PaymentAllocationPayment) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/paymentline.go b/lending/pkg/models/shared/paymentline.go index f9f901b9b..160692d59 100755 --- a/lending/pkg/models/shared/paymentline.go +++ b/lending/pkg/models/shared/paymentline.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -29,10 +29,21 @@ type PaymentLine struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. AllocatedOnDate *string `json:"allocatedOnDate,omitempty"` // Amount in the payment currency. - Amount types.Decimal `json:"amount"` + Amount *decimal.Big `decimal:"number" json:"amount"` Links []PaymentLineLink `json:"links,omitempty"` } +func (p PaymentLine) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentLine) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + func (o *PaymentLine) GetAllocatedOnDate() *string { if o == nil { return nil @@ -40,9 +51,9 @@ func (o *PaymentLine) GetAllocatedOnDate() *string { return o.AllocatedOnDate } -func (o *PaymentLine) GetAmount() types.Decimal { +func (o *PaymentLine) GetAmount() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Amount } diff --git a/lending/pkg/models/shared/paymentlinelink.go b/lending/pkg/models/shared/paymentlinelink.go index 24390607b..96f38234a 100755 --- a/lending/pkg/models/shared/paymentlinelink.go +++ b/lending/pkg/models/shared/paymentlinelink.go @@ -3,14 +3,15 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type PaymentLineLink struct { // 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. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // 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. @@ -36,7 +37,7 @@ type PaymentLineLink struct { // | **GBP** | £20 | 1.277 | $25.54 | // | **EUR** | €20 | 1.134 | $22.68 | // | **RUB** | ₽20 | 0.015 | $0.30 | - CurrencyRate *types.Decimal `json:"currencyRate,omitempty"` + CurrencyRate *decimal.Big `decimal:"number" json:"currencyRate,omitempty"` // Unique identifier of the transaction represented by the link. ID *string `json:"id,omitempty"` // Types of payment line links, either: @@ -53,14 +54,25 @@ type PaymentLineLink struct { Type PaymentLinkType `json:"type"` } -func (o *PaymentLineLink) GetAmount() *types.Decimal { +func (p PaymentLineLink) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentLineLink) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentLineLink) GetAmount() *decimal.Big { if o == nil { return nil } return o.Amount } -func (o *PaymentLineLink) GetCurrencyRate() *types.Decimal { +func (o *PaymentLineLink) GetCurrencyRate() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/paymentref.go b/lending/pkg/models/shared/paymentref.go index 337722ab1..78516c46e 100755 --- a/lending/pkg/models/shared/paymentref.go +++ b/lending/pkg/models/shared/paymentref.go @@ -3,12 +3,13 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type PaymentRef struct { // Payment Amount (including gratuity). - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -69,7 +70,18 @@ type PaymentRef struct { Type *PaymentType `json:"type,omitempty"` } -func (o *PaymentRef) GetAmount() *types.Decimal { +func (p PaymentRef) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PaymentRef) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PaymentRef) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/productinventory.go b/lending/pkg/models/shared/productinventory.go index 5bb71a342..617d7891f 100755 --- a/lending/pkg/models/shared/productinventory.go +++ b/lending/pkg/models/shared/productinventory.go @@ -3,13 +3,25 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // ProductInventory - Information about the total inventory as well as the locations inventory is in. type ProductInventory struct { Locations []ProductInventoryLocation `json:"locations,omitempty"` - TotalQuantity *types.Decimal `json:"totalQuantity,omitempty"` + TotalQuantity *decimal.Big `decimal:"number" json:"totalQuantity,omitempty"` +} + +func (p ProductInventory) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProductInventory) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil } func (o *ProductInventory) GetLocations() []ProductInventoryLocation { @@ -19,7 +31,7 @@ func (o *ProductInventory) GetLocations() []ProductInventoryLocation { return o.Locations } -func (o *ProductInventory) GetTotalQuantity() *types.Decimal { +func (o *ProductInventory) GetTotalQuantity() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/productinventorylocation.go b/lending/pkg/models/shared/productinventorylocation.go index fff813d6d..9c4eb5d36 100755 --- a/lending/pkg/models/shared/productinventorylocation.go +++ b/lending/pkg/models/shared/productinventorylocation.go @@ -3,13 +3,25 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type ProductInventoryLocation struct { // Reference to the geographic location where the order was placed. - LocationRef *LocationRef `json:"locationRef,omitempty"` - Quantity *types.Decimal `json:"quantity,omitempty"` + LocationRef *LocationRef `json:"locationRef,omitempty"` + Quantity *decimal.Big `decimal:"number" json:"quantity,omitempty"` +} + +func (p ProductInventoryLocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProductInventoryLocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil } func (o *ProductInventoryLocation) GetLocationRef() *LocationRef { @@ -19,7 +31,7 @@ func (o *ProductInventoryLocation) GetLocationRef() *LocationRef { return o.LocationRef } -func (o *ProductInventoryLocation) GetQuantity() *types.Decimal { +func (o *ProductInventoryLocation) GetQuantity() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/productprice.go b/lending/pkg/models/shared/productprice.go index 41e8b10d0..53629b6d8 100755 --- a/lending/pkg/models/shared/productprice.go +++ b/lending/pkg/models/shared/productprice.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type ProductPrice struct { @@ -14,8 +15,19 @@ type ProductPrice struct { // In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. // // There are only a very small number of edge cases where this currency code is returned by the Codat system. - Currency *string `json:"currency,omitempty"` - UnitPrice *types.Decimal `json:"unitPrice,omitempty"` + Currency *string `json:"currency,omitempty"` + UnitPrice *decimal.Big `decimal:"number" json:"unitPrice,omitempty"` +} + +func (p ProductPrice) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProductPrice) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil } func (o *ProductPrice) GetCurrency() *string { @@ -25,7 +37,7 @@ func (o *ProductPrice) GetCurrency() *string { return o.Currency } -func (o *ProductPrice) GetUnitPrice() *types.Decimal { +func (o *ProductPrice) GetUnitPrice() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/productvariant.go b/lending/pkg/models/shared/productvariant.go index 712641bea..73b3e7b89 100755 --- a/lending/pkg/models/shared/productvariant.go +++ b/lending/pkg/models/shared/productvariant.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // 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. @@ -50,7 +51,18 @@ type ProductVariant struct { // Unit of measure for the variant, such as `kg` or `meters`. UnitOfMeasure *string `json:"unitOfMeasure,omitempty"` // VAT rate for the product variant if sales taxes are enabled. - VatPercentage *types.Decimal `json:"vatPercentage,omitempty"` + VatPercentage *decimal.Big `decimal:"number" json:"vatPercentage,omitempty"` +} + +func (p ProductVariant) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProductVariant) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil } func (o *ProductVariant) GetBarcode() *string { @@ -144,7 +156,7 @@ func (o *ProductVariant) GetUnitOfMeasure() *string { return o.UnitOfMeasure } -func (o *ProductVariant) GetVatPercentage() *types.Decimal { +func (o *ProductVariant) GetVatPercentage() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/profitandlossreport.go b/lending/pkg/models/shared/profitandlossreport.go index 3a93ea24a..d7182cf6d 100755 --- a/lending/pkg/models/shared/profitandlossreport.go +++ b/lending/pkg/models/shared/profitandlossreport.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -31,16 +31,16 @@ type ProfitAndLossReport struct { // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. FromDate *string `json:"fromDate,omitempty"` // Gross profit of the company in the given date range. - GrossProfit types.Decimal `json:"grossProfit"` - Income *ReportLine `json:"income,omitempty"` + GrossProfit *decimal.Big `decimal:"number" json:"grossProfit"` + Income *ReportLine `json:"income,omitempty"` // Net operating profit of the company in the given date range. - NetOperatingProfit types.Decimal `json:"netOperatingProfit"` + NetOperatingProfit *decimal.Big `decimal:"number" json:"netOperatingProfit"` // Net other income of the company in the given date range. - NetOtherIncome types.Decimal `json:"netOtherIncome"` + NetOtherIncome *decimal.Big `decimal:"number" json:"netOtherIncome"` // Net profit of the company in the given date range. - NetProfit types.Decimal `json:"netProfit"` - OtherExpenses *ReportLine `json:"otherExpenses,omitempty"` - OtherIncome *ReportLine `json:"otherIncome,omitempty"` + NetProfit *decimal.Big `decimal:"number" json:"netProfit"` + OtherExpenses *ReportLine `json:"otherExpenses,omitempty"` + OtherIncome *ReportLine `json:"otherIncome,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -63,6 +63,17 @@ type ProfitAndLossReport struct { ToDate *string `json:"toDate,omitempty"` } +func (p ProfitAndLossReport) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProfitAndLossReport) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + func (o *ProfitAndLossReport) GetCostOfSales() *ReportLine { if o == nil { return nil @@ -84,9 +95,9 @@ func (o *ProfitAndLossReport) GetFromDate() *string { return o.FromDate } -func (o *ProfitAndLossReport) GetGrossProfit() types.Decimal { +func (o *ProfitAndLossReport) GetGrossProfit() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.GrossProfit } @@ -98,23 +109,23 @@ func (o *ProfitAndLossReport) GetIncome() *ReportLine { return o.Income } -func (o *ProfitAndLossReport) GetNetOperatingProfit() types.Decimal { +func (o *ProfitAndLossReport) GetNetOperatingProfit() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.NetOperatingProfit } -func (o *ProfitAndLossReport) GetNetOtherIncome() types.Decimal { +func (o *ProfitAndLossReport) GetNetOtherIncome() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.NetOtherIncome } -func (o *ProfitAndLossReport) GetNetProfit() types.Decimal { +func (o *ProfitAndLossReport) GetNetProfit() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.NetProfit } diff --git a/lending/pkg/models/shared/pushchangetype.go b/lending/pkg/models/shared/pushchangetype.go new file mode 100755 index 000000000..b1533a4bc --- /dev/null +++ b/lending/pkg/models/shared/pushchangetype.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type PushChangeType string + +const ( + PushChangeTypeUnknown PushChangeType = "Unknown" + PushChangeTypeCreated PushChangeType = "Created" + PushChangeTypeModified PushChangeType = "Modified" + PushChangeTypeDeleted PushChangeType = "Deleted" + PushChangeTypeAttachmentUploaded PushChangeType = "AttachmentUploaded" +) + +func (e PushChangeType) ToPointer() *PushChangeType { + return &e +} + +func (e *PushChangeType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Unknown": + fallthrough + case "Created": + fallthrough + case "Modified": + fallthrough + case "Deleted": + fallthrough + case "AttachmentUploaded": + *e = PushChangeType(v) + return nil + default: + return fmt.Errorf("invalid value for PushChangeType: %v", v) + } +} diff --git a/lending/pkg/models/shared/pushfieldvalidation.go b/lending/pkg/models/shared/pushfieldvalidation.go new file mode 100755 index 000000000..7d50e632c --- /dev/null +++ b/lending/pkg/models/shared/pushfieldvalidation.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushFieldValidation struct { + Details string `json:"details"` + Field *string `json:"field,omitempty"` + Ref *string `json:"ref,omitempty"` +} + +func (o *PushFieldValidation) GetDetails() string { + if o == nil { + return "" + } + return o.Details +} + +func (o *PushFieldValidation) GetField() *string { + if o == nil { + return nil + } + return o.Field +} + +func (o *PushFieldValidation) GetRef() *string { + if o == nil { + return nil + } + return o.Ref +} diff --git a/lending/pkg/models/shared/pushoperation.go b/lending/pkg/models/shared/pushoperation.go new file mode 100755 index 000000000..64ce89d4c --- /dev/null +++ b/lending/pkg/models/shared/pushoperation.go @@ -0,0 +1,156 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOperation struct { + // Contains a single entry that communicates which record has changed and the manner in which it changed. + Changes []PushOperationChange `json:"changes,omitempty"` + // Unique identifier for your SMB in Codat. + CompanyID string `json:"companyId"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + CompletedOnUtc *string `json:"completedOnUtc,omitempty"` + // Unique identifier for a company's data connection. + DataConnectionKey string `json:"dataConnectionKey"` + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + // 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. + PushOperationKey string `json:"pushOperationKey"` + // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + // + // ``` + // 2020-10-08T22:40:50Z + // 2021-01-01T00:00:00 + // ``` + // + // + // + // When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + // + // - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + // - Unqualified local time: `2021-11-15T01:00:00` + // - UTC time offsets: `2021-11-15T01:00:00-05:00` + // + // > Time zones + // > + // > Not all dates from Codat will contain information about time zones. + // > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + RequestedOnUtc string `json:"requestedOnUtc"` + // The current status of the push operation. + Status PushOperationStatus `json:"status"` + StatusCode int64 `json:"statusCode"` + TimeoutInMinutes *int `json:"timeoutInMinutes,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"` + // 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. + Validation *Validation `json:"validation,omitempty"` +} + +func (o *PushOperation) GetChanges() []PushOperationChange { + if o == nil { + return nil + } + return o.Changes +} + +func (o *PushOperation) GetCompanyID() string { + if o == nil { + return "" + } + return o.CompanyID +} + +func (o *PushOperation) GetCompletedOnUtc() *string { + if o == nil { + return nil + } + return o.CompletedOnUtc +} + +func (o *PushOperation) GetDataConnectionKey() string { + if o == nil { + return "" + } + return o.DataConnectionKey +} + +func (o *PushOperation) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *PushOperation) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *PushOperation) GetPushOperationKey() string { + if o == nil { + return "" + } + return o.PushOperationKey +} + +func (o *PushOperation) GetRequestedOnUtc() string { + if o == nil { + return "" + } + return o.RequestedOnUtc +} + +func (o *PushOperation) GetStatus() PushOperationStatus { + if o == nil { + return PushOperationStatus("") + } + return o.Status +} + +func (o *PushOperation) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *PushOperation) GetTimeoutInMinutes() *int { + if o == nil { + return nil + } + return o.TimeoutInMinutes +} + +func (o *PushOperation) GetTimeoutInSeconds() *int { + if o == nil { + return nil + } + return o.TimeoutInSeconds +} + +func (o *PushOperation) GetValidation() *Validation { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/pushoperationchange.go b/lending/pkg/models/shared/pushoperationchange.go new file mode 100755 index 000000000..c916f0fcb --- /dev/null +++ b/lending/pkg/models/shared/pushoperationchange.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOperationChange struct { + AttachmentID *string `json:"attachmentId,omitempty"` + RecordRef *PushOperationRef `json:"recordRef,omitempty"` + Type *PushChangeType `json:"type,omitempty"` +} + +func (o *PushOperationChange) GetAttachmentID() *string { + if o == nil { + return nil + } + return o.AttachmentID +} + +func (o *PushOperationChange) GetRecordRef() *PushOperationRef { + if o == nil { + return nil + } + return o.RecordRef +} + +func (o *PushOperationChange) GetType() *PushChangeType { + if o == nil { + return nil + } + return o.Type +} diff --git a/lending/pkg/models/shared/pushoperationref.go b/lending/pkg/models/shared/pushoperationref.go new file mode 100755 index 000000000..65665047a --- /dev/null +++ b/lending/pkg/models/shared/pushoperationref.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOperationRef struct { + // Available Data types + DataType *DataType `json:"dataType,omitempty"` + ID *string `json:"id,omitempty"` +} + +func (o *PushOperationRef) GetDataType() *DataType { + if o == nil { + return nil + } + return o.DataType +} + +func (o *PushOperationRef) GetID() *string { + if o == nil { + return nil + } + return o.ID +} diff --git a/lending/pkg/models/shared/pushoperations.go b/lending/pkg/models/shared/pushoperations.go new file mode 100755 index 000000000..ab7c06fd7 --- /dev/null +++ b/lending/pkg/models/shared/pushoperations.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOperations struct { + Links Links `json:"_links"` + PageNumber int64 `json:"pageNumber"` + PageSize int64 `json:"pageSize"` + Results []PushOperation `json:"results,omitempty"` + TotalResults int64 `json:"totalResults"` +} + +func (o *PushOperations) GetLinks() Links { + if o == nil { + return Links{} + } + return o.Links +} + +func (o *PushOperations) GetPageNumber() int64 { + if o == nil { + return 0 + } + return o.PageNumber +} + +func (o *PushOperations) GetPageSize() int64 { + if o == nil { + return 0 + } + return o.PageSize +} + +func (o *PushOperations) GetResults() []PushOperation { + if o == nil { + return nil + } + return o.Results +} + +func (o *PushOperations) GetTotalResults() int64 { + if o == nil { + return 0 + } + return o.TotalResults +} diff --git a/lending/pkg/models/shared/pushoperationstatus.go b/lending/pkg/models/shared/pushoperationstatus.go new file mode 100755 index 000000000..a795bac79 --- /dev/null +++ b/lending/pkg/models/shared/pushoperationstatus.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +// PushOperationStatus - The current status of the push operation. +type PushOperationStatus string + +const ( + PushOperationStatusPending PushOperationStatus = "Pending" + PushOperationStatusFailed PushOperationStatus = "Failed" + PushOperationStatusSuccess PushOperationStatus = "Success" + PushOperationStatusTimedOut PushOperationStatus = "TimedOut" +) + +func (e PushOperationStatus) ToPointer() *PushOperationStatus { + return &e +} + +func (e *PushOperationStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Pending": + fallthrough + case "Failed": + fallthrough + case "Success": + fallthrough + case "TimedOut": + *e = PushOperationStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PushOperationStatus: %v", v) + } +} diff --git a/lending/pkg/models/shared/pushoption.go b/lending/pkg/models/shared/pushoption.go new file mode 100755 index 000000000..72baa31f5 --- /dev/null +++ b/lending/pkg/models/shared/pushoption.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOption struct { + Description *string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + Options []PushOptionChoice `json:"options,omitempty"` + Properties map[string]PushOptionProperty `json:"properties,omitempty"` + Required bool `json:"required"` + Type PushOptionType `json:"type"` + Validation *PushValidationInfo `json:"validation,omitempty"` +} + +func (o *PushOption) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *PushOption) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PushOption) GetOptions() []PushOptionChoice { + if o == nil { + return nil + } + return o.Options +} + +func (o *PushOption) GetProperties() map[string]PushOptionProperty { + if o == nil { + return nil + } + return o.Properties +} + +func (o *PushOption) GetRequired() bool { + if o == nil { + return false + } + return o.Required +} + +func (o *PushOption) GetType() PushOptionType { + if o == nil { + return PushOptionType("") + } + return o.Type +} + +func (o *PushOption) GetValidation() *PushValidationInfo { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/pushoptionchoice.go b/lending/pkg/models/shared/pushoptionchoice.go new file mode 100755 index 000000000..9febc35b0 --- /dev/null +++ b/lending/pkg/models/shared/pushoptionchoice.go @@ -0,0 +1,47 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOptionChoice struct { + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Required *bool `json:"required,omitempty"` + Type *PushOptionType `json:"type,omitempty"` + // Allowed value for field. + Value *string `json:"value,omitempty"` +} + +func (o *PushOptionChoice) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *PushOptionChoice) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *PushOptionChoice) GetRequired() *bool { + if o == nil { + return nil + } + return o.Required +} + +func (o *PushOptionChoice) GetType() *PushOptionType { + if o == nil { + return nil + } + return o.Type +} + +func (o *PushOptionChoice) GetValue() *string { + if o == nil { + return nil + } + return o.Value +} diff --git a/lending/pkg/models/shared/pushoptionproperty.go b/lending/pkg/models/shared/pushoptionproperty.go new file mode 100755 index 000000000..ebc535201 --- /dev/null +++ b/lending/pkg/models/shared/pushoptionproperty.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushOptionProperty struct { + Description string `json:"description"` + DisplayName string `json:"displayName"` + Options []PushOptionChoice `json:"options,omitempty"` + Properties map[string]PushOptionProperty `json:"properties,omitempty"` + Required bool `json:"required"` + Type PushOptionType `json:"type"` + Validation *PushValidationInfo `json:"validation,omitempty"` +} + +func (o *PushOptionProperty) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *PushOptionProperty) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PushOptionProperty) GetOptions() []PushOptionChoice { + if o == nil { + return nil + } + return o.Options +} + +func (o *PushOptionProperty) GetProperties() map[string]PushOptionProperty { + if o == nil { + return nil + } + return o.Properties +} + +func (o *PushOptionProperty) GetRequired() bool { + if o == nil { + return false + } + return o.Required +} + +func (o *PushOptionProperty) GetType() PushOptionType { + if o == nil { + return PushOptionType("") + } + return o.Type +} + +func (o *PushOptionProperty) GetValidation() *PushValidationInfo { + if o == nil { + return nil + } + return o.Validation +} diff --git a/lending/pkg/models/shared/pushoptiontype.go b/lending/pkg/models/shared/pushoptiontype.go new file mode 100755 index 000000000..e53f549df --- /dev/null +++ b/lending/pkg/models/shared/pushoptiontype.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +import ( + "encoding/json" + "fmt" +) + +type PushOptionType string + +const ( + PushOptionTypeArray PushOptionType = "Array" + PushOptionTypeObject PushOptionType = "Object" + PushOptionTypeString PushOptionType = "String" + PushOptionTypeNumber PushOptionType = "Number" + PushOptionTypeBoolean PushOptionType = "Boolean" + PushOptionTypeDateTime PushOptionType = "DateTime" + PushOptionTypeFile PushOptionType = "File" + PushOptionTypeMultiPart PushOptionType = "MultiPart" +) + +func (e PushOptionType) ToPointer() *PushOptionType { + return &e +} + +func (e *PushOptionType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "Array": + fallthrough + case "Object": + fallthrough + case "String": + fallthrough + case "Number": + fallthrough + case "Boolean": + fallthrough + case "DateTime": + fallthrough + case "File": + fallthrough + case "MultiPart": + *e = PushOptionType(v) + return nil + default: + return fmt.Errorf("invalid value for PushOptionType: %v", v) + } +} diff --git a/lending/pkg/models/shared/pushvalidationinfo.go b/lending/pkg/models/shared/pushvalidationinfo.go new file mode 100755 index 000000000..eb5756f08 --- /dev/null +++ b/lending/pkg/models/shared/pushvalidationinfo.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type PushValidationInfo struct { + Information []PushFieldValidation `json:"information,omitempty"` + Warnings []PushFieldValidation `json:"warnings,omitempty"` +} + +func (o *PushValidationInfo) GetInformation() []PushFieldValidation { + if o == nil { + return nil + } + return o.Information +} + +func (o *PushValidationInfo) GetWarnings() []PushFieldValidation { + if o == nil { + return nil + } + return o.Warnings +} diff --git a/lending/pkg/models/shared/reportcomponentmeasure.go b/lending/pkg/models/shared/reportcomponentmeasure.go index 1b84b6e08..de26d5a7d 100755 --- a/lending/pkg/models/shared/reportcomponentmeasure.go +++ b/lending/pkg/models/shared/reportcomponentmeasure.go @@ -3,13 +3,25 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type ReportComponentMeasure struct { - Index *int64 `json:"index,omitempty"` - MeasureDisplayName *string `json:"measureDisplayName,omitempty"` - Value *types.Decimal `json:"value,omitempty"` + Index *int64 `json:"index,omitempty"` + MeasureDisplayName *string `json:"measureDisplayName,omitempty"` + Value *decimal.Big `decimal:"number" json:"value,omitempty"` +} + +func (r ReportComponentMeasure) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportComponentMeasure) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil } func (o *ReportComponentMeasure) GetIndex() *int64 { @@ -26,7 +38,7 @@ func (o *ReportComponentMeasure) GetMeasureDisplayName() *string { return o.MeasureDisplayName } -func (o *ReportComponentMeasure) GetValue() *types.Decimal { +func (o *ReportComponentMeasure) GetValue() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/reportitems.go b/lending/pkg/models/shared/reportitems.go index 698111094..b157be433 100755 --- a/lending/pkg/models/shared/reportitems.go +++ b/lending/pkg/models/shared/reportitems.go @@ -5,7 +5,8 @@ package shared import ( "encoding/json" "fmt" - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type ReportItemsLoanTransactionType string @@ -43,7 +44,7 @@ func (e *ReportItemsLoanTransactionType) UnmarshalJSON(data []byte) error { type ReportItems struct { // The loan transaction amount. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: // // ``` @@ -69,7 +70,18 @@ type ReportItems struct { LoanTransactionType *ReportItemsLoanTransactionType `json:"loanTransactionType,omitempty"` } -func (o *ReportItems) GetAmount() *types.Decimal { +func (r ReportItems) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportItems) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ReportItems) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/reportline.go b/lending/pkg/models/shared/reportline.go index 9ae4bd183..6d4b26675 100755 --- a/lending/pkg/models/shared/reportline.go +++ b/lending/pkg/models/shared/reportline.go @@ -3,7 +3,7 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" "github.com/ericlagergren/decimal" ) @@ -15,7 +15,18 @@ type ReportLine struct { // Name of the report line item. Name *string `json:"name,omitempty"` // Numerical value of the line item. - Value types.Decimal `json:"value"` + Value *decimal.Big `decimal:"number" json:"value"` +} + +func (r ReportLine) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *ReportLine) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { + return err + } + return nil } func (o *ReportLine) GetAccountID() *string { @@ -39,9 +50,9 @@ func (o *ReportLine) GetName() *string { return o.Name } -func (o *ReportLine) GetValue() types.Decimal { +func (o *ReportLine) GetValue() *decimal.Big { if o == nil { - return types.Decimal{Big: *(new(decimal.Big).SetFloat64(0.0))} + return new(decimal.Big).SetFloat64(0.0) } return o.Value } diff --git a/lending/pkg/models/shared/servicecharge.go b/lending/pkg/models/shared/servicecharge.go index 39d935e18..b89d344b4 100755 --- a/lending/pkg/models/shared/servicecharge.go +++ b/lending/pkg/models/shared/servicecharge.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type ServiceCharge struct { @@ -12,17 +13,28 @@ type ServiceCharge struct { // The number of times the charge is charged. Quantity *int64 `json:"quantity,omitempty"` // Amount of the service charge that is tax. - TaxAmount *types.Decimal `json:"taxAmount,omitempty"` + TaxAmount *decimal.Big `decimal:"number" json:"taxAmount,omitempty"` // Percentage rate (from 0 to 100) of any tax applied to the service charge. - TaxPercentage *types.Decimal `json:"taxPercentage,omitempty"` + TaxPercentage *decimal.Big `decimal:"number" json:"taxPercentage,omitempty"` // Taxes breakdown as applied to service charges. Taxes []TaxComponentAllocation `json:"taxes,omitempty"` // Total service charge, including taxes. - TotalAmount *types.Decimal `json:"totalAmount,omitempty"` + TotalAmount *decimal.Big `decimal:"number" json:"totalAmount,omitempty"` // The type of the service charge. Type *ServiceChargeType `json:"type,omitempty"` } +func (s ServiceCharge) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ServiceCharge) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { + return err + } + return nil +} + func (o *ServiceCharge) GetDescription() *string { if o == nil { return nil @@ -37,14 +49,14 @@ func (o *ServiceCharge) GetQuantity() *int64 { return o.Quantity } -func (o *ServiceCharge) GetTaxAmount() *types.Decimal { +func (o *ServiceCharge) GetTaxAmount() *decimal.Big { if o == nil { return nil } return o.TaxAmount } -func (o *ServiceCharge) GetTaxPercentage() *types.Decimal { +func (o *ServiceCharge) GetTaxPercentage() *decimal.Big { if o == nil { return nil } @@ -58,7 +70,7 @@ func (o *ServiceCharge) GetTaxes() []TaxComponentAllocation { return o.Taxes } -func (o *ServiceCharge) GetTotalAmount() *types.Decimal { +func (o *ServiceCharge) GetTotalAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/taxcomponentallocation.go b/lending/pkg/models/shared/taxcomponentallocation.go index e96d61ad6..c66b58642 100755 --- a/lending/pkg/models/shared/taxcomponentallocation.go +++ b/lending/pkg/models/shared/taxcomponentallocation.go @@ -3,17 +3,29 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type TaxComponentAllocation struct { // Tax amount on order line sale as available from source commerce platform. - Rate *types.Decimal `json:"rate,omitempty"` + Rate *decimal.Big `decimal:"number" json:"rate,omitempty"` // Taxes rates reference object depending on the rates being available on source commerce package. TaxComponentRef *TaxComponentRef `json:"taxComponentRef,omitempty"` } -func (o *TaxComponentAllocation) GetRate() *types.Decimal { +func (t TaxComponentAllocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaxComponentAllocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TaxComponentAllocation) GetRate() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/taxrateref.go b/lending/pkg/models/shared/taxrateref.go index 6efb2fe79..01eb223f0 100755 --- a/lending/pkg/models/shared/taxrateref.go +++ b/lending/pkg/models/shared/taxrateref.go @@ -3,7 +3,8 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) // 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. @@ -18,14 +19,25 @@ import ( // - Items type TaxRateRef struct { // Applicable tax rate. - EffectiveTaxRate *types.Decimal `json:"effectiveTaxRate,omitempty"` + EffectiveTaxRate *decimal.Big `decimal:"number" json:"effectiveTaxRate,omitempty"` // Unique identifier for the tax rate in the accounting platform. ID *string `json:"id,omitempty"` // Name of the tax rate in the accounting platform. Name *string `json:"name,omitempty"` } -func (o *TaxRateRef) GetEffectiveTaxRate() *types.Decimal { +func (t TaxRateRef) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaxRateRef) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TaxRateRef) GetEffectiveTaxRate() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/transactioncategory.go b/lending/pkg/models/shared/transactioncategory.go index 63b41788b..13aa08512 100755 --- a/lending/pkg/models/shared/transactioncategory.go +++ b/lending/pkg/models/shared/transactioncategory.go @@ -3,17 +3,29 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type TransactionCategory struct { // Returns the confidence of the suggested category for the transaction. The value is between 0 and 100. - Confidence *types.Decimal `json:"confidence,omitempty"` + Confidence *decimal.Big `decimal:"number" json:"confidence,omitempty"` // The suggested category is an ordered array of category levels where each element (or level) is a subcategory of the previous element (or level). Levels []string `json:"levels,omitempty"` } -func (o *TransactionCategory) GetConfidence() *types.Decimal { +func (t TransactionCategory) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TransactionCategory) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + +func (o *TransactionCategory) GetConfidence() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/transferaccount.go b/lending/pkg/models/shared/transferaccount.go index b82567082..d2e28a0b0 100755 --- a/lending/pkg/models/shared/transferaccount.go +++ b/lending/pkg/models/shared/transferaccount.go @@ -3,14 +3,15 @@ package shared import ( - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + "github.com/codatio/client-sdk-go/lending/v4/pkg/utils" + "github.com/ericlagergren/decimal" ) type TransferAccount struct { // 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. AccountRef *AccountRef `json:"accountRef,omitempty"` // The amount transferred between accounts. - Amount *types.Decimal `json:"amount,omitempty"` + Amount *decimal.Big `decimal:"number" json:"amount,omitempty"` // The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. // // ## Unknown currencies @@ -21,6 +22,17 @@ type TransferAccount struct { Currency *string `json:"currency,omitempty"` } +func (t TransferAccount) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TransferAccount) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { + return err + } + return nil +} + func (o *TransferAccount) GetAccountRef() *AccountRef { if o == nil { return nil @@ -28,7 +40,7 @@ func (o *TransferAccount) GetAccountRef() *AccountRef { return o.AccountRef } -func (o *TransferAccount) GetAmount() *types.Decimal { +func (o *TransferAccount) GetAmount() *decimal.Big { if o == nil { return nil } diff --git a/lending/pkg/models/shared/validation.go b/lending/pkg/models/shared/validation.go new file mode 100755 index 000000000..bb4ce0816 --- /dev/null +++ b/lending/pkg/models/shared/validation.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +// 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. +type Validation struct { + Errors []ValidationItem `json:"errors,omitempty"` + Warnings []ValidationItem `json:"warnings,omitempty"` +} + +func (o *Validation) GetErrors() []ValidationItem { + if o == nil { + return nil + } + return o.Errors +} + +func (o *Validation) GetWarnings() []ValidationItem { + if o == nil { + return nil + } + return o.Warnings +} diff --git a/lending/pkg/models/shared/validationitem.go b/lending/pkg/models/shared/validationitem.go new file mode 100755 index 000000000..a4ffc4610 --- /dev/null +++ b/lending/pkg/models/shared/validationitem.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package shared + +type ValidationItem struct { + ItemID *string `json:"itemId,omitempty"` + Message *string `json:"message,omitempty"` + ValidatorName *string `json:"validatorName,omitempty"` +} + +func (o *ValidationItem) GetItemID() *string { + if o == nil { + return nil + } + return o.ItemID +} + +func (o *ValidationItem) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *ValidationItem) GetValidatorName() *string { + if o == nil { + return nil + } + return o.ValidatorName +} diff --git a/lending/pkg/types/bigint.go b/lending/pkg/types/bigint.go index 77382b2a7..afd0cd2b8 100755 --- a/lending/pkg/types/bigint.go +++ b/lending/pkg/types/bigint.go @@ -7,81 +7,14 @@ import ( "math/big" ) -// BigInt is a wrapper around big.Int that allows for JSON marshaling a big integer as a string. -type BigInt struct { - big.Int -} - -func (b BigInt) MarshalJSON() ([]byte, error) { - return []byte(`"` + b.String() + `"`), nil -} - -func (b *BigInt) UnmarshalJSON(p []byte) error { - if string(p) == "null" { - return nil - } - - stringVal := string(p) - if len(stringVal) > 2 && stringVal[0] == '"' && stringVal[len(stringVal)-1] == '"' { - stringVal = stringVal[1 : len(stringVal)-1] - } - - var z big.Int - _, ok := z.SetString(string(stringVal), 10) - if !ok { - return fmt.Errorf("not a valid big integer: %s", p) - } - b.Int = z - return nil -} - -// BigIntFromString returns a BigInt from a string -// The string is assumed to be base 10 and if it is not a valid big.Int -// then the function will return an error -func BigIntFromString(s string) (BigInt, error) { - i, ok := new(big.Int).SetString(s, 10) - if !ok { - return BigInt{}, fmt.Errorf("failed to parse string as bigint") - } - - return BigInt{ - Int: *i, - }, nil -} - -// NewBigIntFromString returns an instance of BigInt from a string -// The string is assumed to be base 10 and if it is not a valid big.Int -// then the function will return an error -func NewBigIntFromString(s string) (*BigInt, error) { - i, err := BigIntFromString(s) - if err != nil { - return nil, err - } - - return &i, nil -} - -// MustNewBigIntFromString returns an instance of BigInt from a string +// MustNewBigIntFromString returns an instance of big.Int from a string // The string is assumed to be base 10 and if it is not a valid big.Int // then the function panics. // Avoid using this function in production code. -func MustNewBigIntFromString(s string) *BigInt { - i, err := NewBigIntFromString(s) - if err != nil { - panic(err) - } - - return i -} - -// MustBigIntFromString returns an instance of BigInt from a string -// The string is assumed to be base 10 and if it is not a valid big.Int -// then the function panics. -// Avoid using this function in production code. -func MustBigIntFromString(s string) BigInt { - i, err := BigIntFromString(s) - if err != nil { - panic(err) +func MustNewBigIntFromString(s string) *big.Int { + i, ok := new(big.Int).SetString(s, 10) + if !ok { + panic(fmt.Errorf("failed to parse string as big.Int")) } return i diff --git a/lending/pkg/types/date.go b/lending/pkg/types/date.go index 01c69b7ac..c4648fa96 100755 --- a/lending/pkg/types/date.go +++ b/lending/pkg/types/date.go @@ -67,6 +67,10 @@ func MustDateFromString(str string) Date { return d } +func (d Date) GetTime() time.Time { + return d.Time +} + func (d Date) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil } diff --git a/lending/pkg/types/decimal.go b/lending/pkg/types/decimal.go index 58cfbee3c..a42284b92 100755 --- a/lending/pkg/types/decimal.go +++ b/lending/pkg/types/decimal.go @@ -8,68 +8,12 @@ import ( "github.com/ericlagergren/decimal" ) -// Decimal is a wrapper around decimal.Big that allows for JSON marshaling a decimal as a JSON number. -type Decimal struct { - decimal.Big -} - -func (d Decimal) MarshalJSON() ([]byte, error) { - return []byte(d.String()), nil -} - -func (d *Decimal) UnmarshalJSON(p []byte) error { - if string(p) == "null" { - return nil - } - - var z decimal.Big - _, ok := z.SetString(string(p)) - if !ok { - return fmt.Errorf("not a valid decimal: %s", p) - } - d.Big = z - return nil -} - -// DecimalFromString returns a Decimal from a string -func DecimalFromString(s string) (Decimal, error) { - d, ok := new(decimal.Big).SetString(s) - if !ok { - return Decimal{}, fmt.Errorf("failed to parse string as decimal") - } - - return Decimal{ - Big: *d, - }, nil -} - -// NewDecimalFromString returns an instance of Decimal from a string -func NewDecimalFromString(s string) (*Decimal, error) { - d, err := DecimalFromString(s) - if err != nil { - return nil, err - } - - return &d, nil -} - // MustNewDecimalFromString returns an instance of Decimal from a string // Avoid using this function in production code. -func MustNewDecimalFromString(s string) *Decimal { - d, err := NewDecimalFromString(s) - if err != nil { - panic(err) - } - - return d -} - -// MustDecimalFromString returns an instance of Decimal from a string -// Avoid using this function in production code. -func MustDecimalFromString(s string) Decimal { - d, err := DecimalFromString(s) - if err != nil { - panic(err) +func MustNewDecimalFromString(s string) *decimal.Big { + d, ok := new(decimal.Big).SetString(s) + if !ok { + panic(fmt.Errorf("failed to parse string as decimal.Big")) } return d diff --git a/lending/pkg/utils/form.go b/lending/pkg/utils/form.go index ce0f1a3e4..48b5ff035 100755 --- a/lending/pkg/utils/form.go +++ b/lending/pkg/utils/form.go @@ -35,12 +35,8 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue formValues.Add(paramName, valToString(objValue.Interface())) case types.Date: formValues.Add(paramName, valToString(objValue.Interface())) - case types.BigInt: - formValues.Add(paramName, valToString(objValue.Interface())) case big.Int: formValues.Add(paramName, valToString(objValue.Interface())) - case types.Decimal: - formValues.Add(paramName, valToString(objValue.Interface())) case decimal.Big: formValues.Add(paramName, valToString(objValue.Interface())) default: diff --git a/lending/pkg/utils/json.go b/lending/pkg/utils/json.go new file mode 100755 index 000000000..0ff126839 --- /dev/null +++ b/lending/pkg/utils/json.go @@ -0,0 +1,573 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "bytes" + "encoding/json" + "fmt" + "math/big" + "reflect" + "strings" + "time" + "unsafe" + + "github.com/codatio/client-sdk-go/lending/v4/pkg/types" + + "github.com/ericlagergren/decimal" +) + +func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel { + return json.Marshal(v) + } + + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + omitEmpty := false + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag == "omitempty" { + omitEmpty = true + } else { + fieldName = tag + } + } + } + + if isNil(field.Type, fieldVal) { + if omitEmpty { + continue + } + } + + if !field.IsExported() && field.Tag.Get("const") == "" { + continue + } + + additionalProperties := field.Tag.Get("additionalProperties") + if fieldName == "-" && additionalProperties == "" { + continue + } + + if additionalProperties == "true" { + if field.Type.Kind() != reflect.Map { + return nil, fmt.Errorf("additionalProperties must be a map") + } + + for _, key := range fieldVal.MapKeys() { + r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + continue + } + + var fv interface{} + + if field.IsExported() { + fv = fieldVal.Interface() + } else { + pt := reflect.New(typ).Elem() + pt.Set(val) + + pf := pt.Field(i) + + fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() + } + + r, err := marshalValue(fv, field.Tag) + if err != nil { + return nil, err + } + + out[fieldName] = r + } + + return json.Marshal(out) + default: + return marshalValue(v, tag) + } +} + +func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { + if reflect.TypeOf(v).Kind() != reflect.Ptr { + return fmt.Errorf("v must be a pointer") + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel || bytes.Equal(b, []byte("null")) { + d := json.NewDecoder(bytes.NewReader(b)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(v) + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(b, &unmarhsaled); err != nil { + return err + } + + var additionalPropertiesField *reflect.StructField + var additionalPropertiesValue *reflect.Value + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag != "omitempty" { + fieldName = tag + } + } + } + + if field.Tag.Get("additionalProperties") == "true" { + additionalPropertiesField = &field + additionalPropertiesValue = &fieldVal + continue + } + + // If we receive a value for a const field ignore it but mark it as unmarshaled + if field.Tag.Get("const") != "" { + if r, ok := unmarhsaled[fieldName]; ok { + val := string(r) + if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { + val = val[1 : len(val)-1] + } + if val != field.Tag.Get("const") { + return fmt.Errorf("const field %s does not match expected value %s", fieldName, field.Tag.Get("const")) + } + + delete(unmarhsaled, fieldName) + } + } else if !field.IsExported() { + continue + } + + value, ok := unmarhsaled[fieldName] + if !ok { + defaultTag := field.Tag.Get("default") + if defaultTag != "" { + value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) + ok = true + } + } else { + delete(unmarhsaled, fieldName) + } + + if ok { + if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { + return err + } + } + } + + keys := make([]string, 0, len(unmarhsaled)) + for k := range unmarhsaled { + keys = append(keys, k) + } + + if len(keys) > 0 { + if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { + return fmt.Errorf("unknown fields: %v", keys) + } + + if additionalPropertiesField != nil && additionalPropertiesValue != nil { + if additionalPropertiesValue.Kind() != reflect.Map { + return fmt.Errorf("additionalProperties must be a map") + } + + additionalPropertiesValue.Set(reflect.MakeMap(additionalPropertiesField.Type)) + + for key, value := range unmarhsaled { + val := reflect.New(additionalPropertiesField.Type.Elem()) + + if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { + return err + } + + additionalPropertiesValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) + } + } + } + default: + return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) + } + + return nil +} + +func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { + constTag := tag.Get("const") + if constTag != "" { + return handleDefaultConstValue(constTag, v, tag), nil + } + + if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { + defaultTag := tag.Get("default") + if defaultTag != "" { + return handleDefaultConstValue(defaultTag, v, tag), nil + } + + return []byte("null"), nil + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + switch typ.Kind() { + case reflect.Map: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for _, key := range val.MapKeys() { + itemVal := val.MapIndex(key) + + if isNil(itemVal.Type(), itemVal) { + out[key.String()] = []byte("null") + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + return json.Marshal(out) + case reflect.Slice, reflect.Array: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := []json.RawMessage{} + + for i := 0; i < val.Len(); i++ { + itemVal := val.Index(i) + + if isNil(itemVal.Type(), itemVal) { + out = append(out, []byte("null")) + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out = append(out, r) + } + + return json.Marshal(out) + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil + case reflect.TypeOf(big.Int{}): + format := tag.Get("bigint") + if format == "string" { + b := val.Interface().(big.Int) + return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil + } + case reflect.TypeOf(decimal.Big{}): + format := tag.Get("decimal") + if format == "number" { + b := val.Interface().(decimal.Big) + f, ok := (&b).Float64() + if ok { + return []byte(b.String()), nil + } + + return []byte(fmt.Sprintf(`%f`, f)), nil + } + } + } + + return json.Marshal(v) +} + +func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { + if tagValue == "null" { + return []byte("null") + } + + typ := dereferenceTypePointer(reflect.TypeOf(val)) + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + case reflect.TypeOf(big.Int{}): + bigIntTag := tag.Get("bigint") + if bigIntTag == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(decimal.Big{}): + decimalTag := tag.Get("decimal") + if decimalTag != "number" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(types.Date{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + default: + if typ.Kind() == reflect.String { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + } + + return []byte(tagValue) +} + +func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { + if bytes.Equal(value, []byte("null")) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + typ := dereferenceTypePointer(v.Type()) + + switch typ.Kind() { + case reflect.Map: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + m := reflect.MakeMap(typ) + + for k, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) + } + + v.Set(m) + return nil + case reflect.Slice, reflect.Array: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled []json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + arrVal := v + + for _, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + arrVal = reflect.Append(arrVal, itemVal.Elem()) + } + + v.Set(arrVal) + return nil + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + t, err := time.Parse(time.RFC3339Nano, s) + if err != nil { + return fmt.Errorf("failed to parse string as time.Time: %w", err) + } + + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(t)) + return nil + case reflect.TypeOf(big.Int{}): + var b *big.Int + + format := tag.Get("bigint") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var ok bool + b, ok = new(big.Int).SetString(s, 10) + if !ok { + return fmt.Errorf("failed to parse string as big.Int") + } + } else { + if err := json.Unmarshal(value, &b); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + case reflect.TypeOf(decimal.Big{}): + var d *decimal.Big + format := tag.Get("decimal") + if format == "number" { + var ok bool + d, ok = new(decimal.Big).SetString(string(value)) + if !ok { + return fmt.Errorf("failed to parse number as decimal.Big") + } + } else { + if err := json.Unmarshal(value, &d); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + case reflect.TypeOf(types.Date{}): + var s string + + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + d, err := types.DateFromString(s) + if err != nil { + return fmt.Errorf("failed to parse string as types.Date: %w", err) + } + + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + } + } + + var val interface{} + + if v.CanAddr() { + val = v.Addr().Interface() + } else { + val = v.Interface() + } + + d := json.NewDecoder(bytes.NewReader(value)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(val) +} + +func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return typ, val + } + + return dereferencePointers(typ, val) +} + +func dereferenceTypePointer(typ reflect.Type) reflect.Type { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } else { + return typ + } + + return dereferenceTypePointer(typ) +} + +func isComplexValueType(typ reflect.Type) bool { + switch typ.Kind() { + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + fallthrough + case reflect.TypeOf(big.Int{}): + fallthrough + case reflect.TypeOf(decimal.Big{}): + fallthrough + case reflect.TypeOf(types.Date{}): + return true + } + } + + return false +} + +func isModelType(typ reflect.Type) bool { + if isComplexValueType(typ) { + return false + } + + if typ.Kind() == reflect.Struct { + return true + } + + return false +} diff --git a/lending/pkg/utils/pathparams.go b/lending/pkg/utils/pathparams.go index d3f35548c..d2d69bc14 100755 --- a/lending/pkg/utils/pathparams.go +++ b/lending/pkg/utils/pathparams.go @@ -106,12 +106,8 @@ func getSimplePathParams(ctx context.Context, parentName string, objType reflect pathParams[parentName] = valToString(objValue.Interface()) case types.Date: pathParams[parentName] = valToString(objValue.Interface()) - case types.BigInt: - pathParams[parentName] = valToString(objValue.Interface()) case big.Int: pathParams[parentName] = valToString(objValue.Interface()) - case types.Decimal: - pathParams[parentName] = valToString(objValue.Interface()) case decimal.Big: pathParams[parentName] = valToString(objValue.Interface()) default: diff --git a/lending/pkg/utils/requestbody.go b/lending/pkg/utils/requestbody.go index d9fcbdaab..b8f1864d1 100755 --- a/lending/pkg/utils/requestbody.go +++ b/lending/pkg/utils/requestbody.go @@ -5,7 +5,6 @@ package utils import ( "bytes" "context" - "encoding/json" "fmt" "io" "mime/multipart" @@ -26,12 +25,16 @@ var ( urlEncodedEncodingRegex = regexp.MustCompile(`application\/x-www-form-urlencoded.*`) ) -func SerializeRequestBody(ctx context.Context, request interface{}, requestFieldName string, serializationMethod string) (io.Reader, string, error) { +func SerializeRequestBody(ctx context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { requestStructType := reflect.TypeOf(request) requestValType := reflect.ValueOf(request) if isNil(requestStructType, requestValType) { - return nil, "", nil + if optional || !nullable { + return nil, "", nil + } + + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) } if requestStructType.Kind() == reflect.Pointer { @@ -40,7 +43,7 @@ func SerializeRequestBody(ctx context.Context, request interface{}, requestField } if requestStructType.Kind() != reflect.Struct { - return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType) + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) } requestField, ok := requestStructType.FieldByName(requestFieldName) @@ -51,23 +54,43 @@ func SerializeRequestBody(ctx context.Context, request interface{}, requestField // request object (non-flattened) requestVal := requestValType.FieldByName(requestFieldName) if isNil(requestField.Type, requestVal) { - return nil, "", nil + if optional || !nullable { + return nil, "", nil + } + + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestVal, tag.MediaType) } - return serializeContentType(requestFieldName, tag.MediaType, requestVal) + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) } } // flattened request object - return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType) + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], reflect.ValueOf(request), tag) } -func serializeContentType(fieldName string, mediaType string, val reflect.Value) (*bytes.Buffer, string, error) { +func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (*bytes.Buffer, string, error) { buf := &bytes.Buffer{} + if isNil(val.Type(), val) { + // TODO: what does a null mean for other content types? Just returning an empty buffer for now + if jsonEncodingRegex.MatchString(mediaType) { + if _, err := buf.Write([]byte("null")); err != nil { + return nil, "", err + } + } + + return buf, mediaType, nil + } + switch { case jsonEncodingRegex.MatchString(mediaType): - if err := json.NewEncoder(buf).Encode(val.Interface()); err != nil { + data, err := MarshalJSON(val.Interface(), reflect.StructTag(tag), true) + if err != nil { + return nil, "", err + } + + if _, err := buf.Write(data); err != nil { return nil, "", err } case multipartEncodingRegex.MatchString(mediaType): @@ -137,7 +160,7 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { writer.Close() return "", err } - d, err := json.Marshal(valType.Interface()) + d, err := MarshalJSON(valType.Interface(), field.Tag, true) if err != nil { writer.Close() return "", err @@ -242,7 +265,7 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { tag := parseFormTag(field) if tag.JSON { - data, err := json.Marshal(valType.Interface()) + data, err := MarshalJSON(valType.Interface(), field.Tag, true) if err != nil { return err } diff --git a/lending/pkg/utils/utils.go b/lending/pkg/utils/utils.go index ca0bcdad7..f630a3294 100755 --- a/lending/pkg/utils/utils.go +++ b/lending/pkg/utils/utils.go @@ -3,7 +3,6 @@ package utils import ( - "encoding/json" "fmt" "io" "math/big" @@ -13,8 +12,6 @@ import ( "time" "github.com/ericlagergren/decimal" - - "github.com/codatio/client-sdk-go/lending/v4/pkg/types" ) const ( @@ -34,12 +31,12 @@ var ( } ) -func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}) error { +func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}, tag string) error { data, err := io.ReadAll(body) if err != nil { return fmt.Errorf("error reading response body: %w", err) } - if err := json.Unmarshal(data, &out); err != nil { + if err := UnmarshalJSON(data, out, reflect.StructTag(tag), true, false); err != nil { return fmt.Errorf("error unmarshalling json response body: %w", err) } @@ -129,12 +126,8 @@ func valToString(val interface{}) string { switch v := val.(type) { case time.Time: return v.Format(time.RFC3339Nano) - case types.BigInt: - return v.String() case big.Int: return v.String() - case types.Decimal: - return v.String() case decimal.Big: return v.String() default: diff --git a/lending/sales.go b/lending/sales.go index 99274f69f..2598d0a74 100755 --- a/lending/sales.go +++ b/lending/sales.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type sales struct { Customers *salesCustomers diff --git a/lending/salescustomers.go b/lending/salescustomers.go index 22e19891d..08d8a3bb7 100755 --- a/lending/salescustomers.go +++ b/lending/salescustomers.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesCustomers) Get(ctx context.Context, request operations.GetCommerce case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceCustomer - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceCustomer + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceCustomer = out + res.CommerceCustomer = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesCustomers) Get(ctx context.Context, request operations.GetCommerce case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesCustomers) List(ctx context.Context, request operations.ListCommer case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceCustomers - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceCustomers + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceCustomers = out + res.CommerceCustomers = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesCustomers) List(ctx context.Context, request operations.ListCommer case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesdisputes.go b/lending/salesdisputes.go index 53abb8315..a4a92ce2a 100755 --- a/lending/salesdisputes.go +++ b/lending/salesdisputes.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesDisputes) Get(ctx context.Context, request operations.GetCommerceD case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceDispute - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceDispute + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceDispute = out + res.CommerceDispute = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesDisputes) Get(ctx context.Context, request operations.GetCommerceD case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesDisputes) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceDisputes - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceDisputes + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceDisputes = out + res.CommerceDisputes = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesDisputes) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/saleslocations.go b/lending/saleslocations.go index 783b3e035..53303606a 100755 --- a/lending/saleslocations.go +++ b/lending/saleslocations.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesLocations) Get(ctx context.Context, request operations.GetCommerce case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceLocation - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceLocation + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceLocation = out + res.CommerceLocation = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesLocations) Get(ctx context.Context, request operations.GetCommerce case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -230,12 +230,12 @@ func (s *salesLocations) List(ctx context.Context, request operations.ListCommer case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceLocations - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceLocations + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceLocations = out + res.CommerceLocations = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -250,12 +250,12 @@ func (s *salesLocations) List(ctx context.Context, request operations.ListCommer case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesmetrics.go b/lending/salesmetrics.go index 9596e8659..3ce909089 100755 --- a/lending/salesmetrics.go +++ b/lending/salesmetrics.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -138,12 +138,12 @@ func (s *salesMetrics) GetCustomerRetention(ctx context.Context, request operati case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceReport = out + res.CommerceReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -152,12 +152,12 @@ func (s *salesMetrics) GetCustomerRetention(ctx context.Context, request operati case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -273,12 +273,12 @@ func (s *salesMetrics) GetLifetimeValue(ctx context.Context, request operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceReport = out + res.CommerceReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -287,12 +287,12 @@ func (s *salesMetrics) GetLifetimeValue(ctx context.Context, request operations. case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -409,12 +409,12 @@ func (s *salesMetrics) GetRevenue(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceReport = out + res.CommerceReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -423,12 +423,12 @@ func (s *salesMetrics) GetRevenue(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesorders.go b/lending/salesorders.go index ae721a1d6..dc835d492 100755 --- a/lending/salesorders.go +++ b/lending/salesorders.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesOrders) Get(ctx context.Context, request operations.GetCommerceOrd case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceOrder - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceOrder + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceOrder = out + res.CommerceOrder = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesOrders) Get(ctx context.Context, request operations.GetCommerceOrd case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesOrders) List(ctx context.Context, request operations.ListCommerceO case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceOrders - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceOrders + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceOrders = out + res.CommerceOrders = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesOrders) List(ctx context.Context, request operations.ListCommerceO case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salespaymentmethods.go b/lending/salespaymentmethods.go index 55227c9d3..4b629fce3 100755 --- a/lending/salespaymentmethods.go +++ b/lending/salespaymentmethods.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesPaymentMethods) Get(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommercePaymentMethod - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommercePaymentMethod + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommercePaymentMethod = out + res.CommercePaymentMethod = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesPaymentMethods) Get(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesPaymentMethods) List(ctx context.Context, request operations.ListC case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommercePaymentMethods - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommercePaymentMethods + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommercePaymentMethods = out + res.CommercePaymentMethods = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesPaymentMethods) List(ctx context.Context, request operations.ListC case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salespayments.go b/lending/salespayments.go index cce319ce7..6b3f31466 100755 --- a/lending/salespayments.go +++ b/lending/salespayments.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesPayments) Get(ctx context.Context, request operations.GetCommerceP case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommercePayment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommercePayment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommercePayment = out + res.CommercePayment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesPayments) Get(ctx context.Context, request operations.GetCommerceP case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesPayments) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommercePayments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommercePayments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommercePayments = out + res.CommercePayments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesPayments) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesproductcategories.go b/lending/salesproductcategories.go index 7270e12f9..c989ff473 100755 --- a/lending/salesproductcategories.go +++ b/lending/salesproductcategories.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesProductCategories) Get(ctx context.Context, request operations.Get case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceProductCategory - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceProductCategory + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceProductCategory = out + res.CommerceProductCategory = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesProductCategories) Get(ctx context.Context, request operations.Get case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesProductCategories) List(ctx context.Context, request operations.Li case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceProductCategories - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceProductCategories + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceProductCategories = out + res.CommerceProductCategories = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesProductCategories) List(ctx context.Context, request operations.Li case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesproducts.go b/lending/salesproducts.go index 7e79e1dcd..b6ea4f3bf 100755 --- a/lending/salesproducts.go +++ b/lending/salesproducts.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesProducts) Get(ctx context.Context, request operations.GetCommerceP case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceProduct - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceProduct + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceProduct = out + res.CommerceProduct = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesProducts) Get(ctx context.Context, request operations.GetCommerceP case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesProducts) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceProducts - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceProducts + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceProducts = out + res.CommerceProducts = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesProducts) List(ctx context.Context, request operations.ListCommerc case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salesreports.go b/lending/salesreports.go index 6c4329005..72ab250af 100755 --- a/lending/salesreports.go +++ b/lending/salesreports.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -132,12 +132,12 @@ func (s *salesReports) GetOrders(ctx context.Context, request operations.GetComm case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceReport = out + res.CommerceReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -146,12 +146,12 @@ func (s *salesReports) GetOrders(ctx context.Context, request operations.GetComm case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -269,12 +269,12 @@ func (s *salesReports) GetRefunds(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceReport - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceReport + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceReport = out + res.CommerceReport = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -283,12 +283,12 @@ func (s *salesReports) GetRefunds(ctx context.Context, request operations.GetCom case httpRes.StatusCode == 404: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/salestransactions.go b/lending/salestransactions.go index b9de0b06c..c1e07f48c 100755 --- a/lending/salestransactions.go +++ b/lending/salestransactions.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *salesTransactions) Get(ctx context.Context, request operations.GetComme case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceTransaction - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceTransaction + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceTransaction = out + res.CommerceTransaction = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *salesTransactions) Get(ctx context.Context, request operations.GetComme case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *salesTransactions) List(ctx context.Context, request operations.ListCom case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.CommerceTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.CommerceTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.CommerceTransactions = out + res.CommerceTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -254,12 +254,12 @@ func (s *salesTransactions) List(ctx context.Context, request operations.ListCom case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/transactions.go b/lending/transactions.go index 96831baf4..55da71725 100755 --- a/lending/transactions.go +++ b/lending/transactions.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending type transactions struct { AccountTransactions *transactionsAccountTransactions diff --git a/lending/transactionsaccounttransactions.go b/lending/transactionsaccounttransactions.go index 1c13bb1d5..215dbc50a 100755 --- a/lending/transactionsaccounttransactions.go +++ b/lending/transactionsaccounttransactions.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *transactionsAccountTransactions) Get(ctx context.Context, request opera case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAccountTransaction - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAccountTransaction + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAccountTransaction = out + res.AccountingAccountTransaction = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *transactionsAccountTransactions) Get(ctx context.Context, request opera case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *transactionsAccountTransactions) List(ctx context.Context, request oper case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAccountTransactions - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAccountTransactions + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAccountTransactions = out + res.AccountingAccountTransactions = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *transactionsAccountTransactions) List(ctx context.Context, request oper case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/transactionsdirectcosts.go b/lending/transactionsdirectcosts.go index e904fc93e..3827ac798 100755 --- a/lending/transactionsdirectcosts.go +++ b/lending/transactionsdirectcosts.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -127,12 +127,12 @@ func (s *transactionsDirectCosts) DownloadAttachment(ctx context.Context, reques case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -229,12 +229,12 @@ func (s *transactionsDirectCosts) Get(ctx context.Context, request operations.Ge case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingDirectCost - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingDirectCost + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingDirectCost = out + res.AccountingDirectCost = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -247,12 +247,12 @@ func (s *transactionsDirectCosts) Get(ctx context.Context, request operations.Ge case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -347,12 +347,12 @@ func (s *transactionsDirectCosts) GetAttachment(ctx context.Context, request ope case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingAttachment - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingAttachment + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingAttachment = out + res.AccountingAttachment = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -363,12 +363,12 @@ func (s *transactionsDirectCosts) GetAttachment(ctx context.Context, request ope case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -467,12 +467,12 @@ func (s *transactionsDirectCosts) List(ctx context.Context, request operations.L case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingDirectCosts - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingDirectCosts + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingDirectCosts = out + res.AccountingDirectCosts = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -485,12 +485,12 @@ func (s *transactionsDirectCosts) List(ctx context.Context, request operations.L case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -585,12 +585,12 @@ func (s *transactionsDirectCosts) ListAttachments(ctx context.Context, request o case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.Attachments - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.Attachments + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Attachments = out + res.Attachments = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -601,12 +601,12 @@ func (s *transactionsDirectCosts) ListAttachments(ctx context.Context, request o case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/transactionsjournalentries.go b/lending/transactionsjournalentries.go index 0a0352123..3bb071017 100755 --- a/lending/transactionsjournalentries.go +++ b/lending/transactionsjournalentries.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *transactionsJournalEntries) Get(ctx context.Context, request operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingJournalEntry - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingJournalEntry + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingJournalEntry = out + res.AccountingJournalEntry = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *transactionsJournalEntries) Get(ctx context.Context, request operations case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *transactionsJournalEntries) List(ctx context.Context, request operation case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingJournalEntries - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingJournalEntries + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingJournalEntries = out + res.AccountingJournalEntries = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *transactionsJournalEntries) List(ctx context.Context, request operation case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/transactionsjournals.go b/lending/transactionsjournals.go index 7eb2de215..0e818c010 100755 --- a/lending/transactionsjournals.go +++ b/lending/transactionsjournals.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *transactionsJournals) Get(ctx context.Context, request operations.GetAc case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingJournal - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingJournal + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingJournal = out + res.AccountingJournal = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *transactionsJournals) Get(ctx context.Context, request operations.GetAc case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *transactionsJournals) List(ctx context.Context, request operations.List case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingJournals - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingJournals + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingJournals = out + res.AccountingJournals = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *transactionsJournals) List(ctx context.Context, request operations.List case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/lending/transactionstransfers.go b/lending/transactionstransfers.go index 7a2067554..a5c7f0951 100755 --- a/lending/transactionstransfers.go +++ b/lending/transactionstransfers.go @@ -1,6 +1,6 @@ // Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. -package codatlending +package lending import ( "bytes" @@ -112,12 +112,12 @@ func (s *transactionsTransfers) Get(ctx context.Context, request operations.GetA case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingTransfer - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingTransfer + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingTransfer = out + res.AccountingTransfer = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -130,12 +130,12 @@ func (s *transactionsTransfers) Get(ctx context.Context, request operations.GetA case httpRes.StatusCode == 429: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -234,12 +234,12 @@ func (s *transactionsTransfers) List(ctx context.Context, request operations.Lis case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.AccountingTransfers - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.AccountingTransfers + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.AccountingTransfers = out + res.AccountingTransfers = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } @@ -252,12 +252,12 @@ func (s *transactionsTransfers) List(ctx context.Context, request operations.Lis case httpRes.StatusCode == 409: switch { case utils.MatchContentType(contentType, `application/json`): - var out *shared.ErrorMessage - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + var out shared.ErrorMessage + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.ErrorMessage = out + res.ErrorMessage = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) }